Skip to main content

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

Project description

pyFIA

The Python API for forest inventory data

PyPI PyPI Downloads Documentation License: MIT Python 3.11+


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")
site_index() Site productivity index site_index(db, grp_by="COUNTYCD")
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 documentation: mihiarc.github.io/pyfia

Citation

@software{pyfia2025,
  title = {pyFIA: A Python Library for Forest Inventory Applications},
  author = {Mihiar, Christopher},
  year = {2025},
  url = {https://github.com/mihiarc/pyfia}
}

Affiliation

Developed in collaboration with USDA Forest Service Research & Development. pyFIA provides programmatic access to Forest Inventory and Analysis (FIA) data but is not part of the official FIA Program.


Built by Chris Mihiar

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.2.3.tar.gz (201.9 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.2.3-py3-none-any.whl (242.7 kB view details)

Uploaded Python 3

File details

Details for the file pyfia-1.2.3.tar.gz.

File metadata

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

File hashes

Hashes for pyfia-1.2.3.tar.gz
Algorithm Hash digest
SHA256 58dd1ac962bfa8ab618f36809ee0e3025cf8efc986c845537c7091c019c9acfb
MD5 390fc189b8848f84ffa90adf7b43bb53
BLAKE2b-256 47724bb203758f098f675a84035c2f933229ea4f1f33180b576bf27481f7ea8b

See more details on using hashes here.

File details

Details for the file pyfia-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: pyfia-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 242.7 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.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f2d3e6803a9c4e3e3044a8a339f0462f31991ee92b272ba0307716550ad31bd1
MD5 15d029283c2f0907bea08b13d90e3b04
BLAKE2b-256 55d9ddf7367ca9f1b746fe1c5909b465f63a4a97106c508b2887ef51c52d224c

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