Coder Social home page Coder Social logo

bjenk1 / npi_files Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eddyizm/npi_files

0.0 0.0 0.0 2.11 MB

repo to automate NPI file download, extract and load into a database and create an api for endpoint

License: Mozilla Public License 2.0

Shell 0.41% Python 89.32% TypeScript 0.82% HTML 9.33% Dockerfile 0.09% SCSS 0.03%

npi_files's Introduction

NPI_FILES

repo to automate NPI file download, extract and load into a database and create an api for endpoint

Podman setup in script

work in progress... pod_setup.sh

Local Development for Django

The instructions below are specific to local Postgres environment. This is the current default method.

Once the application is more flushed out, this repo will be updated for instructions to containerize with a Postgres database.

Prerequisite

This requirement will have you create a copy of .env.dummy and update the file with appropriate values so you don't check in any passwords or settings. These values are referenced in Django's settings.py file

  1. Navigate to NPI_FILES/backend

  2. Create a copy of .env.dummy
    cp .env.dummy .env

  3. Update all the relevant fields with your local postgres in backend/.env.

Backend setup

  1. Ensure you are in NPI_FILES directory and create virtual environment python -m venv env

  2. Activate your virtual environment
    source env/bin/activate
    NOTE: Windows may use this env/Scripts/activate path instead

  3. Install requirements
    pip install -r backend/requirements.txt

  4. Make db migrations
    python backend/manage.py migrate

  5. Create super user before logging in to admin
    python backend/manage.py createsuperuser

  6. Launch Django python backend/manage.py runserver


Custom Management Commands

These commands are used to run automated tasks. The order in this sense matters as later this can be used with an orchestration tool.

  1. fetch_urls

    • scrapes urls of npi zip files to download
  2. get_download

    • this one is getting list of files to download
    • downloading files that have yet to be downloaded
    • then loading them up to the db.
    • needs work and to be cleaned up.
  3. load_large_csv

    • This function upload csv to a target table using pg command.
    • need to remember why i did this, probably for the 9gb file
  4. seed_sample_data

    • loads npi sample file with a 110 records

Misc

  1. hello_world
    • just a dummy command to verify things are working and build use as a template.

npi_files's People

Contributors

eddyizm avatar stevenhalverson avatar leeoku avatar llnovall 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.