Giter VIP home page Giter VIP logo

afvalcontainers's Introduction

Afvalcontainers

Scrape API

Python script to download all the containers, containertypes and wells from https://bammensservice.nl api

Swagger documentation can be found here after you login: https://bammensservice.nl/api/doc

LIVE data from kilogram.nl, sidcon and enevo.

Model Overview



                             +--------------------+
+-----------------+          |                    |
|      Type       +---------->     Container      |     Removable Container
+-----------------+          |                    |
                             +---------+----------+
                                       |
                                       |
                             +---------v----------+
                             |                    |
                             |        Well        |     Hole in the ground for container
                             |                    |
                             +---------+----------+
                                       |
                                       |
                                       |
                             +---------v----------+
                             |                    |     Collection of wells
                             |       Site         |
                             |                    |
                             +--------------------+

### Import Overview ###


             +---------------+
             |  Bammens API  |      ~12.500 wells/containers
             +----------+----+
                        |
             +----------v----+
             |  Scrape API   |
             +-----+---------+
Feedback           |
             +-----v---------+
     <-------+  BGT merge    |       ~8500 wells merged with BGT (8-2018)
             +------+--------+
                    |
Feedback            |
             +------v--------+
     <-------+  Cleanup      |       Fills site endpoint for route planning/ dashboards
             +------+--------+
                    |
                    |
Feedback     +------v--------+
    <--------+  API / Geo    |
             +---------------+

Install procedure

git clone https://github.com/Amsterdam/afvalcontainers.git afvalcontainers
cd afvalcontainers

Before you can use the api you must create the login environment variables

export CKAN_API_KEY=****
export BAMMENS_API_USERNAME=****
export BAMMENS_API_PASSWORD=****

Start the docker database and run the download en upload scripts.

docker-compose build
docker-compose up

TIP

check the deploy import scrips.

this import process dumps 1) the raw bammens data, 2) the cleaned data and the final data with sites 3) in the object store for the past 20 days! so you can start and debug in any step in the import process.

db_slurp=raw bammens data
db_dump=first imported data
db_cleaned=final cleanup data with sites

Local development

Create a local environment and activate it:

virtualenv --python=$(which python3) venv
source venv/bin/activate

Start development database

	docker-compose up database

load production data:

	docker-compose exec database update-db.sh afvalcontainers
pip install -r requirements.txt

The api folder and scrape_api folder both have requirements.

scrape api

	bash load_bgt.sh (replace spreeker with your user name)

See README in the scrape_api folder.

This will load all needed BGT and WFS data source. No you should be able to start developing.

Afvalcontainer API

This is a standard Django Rest Framework API.

	docker-compose up database
	python manage.py runserver

afvalcontainers's People

Contributors

spreeker avatar lytrix avatar dependabot[bot] avatar snelis avatar tcoenen avatar kelpas avatar yelsherbini avatar sercanyaldiz avatar bheupers avatar nuclyus avatar catejst avatar

Watchers

James Cloos 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.