Skip to main content

High-performance Python library for Forest Inventory Analysis (FIA) data analysis

Project description

pyFIA

The Python API for forest inventory data

FIAtools Ecosystem PyPI PyPI Downloads Documentation License: MIT Python 3.11+

Part of the FIAtools Python Ecosystem
pyFIA · gridFIA · pyFVS · askFIA


A high-performance Python library for analyzing USDA Forest Inventory and Analysis (FIA) data. Built on DuckDB and Polars for speed, with statistical methods that match EVALIDator exactly.

Why pyFIA?

Feature pyFIA EVALIDator
Speed 10-100x faster Baseline
Interface Python API Web UI
Reproducibility Code-based Manual
Custom analysis Unlimited Limited options
Statistical validity ✓ Exact match ✓ Reference

Quick Start

pip install pyfia
from pyfia import FIA, biomass, tpa, volume, area

with FIA("path/to/FIA_database.duckdb") as db:
    db.clip_by_state(37)  # North Carolina
    db.clip_most_recent(eval_type="EXPVOL")

    # Core estimates
    trees = tpa(db, tree_domain="STATUSCD == 1")
    carbon = biomass(db, by_species=True)
    timber = volume(db, land_type="timber")
    forest = area(db, land_type="forest")

Core Functions

Function Description Example
tpa() Trees per acre tpa(db, tree_domain="DIA >= 5.0")
biomass() Above/belowground biomass biomass(db, by_species=True)
volume() Merchantable volume (ft³) volume(db, land_type="timber")
area() Forest land area area(db, grp_by="FORTYPCD")
mortality() Annual mortality rates mortality(db)
growth() Net growth estimation growth(db)

Statistical Methods

pyFIA implements design-based estimation following Bechtold & Patterson (2005):

  • Post-stratified estimation with proper variance calculation
  • Ratio-of-means estimators for per-acre values
  • EVALID-based filtering for statistically valid estimates
  • Temporal methods: TI, annual, SMA, LMA, EMA

Installation Options

# Basic
pip install pyfia

# With spatial support
pip install pyfia[spatial]

# Development
git clone https://github.com/mihiarc/pyfia.git
cd pyfia && pip install -e .[dev]

Documentation

📖 Full docs: mihiarc.github.io/pyfia

Integration with FIAtools

pyFIA works seamlessly with other tools in the ecosystem:

# Use pyFIA data with gridFIA for spatial analysis
from pyfia import FIA
from gridfia import GridFIA

with FIA("database.duckdb") as db:
    species_list = db.get_species_codes()

api = GridFIA()
api.download_species(state="NC", species_codes=species_list)

The FIAtools Ecosystem

PyFIA is part of the FIAtools Python ecosystem - a unified suite of open-source tools for forest inventory analysis:

Tool Purpose Key Features
pyFIA Survey & plot data DuckDB backend, 10-100x faster than EVALIDator
gridFIA Spatial raster analysis 327 species at 30m resolution, Zarr storage
pyFVS Growth simulation Chapman-Richards curves, yield projections
askFIA AI interface Natural language queries for forest data

Explore the full ecosystem at fiatools.org

Citation

@software{pyfia2025,
  title = {pyFIA: A Python Library for Forest Inventory Analysis},
  author = {Mihiar, Christopher},
  year = {2025},
  url = {https://fiatools.org}
}

fiatools.org · Python Ecosystem for Forest Inventory Analysis
Built by Chris Mihiar · USDA Forest Service Southern Research Station

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfia-1.1.0b7.tar.gz (153.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfia-1.1.0b7-py3-none-any.whl (191.3 kB view details)

Uploaded Python 3

File details

Details for the file pyfia-1.1.0b7.tar.gz.

File metadata

  • Download URL: pyfia-1.1.0b7.tar.gz
  • Upload date:
  • Size: 153.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pyfia-1.1.0b7.tar.gz
Algorithm Hash digest
SHA256 c395496af22d486ce2b5e250896905a2bcc4b01fe322151184c1a69ae55cbde9
MD5 a6d977903087173ffffbe33ddb9ea3c8
BLAKE2b-256 8b079447f08034e19411318b6bd95b24536f19bf888a786f9f4fe902ec4571b0

See more details on using hashes here.

File details

Details for the file pyfia-1.1.0b7-py3-none-any.whl.

File metadata

  • Download URL: pyfia-1.1.0b7-py3-none-any.whl
  • Upload date:
  • Size: 191.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pyfia-1.1.0b7-py3-none-any.whl
Algorithm Hash digest
SHA256 0f63f4019087b4d6eb9faeeeeb577b9de1a6782673ef637fc6f64d7a6c8b54ec
MD5 868ca08df28b6b3d12c613817be6d205
BLAKE2b-256 ee17844820d33cb960a8fc9bebf750771335480a559a1e823e442314a6baf112

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page