/Django_data_project

Project where I did different actions with data via API

Primary LanguagePython

Django-data project

In this project I implemented various actions with data by Django.

Deployed with docker: docker push enoshima/django_data_app:tagname
And then run: docker run --name data_cont -d -p 8000:8000 enoshima/django_data_app:latest

  • If current ports are already used, then: first one is port which will be displayed and second one is the
    port specified in the Dockerfile. Hence change first one to match to another port.
  • Load from Excel to DB
  • Exporting from DB with SQL-RAW actions
  • Exporting from DB with Pandas actions

Data loading steps

  • data_processing folder you can find view which in-turn triggers Injector to load data from Excel to DB

    Actions considering loading
    1. Read data from Excel via Pandas
    2. Map correct columns from Pandas to model in DB
    3. If col. is datetime, then change format to **not naive timezone**
    4. If col. is delta, then, depending on the cell format, convert to float and replace ',' if exists
    5. Use `generator` with `zip` to fill two cols. of DB simultaneously

CRUD methods

  1. If POST is sent => load from Excel will be done + if DB isn't empty -> clear() at first
  2. Depending on the URL, GET will retrieve and do actions with data either via SQL or Pandas

Further remarks

  1. when putting data from db to pandas DataFrame, at first use same columns in df
  2. How to figure out SQL table name in db?