Skip to content

Using FLOWSA

Wesley Ingwersen edited this page Nov 9, 2023 · 13 revisions

Description of FLOWSA Outputs

Datasets from flowsa are saved as parquets in one of two formats, either as a Flow-By-Activity or a Flow-By-Sector. Follow the respective links for a list of available datasets.

Terms

flows: represent the physical movement of material, energy, entities or money as input or output to or between activities. The terms flows comes from life cycle assessment (ISO 14044).

sectors: generally these are economic sectors generating economic activity, but are extended here to include households and institutional end users. Using the BEA definitions in input-output tables, these can be either industries or commodities.

attribution: The sectors through which activity uses, produces or receives the flows (input or output).

Loading external Flow-By-Sector method YAMLs

Flow-By-Sector method YAMLs and activity sets can be stored and run outside the FLOWSA repository. The files require a specific directory structure, where method YAMLs are stored in a "flowbysectormethods" folder and activity sets are stored in "flowbysectoractivitysets" folder within the same parent folder. See the HIO GitHub repository for an example of how to structure externally saved FBS methods.

API Keys

To create some Flow-By-Activity datasets, a user must register and create a personalized API key. The API key must be saved within a manually created '.env' file labeled 'API_Keys.env' and stored in FLOWSA'S modulepath(flowsa.settings.MODULEPATH). See the examples folder for the setup of the ".env" file. All ".env" files are added to "gitignore" and should never be uploaded to GitHub.

Flow-By-Activity datasets that require an API key:

  1. Census_CBP
  2. Census_PEP_Population
  3. USDA_ACUP_Fertilizer
  4. USDA_ACUP_Pesticide
  5. USDA_CoA_Cropland
  6. USDA_CoA_Cropland_NAICS
  7. USDA_CoA_Livestock
  8. USDA_IWMS

To create an API key for:

  1. Census go here
  2. USDA_Quickstats go here
  3. EIA go here

Output Files

  1. Flow-By-Activity parquets
  2. Flow-By-Sector parquets
  3. Metadata JSON
  4. General Log
  5. Validation Log

Troubleshooting

If you encounter the error "pkgresoures.DistributionNotFound: The 'flowsa' distribution was not found and is required by the application":

  1. In the command line, change directory to parent directory for github projects
  2. Run: pip install -e flowsa

If you are coding as a developer and get errors importing functions from fedelemflowlist, esupy, or StEWI, install editable packages

  1. In the command line, change directory to parent directory for github projects
  2. Run: pip install -e Federal-LCA-Commons-Elementary-Flow-List
  3. Run: pip install -e esupy
  4. Run: pip install -e standardizedinventories