Giter Site home page Giter Site logo

json_parser's Introduction

json_parser

  • json_parser is a pipeline where a given json input is mapped to a certain format and saved back to postgres table

How to run the code

  • First create the database using the given make file make run-db
    To run this succesfully you need to have docker installed in your environment. More information can be found on https://docs.docker.com/engine/install/.

  • Then, install dependencies;
    pip install -r requirements.txt

  • Then run models.py to create a new database using sqlalchemy as the ORM;
    python -m src.models

  • We can now run our parser to parse the data and save it in Postgres
    python -m src.parser
    The parser can be written in pure Python to reduce the package size, but Pandas is fun and gives a lot of out of the box methods for rapid development.

How to run the tests

  • In the current format there is only one requirement tested. This is open to improvement. For example we can also try to test the datetime fileds before parsing to make sure they are type of a datetime object.
    python -m unittest tests.test_pipeline

How to check the records is Postgres

  • Connect to psql docker. docker exec -it {container_id} bash
  • Connect to psql psql -U postgres
  • Use the retriever database \c retriever;
  • To check records do; select * from retriever_table;
  • To check record types and confirm the data being stored as json; select pg_typeof("obj") from retriever_table;

json_parser's People

Contributors

mburakergenc avatar

Stargazers

 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.