PRTR
A project for handling the European Pollutant Release and Transfer Register (E-PRTR) data and publishing it as a national web service.
https://github.com/sykefi/prtr
Category: Emissions
Sub Category: Carbon Offsets and Trading
Keywords
emissions pollutants
Last synced: about 6 hours ago
JSON representation
Repository metadata
A project for handling the European Pollutant Release and Transfer Register (E-PRTR) data and publishing it as a national web service
- Host: GitHub
- URL: https://github.com/sykefi/prtr
- Owner: sykefi
- License: mit
- Created: 2021-07-15T10:32:17.000Z (almost 4 years ago)
- Default Branch: dev
- Last Pushed: 2025-03-14T06:24:29.000Z (about 2 months ago)
- Last Synced: 2025-04-17T22:58:54.419Z (13 days ago)
- Topics: emissions, pollutants
- Language: TypeScript
- Homepage:
- Size: 8.78 MB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
PRTR
A project for handling the European Pollutant Release and Transfer Register (i.e. E-PRTR) data and publishing it as a national web service (API & user interface). The project is funded by the Ministry of the Environment and implemented by the Finnish Environment Institute.
The development version of the UI is published at syke-prtr-d-web.azurewebsites.net.
The development version of the API (serving only Finnish PRTR data) is published at syke-prtr-fastapi-d-cont.azurewebsites.net.
A prototype of the user interface (or portal) is published at prtr.fi.
Getting Started with the UI
This project was bootstrapped with Create React App. See the autogenerated documentation in the other README.md
Prerequisites
Installation
$ cd ui
$ npm install
Running the app locally
npm start
Running the tests
To open the interactive dashboard (Cypress) for running and debugging tests, run:
npm run cypress
Configuration
By default the app uses the PRTR API at the address defined in .env.development. To use local backend instead, you can add a new file .env.development.local and add the same environment variable there as REACT_APP_PRTR_SERVER=http://localhost:8000
.
To disable query caching (with React Query) on local development, you can also add the environment variable REACT_APP_PRTR_DATA_CACHE_TIME=0
.
Updating translations from external source
To keep the external translation source and the translation files of the project in sync, it is recommended to make the additions or edits first in the external translation source and only then update the project translation files as instructed below:
- Download and save the external translation table(s) as utf-8 encoded CSV file(s).
- In directory ui/translation_source, replace one or more of the current CSV files with (an) updated table(s).
- Check with git diff that the changes/additions seem as intended.
cd ui
(if not already there)python import_translations.py
(with any Python 3.x)- Check with git diff that the changes/additions to translation (JSON) files seem appropriate.
- Optional step: run
npm start
ornpm run build
to check that the project still compiles (if there were changes in the translation keys, there may be TS/compile errors now). - Commit & push the changes and enjoy your new localized content.
Code style
The project is currently formatted with Prettier. In VSCode, the easiest way to format is to use the plugin prettier-vscode and the following settings:
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
Getting Started with the API
Prerequisites
Miniconda or Anaconda package manager for Python.
Installation
$ git clone https://github.com/sykefi/PRTR.git
$ cd PRTR/api
$ conda env create -f dev-env.yml
$ conda activate prtr
Data import (optional)
- E-PRTR data is available for download at industry.eea.europa.eu/download / eea.europa.eu/data-and-maps/data (e.g. Industrial_Reporting_Database_v4_March_2021.accdb)
- Previously imported PRTR dataset for Finland is already included as CSV files in api/api/assets
- The data import script requires installation of driver for MS for Access files
- Prior to running the script, add a new file .env to
api/data_import/
containing at least the following environment variable: PRTR_DB_FILE_PATH=path\to\your\prtr\data\*.accdb - Other settings (such as country code) can be adjusted in data_import/conf.py
To execute the data import, run:
$ python data_import_main.py
Running the server locally
$ uvicorn main:app --reload
API should now be accessible at localhost:8000.
Running the tests
$ python -m pytest tests/
Getting Started with the Air-pollutant-map
Changes for the air-pollutant-map (tab Hajapäästöt in the application) are made in the directory air-pollutant-map. Air-pollutant-map is originally implemented with Vue, therefore it's code is maintained separately from UI. Build of air-pollutant-map is placed inside the public-directory of UI so that the build runs on the same server as the main app. Running air-pollutant-map is embedded in to the UI with an iframe.
Whenever new changes are made to the air-pollutant-map, new build needs to be made and copied in ui/public/air-pollutant-map. Dev-environment of air-pollutant-map can be used in local testing, but prod-environment needs to be used when changes are published. More information about updating the changes in the other README.md
Owner metadata
- Name: Finnish Environment Institute (Syke)
- Login: sykefi
- Email:
- Kind: organization
- Description:
- Website: http://www.syke.fi
- Location: Finland
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/53511058?v=4
- Repositories: 21
- Last ynced at: 2023-03-05T17:36:13.466Z
- Profile URL: https://github.com/sykefi
GitHub Events
Total
- Delete event: 1
- Member event: 1
- Push event: 3
- Pull request event: 4
- Create event: 1
Last Year
- Delete event: 1
- Member event: 1
- Push event: 3
- Pull request event: 4
- Create event: 1
Committers metadata
Last synced: 1 day ago
Total Commits: 466
Total Committers: 5
Avg Commits per committer: 93.2
Development Distribution Score (DDS): 0.335
Commits in past year: 6
Committers in past year: 2
Avg Commits per committer in past year: 3.0
Development Distribution Score (DDS) in past year: 0.5
Name | Commits | |
---|---|---|
Joose Helle | j****e@g****m | 310 |
Ismo Lahtinen | i****n@s****i | 98 |
Daniel | d****n@g****m | 41 |
mirkosillanp | m****a@g****m | 16 |
Haaranen Daniel | D****n@e****i | 1 |
Committer domains:
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 0
Total pull requests: 90
Average time to close issues: N/A
Average time to close pull requests: 1 day
Total issue authors: 0
Total pull request authors: 4
Average comments per issue: 0
Average comments per pull request: 0.08
Merged pull request: 86
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: 6 minutes
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
Top Pull Request Authors
- hellej (33)
- sykelahtineni (26)
- danielhaaranen (18)
- mirkosillanp (13)
Top Issue Labels
Top Pull Request Labels
- enhancement (1)
Dependencies
- 1751 dependencies
- @types/react-router-dom ^5.1.8 development
- @types/react-select ^4.0.17 development
- @types/styled-components ^5.1.14 development
- eslint ^7.32.0 development
- eslint-plugin-cypress ^2.11.3 development
- prettier ^2.4.1 development
- @chakra-ui/icons ^1.0.15
- @chakra-ui/react ^1.6.7
- @emotion/react ^11.4.1
- @emotion/styled ^11.3.0
- @testing-library/jest-dom ^5.14.1
- @testing-library/react ^11.2.7
- @testing-library/user-event ^12.8.3
- @types/jest ^26.0.24
- @types/node ^12.20.23
- @types/react ^17.0.20
- @types/react-dom ^17.0.9
- cypress ^8.3.1
- framer-motion ^4.1.17
- i18next ^20.6.0
- i18next-browser-languagedetector ^6.1.2
- i18next-http-backend ^1.3.1
- ol ^6.7.0
- react ^17.0.2
- react-dom ^17.0.2
- react-i18next ^11.11.4
- react-icons ^4.2.0
- react-query ^3.24.4
- react-router-dom ^5.3.0
- react-scripts 4.0.3
- react-select ^4.3.1
- styled-components ^5.3.1
- typescript ^4.4.2
- wait-on ^6.0.0
- web-vitals ^1.1.2
- flake8 <=3.9.2
- pytest <=6.2.4
- requests *
- actions/checkout v2 composite
- azure/docker-login v1 composite
- actions/checkout v2 composite
- azure/docker-login v1 composite
- azure/login v1 composite
- azure/webapps-deploy v2 composite
- actions/checkout v2 composite
- azure/docker-login v1 composite
- azure/login v1 composite
- azure/webapps-deploy v2 composite
- actions/checkout v2 composite
- actions/setup-node v2 composite
- azure/login v1 composite
- azure/webapps-deploy v2 composite
- actions/checkout v2 composite
- actions/setup-node v2 composite
- azure/login v1 composite
- azure/webapps-deploy v2 composite
- tiangolo/uvicorn-gunicorn-fastapi python3.8 build
Score: 1.6094379124341003