Skip to content

Using FLOWSA

Catherine Birney edited this page Jan 22, 2026 · 16 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 (non-exhaustive list):

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

To create an API key for:

  1. BLS is found here
  2. Census is found here
  3. EIA is found here
  4. USDA_Quickstats is found 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

Clone this wiki locally