Giter Site home page Giter Site logo

pd's Introduction

Pipeline discovery data match application

Prototype application to facilitate data matching between pipeline inspections.

Project setup

Pre-requisites:

  • postgres >= 9.5
  • python >= 3.6
  1. Clone the repository:

$ git clone [email protected]:devonwalshe/pd.git && cd pd

  1. Install python dependencies:

$ pip install -r requirements.txt

  1. Bootstrap seed data

$ createdb pd $ python bootstrap.py

  1. Start flask api server:

$ python -m api.api

  1. test API server response:

http://localhost:5000/pipelines

  1. Start frontend

cd frontend && PORT=3002 npm run dev

  1. Navigate to frontend

http://localhost:3002

Project Components

  • API
    • Python ORM layer peewee to handle data interface
    • Python webserver flask-restful exposing a REST API
  • Data
    • Inspection run test data
    • Matcher output test data
    • Database dumps
  • Frontend
    • Frontend application facilitating the manual input for the data match (...)
  • Matcher
    • Python application powering the automated data match
  • Tests
    • application wide tests

Introspecting application models

The model definitions, including their attributes and relations are found in api/models/models.py

These don't necessarily make it clear which data is available on each item in the database, so following is instructions to get json like responses from each model:

  1. Start an interactive python session from the project root: $ python (Alternatively you can use ipython which can be installed with pip install ipython)
  2. Load in all the model definitions: from api.models.models import *
  3. Get a single instance of any given model: item = PipeSection.get_by_id(1) (you can replace PipeSection with any model from the api/models/models.py file)
  4. Introspect the model relations and associated data: model_to_dict(item) or model_to_dict(item, recurse=False) if you don't want to include the relations

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.