GithubHelp home page GithubHelp logo

nplutt / contacts Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 106 KB

Imports contact details and allows the data to be searched

Python 87.57% Mako 0.69% Shell 3.86% JavaScript 7.87%
sqlalchemy chalice python aws lambda rds postgresql

contacts's Introduction

Contacts

Allows users to upload a csv containing contact details and allows them to be searched by any data field.

Alt text

API

All endpoints with GET methods support paging using limit and offset query params. The limit value is not required but defaults to 25 and same with the offset value which defaults to 0. If the returned count value is equal to the limit value, that means there are more records available.

  • /user?searchText="nick"&searchField="firstName"&limit=2&offset=1
{
  "POST": {
    "firstName": "nick",
    "lastName": "plutt",
    "emailAddress": "[email protected]",
    "metaData": [
      {
        "fieldType": "phone number",
        "fieldData": "612-709-5521"
      }
  },
  "GET": {
    "meta": {
      "limit": 25,
      "offset": 0,
      "count": 25
    },
    "data": [
      {
        "firstName": "nick",
        "lastName": "plutt",
        "emailAddress": "[email protected]",
        "metaData": [
          {
            "fieldType": "phone number",
            "fieldData": "612-709-5521"
          }
        ]
      }
    ]
  }
}
  • /user/{user_id}
{
  "GET": {
    "meta": {
      "limit": 25,
      "offset": 0,
      "count": 1
    },
    "data": {
      "firstName": "nick",
      "lastName": "plutt",
      "emailAddress": "[email protected]",
      "metaData": [
        {
          "fieldType": "phone number",
          "fieldData": "612-709-5521"
        }
      ]
    }
  },
  "DELETE": { }
}
  • /upload
{
  "POST": {
    "Upload raw CSV file octet-stream in body": {}
  }
}

Database

The database is an AWS RDS instance running PostgreSQL. The database is maintained and created using Alembic migrations. If you would like to see the database schema it is defined here.

API Quickstart

$ mkvirtualenv contacts
$ cd contacts-api
$ pip install -Ur requirements.txt -Ur dev-requirements.txt
$ ./run_local.sh 

Run Tests

pytest -v test/

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.