-
Notifications
You must be signed in to change notification settings - Fork 20
Install & Run
- Python 3.9 or greater, 64-bit version - https://www.python.org/downloads/
- The latest version of pip. Included as a default option with Python installation.
From command line, run:
pip install git+https://github.com/USEPA/flowsa#egg=flowsa
Or to install a specific version, run
pip install git+https://github.com/USEPA/[email protected]#egg=flowsa
where 'vX.X.X' is the version you wish to use under Releases.
You can test the installation by opening a Python console and entering
import flowsa
If no error is returned, the libraries are installed.
Example code is found in the examples folder.
FlowByActivity.py and FlowBySector.py generate parquet files. In python, use pandas to read the parquet file and save in another format.
Example to save as a csv:
import pandas
# load the parquet
df = pd.read_parquet(file_name)
# maintain leading 0s in location col
df.Location = df.Location.apply('="{}"'.format)
# save output to csv with a user defined output_path
df.to_csv(output_path + '_' + file_name + ".csv", index=False)
See this stackoverflow post for a discussion on GUI tools for viewing parquets.
flowsa is developed and maintained by Office of Research & Development (ORD), Center for Environmental Solutions & Emergency Response (CESER), Land Remediation & Technology Division (LRTD), Environmental Decision Analytics Branch (EDAB), U.S. Environmental Protection Agency, Cincinnati, OH 45268. See OMB Memorandum M-16-21 Section 4 & Releasing Open Source Code.
Objectives
Projects Using FLOWSA Output
Install & Run
Example Code
Reading Parquet Files
Using FLOWSA
Loading External FBS Method YAMLs
API Keys
Troubleshooting
Contributing
Creating a Flow-By-Activity Dataset
Creating a Flow-By-Activity Crosswalk
Creating a Flow-By-Sector Dataset
FBA and FBS Naming Convention
NAICS Crosswalk
Available Data
Flow Classes
Flow-By-Activity Datasets
Flow-By-Sector Datasets
Data Storage
EPA's Tools for Industrial Ecology
Suggested Citations for FLOWSA and FBS Data
Publications and Presentations
Acknowledgements