Giter Site home page Giter Site logo

django-xml-to-db's Introduction

PyPi packages info to Django

The point of this task was to get RSS channel info once every 24h, parse it and display data in a user-friendly manner.

How it's working

Firstly we get the data from the RSS feed then we are parsing it, doing additional requests to get the data then converting it to pandas df which can be easily saved to our DB. Everything is repeated every 24 h

Data is available in two formats:

  • HTML table with pagination done in JS
  • under /API/package with custom pagination class

The task is done in a way to cover most of my skills so we are using:

  • forms
  • models
  • serializers
  • filters
  • rest framework
  • swagger
  • task schedulers
  • js
  • HTML
  • CSS

(this approach is redundant it only serves to show the use cases)

How to run it

Create virtualenv and install requirements.txt

virtualenv env 
env/Scripts/activate
pip install -r requirements.txt

then run

python manage.py makemigrations 
python manage.py migrate
python manage.py runserver

Your app will be running on localhost

Additional info

Admin panel is turned off via

ADMIN_ENABLED = False

variable, if you wanna turn it on just change False to True. For more robust solution create .env file declare variable there and then

ADMIN_ENABLED = str(os.environ.get('ADMIN_ENABLED'))

Other approaches

In my approach, I pretty much scrape and do JSON requests to PyPI servers. The downside to this is a hard limit on the number of requests that PyPI allows. This looks something like this

Job "BackgroundWorker.update_db (trigger: interval[1 day, 0:00:00], next run at: 2022-09-19 13:08:26 CEST)" raised an exception

To omit drawbacks use google big query.

django-xml-to-db's People

Contributors

winterodin avatar

Watchers

 avatar

django-xml-to-db's Issues

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.