BelgianBiodiversityPlatform / openup-rbins

Source code of the http://projects.biodiversity.be/openuprbins/ website.
1 stars 0 forks source link

========================= OpenUP RBINS Contribution

What is it ?

This repository contains all source code written in the context of helping the RBINS to publish its high-resolution beetles pictures to the OpenUP / Europeana_ project.

It consists of:

(Webapp) Requirements

Required Python packages are listed in requirements.txt, install with:

::

$ pip install -r requirements.txt

The application requires the following environment variables to run:

(Webapp) Running locally

To keep auto-reaload working:

::

$ foreman run python manage.py runserver 0.0.0.0:5000

OR to ensure same running details than on heroku:

::

$ foreman start

(Webapp) Deploy to staging

::

$ git push heroku master

(Webapp) Install:

$ python manage.py syncdb

Data import:

The data import process takes as input:

And will output:

Process overview:

!!! Steps 1-3 are overly fragile and complex, but currently necessary as the CORRECT taxonomic data is not present in the Excel file and has to be extracted from file path/names !!! !!! Notes for rewriting this process (and the related data requirements can be found in data_import_tools/import_review.rst)

1) data_import_tools/imagestransformation/transform.rb resize the images, add overlays, some padding, ... 2) The Excel file and the result of an image directory "walk" are reconciled and imported in the "OpenUP" PostgreSQL database (will be consumed by BioCASE provider) 3) data_import_tools/images_transformation/step2/move_files.rb loop on the newly created rbinsphotos table, and for each row rename the associated image to .jpg and move it to a flat directory structure. 4) We publish these static files on the Internet 5) We use the a CSV dumpp of the "OpenUP" database to populate the "website" database.

Step 1: details

Step 2: details

Step 5: details:

::

$ psql -h dev -U postgres -d openup_rbins
openup_rbins=# COPY (SELECT * FROM rbinsphotos) TO 'openup_export.csv' WITH CSV HEADER;

::

$ ./manage.py load_rbins_data data/openup_export.csv --truncate

.. _RBINS: http://www.naturalsciences.be/ .. _OpenUP: http://open-up.eu/ .. _Europeana: http://www.europeana.eu/ .. _BioCASE: http://www.biocase.org/ .. _Django: https://www.djangoproject.com/