The API contains and deploys summary information for three Pollutant Release and Transfer Register (PRTR) systems. The three PRTR systems are the National Pollutant Release Inventory (NPRI), the National Pollutant Inventory (NPI), and the Toxics Release Inventory (TRI). The PRTR_transfers_summary database (see the SQLite database) provides the summary information for the data from the the PRTR_transfers database obtained by the data engineering procedure presented in the public GitHub repository PRTR_transfers.
The EERD model in the following figure represents the PRTR_transfers_summary database schema created based on the records from the PRTR_transfers database (see link).
A conda environment can be created by executing the following command:
conda env create -n PRTR_FastAPI -f environment.yml
The above command is written assuming that you are in the folder containing the .yml file, i.e. the root folder PRTR_transfers_FastAPI.
If you are working as a Python developer, you should avoid both ModuleNotFoundError
and ImportError
(see the following link). Thus, follow the steps below to solve the above mentioned problems:
-
Run the following command in order to obtain the PRTR_transfers_FastAPI project location and then saving its path into the variable PACKAGE
PACKAGE=$(locate -br '^PRTR_transfers_FastAPI$')
-
Check the PACKAGE value by running the following command
echo $PACKAGE
-
Run the following command to add the PRTR_transfers_FastAPI project to the system paths
export PYTHONPATH="${PYTHONPATH}:$PACKAGE"
If you prefer to save the path to the PRTR_transfers_FastAPI project folder as a permanent environment variable, follow these steps:
-
Open the .bashrc file with the text editor of your preference (e.g., Visual Studio Code)
code ~/.bashrc
-
Scroll to the bottom of the file and add the following lines
export PACKAGE=$(locate -br '^PRTR_transfers_FastAPI$') export PYTHONPATH="${PYTHONPATH}:$PACKAGE"
- Save the file with the changes
-
You can open another terminal to verify that the variable has been successfully saved by running the following command
echo $PYTHONPATH
This was deployed at AWS where you can also test it from the docs endpoint
WebSite: http://ec2-50-19-131-127.compute-1.amazonaws.com/
API documentation: http://ec2-50-19-131-127.compute-1.amazonaws.com/v1/api_documentation
Run the following command for local deployment
python run.py
Go to https://127.0.0.1:8000
The views expressed in this GitHub repository are those of the authors and do not necessarily represent the views or policies of the U.S. Environmental Protection Agency (EPA). Any mention of trade names, products, or services does not imply an endorsement by the U.S. Government or the EPA. The EPA does not endorse any commercial products, services, or enterprises.