Giter VIP home page Giter VIP logo

rss-scraper's Introduction

rss-scraper

Read exchange rate, save to db and returns via API

Installation

Before installing this project, please make sure that you have python 3.7 and PostgreSQL installed on your computer

  1. Clone the repository $ git clone https://github.com/szewczykmira/rss-scraper.git

  2. Enter the directory $ cd rss-scraper

  3. Install all dependencies $ pip install -r requirements.txt

  4. Set SECRET_KEY environment variable $ export SECRET_KEY='<yoursecretkey>'

  5. Create PostgreSQL superuser $ createuser --superuser --pwprompt exchangeuser

  6. Create PostgreSQL database $ createdb exchangerate

  7. Prepare the database $ ./manage.py migrate

  8. This project requires redis. $ docker run -d -p 6379:6379 redis

Development

  1. Install project with steps from Installation

  2. Install development dependencies with $ pip install -r requirements-dev.txt

  3. Enable pre-commit hooks $ pre-commit install

  4. To run test $ pytest

Running application

  1. Follow steps from installation.
  2. Make sure that redis is running.
  3. Run celery broker $ celery -A exchangerate worker -B -l info
  4. Run application $ ./manage.py runserver

Architecure

This is simple Django project with one app - Rates that depends on postgreSQL database. Exchangerate is updating it's rates everyday at 1am using celery.

Current rates can be fetched by one of two urls:

  • localhost:8000 to dispatch rates for all currencies
  • localhost:8000/<currency_code> for specific currency.

API is created with django-rest-framework and I haven't introduced nothing new so there are no tests for that. API is developed only to fetch data so neither create nor delete is implemented.

rss-scraper's People

Contributors

szewczykmira avatar dependabot[bot] 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.