Code Monkey home page Code Monkey logo

paranuara's Introduction

Paranuara

A code assignment for Hivery job interview https://github.com/joaosgreccia/hivery-backend-challenge

Installation

This program requires Python 3.5 or above to run.

  1. Some requirements:

    Install pip, if you don't already have:

    easy_install pip
    

    Install virtualenv if you don't already have

    pip3 install virtualenv
    
  2. Choose a folder to install Paranuara. Create and activate new virtualenv.

    On Unix:

    virtualenv myenv
    source myenv/bin/activate
    

    On Windows:

    virtualenv myenv
    myenv\scripts\activate
    
  3. Install Paranuara

    pip install https://github.com/govorunov/paranuara/archive/master.zip
    

    This will add paranuara command to the console, which offers same syntax one could expect from python manage.py script.

  4. Run these commands to instantiate new paranuara application:

    paranuara migrate
    paranuara loaddata assignment
    paranuara runserver
    

Then navigate to http://localhost:8000

Usage

  • To wipe database and import new JSON data use following commands:

    paranuara flush
    paranuara load_companies companies.json
    paranuara load_people people.json
    

    Where companies.json and people.json are locations to JSON files containing new data to import. JSON files should be in the format specified in the original assignment.

  • To run tests:

    paranuara test paranuara
    

Rest API endpoints:

  1. http://localhost:8000/api/employees/1/

    Given a company (index), returns all its employees. Where 1 is index of the company as specified in source data.

  2. http://localhost:8000/api/twopeople/1/2/

    Given 2 people, provides their information (Name, Age, Address, phone) and the list of their friends in common which have brown eyes and are still alive. Where 1 and 2 are indexes of people as specified in source data.

  3. http://localhost:8000/api/fruits_and_vegetables/1/

    Given 1 person, provides a list of fruits and vegetables they like. This endpoint respects this interface for the output:

    {"username": "Ahi", "age": "30", "fruits": ["banana", "apple"], "vegetables": ["beetroot", "lettuce"]}

paranuara's People

Contributors

govorunov avatar

Watchers

 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.