GithubHelp home page GithubHelp logo

gaviti-task's Introduction

"Gaviti" Exam/Task

This is my code for the task. it uses Flask, PyMongo and Celery to serve 2 endpoints:

  • POST /search => allows to search for records in a local MongoDB by 2 fields, 'startDate' and 'endDate'. the results of the query are saved locally and the response is a link to download the local file with the results.
  • GET /download/ => get specific file by the filename (excluding file format). response is the content of file.

Dependencies

You would need Python 3.X installed on your computer to use this.

Setup

Clone this repo

git clone https://github.com/Moshe-Malka/gaviti-task.git

Use the package manager pip to install the requirements.

pip3 install -r requirements.txt

MongoDB

Download and install MongoDB you can create dummy data using Mockaroo and then import that data to MongoDB using the command:

mongoimport --db <name_of_your_db> --collection <name_of_your_collection> --drop --file <json_file_path>

NOTE: make sure the data has a field called "timestamp" and it contains a unix timetampe integer (long).

Redis

Download and install Redis

Usage

  1. run the mongodb service: Mac: brew services start mongodb Windows: mongod

  2. run the redis service: Mac: redis-server Windows: redis-server.exe

3)run the flask app: python3 main.app

you can test it using cUrl or postman.

gaviti-task's People

Contributors

moshe-malka avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.