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, 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="VOL")

    # Core estimates
    trees = tpa(db, tree_domain="STATUSCD == 1")
    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

# Recommended: use uv for fast, reliable installs
uv pip install pyfia

# Or with pip
pip install pyfia

# With spatial support (polygon clipping, spatial joins)
uv pip install pyfia[spatial]

Tip: Always use a virtual environment (uv venv or python -m venv .venv).

For development setup, see the Getting Started guide.

Documentation

Full documentation: pyfia.mintlify.app

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.4.2.tar.gz (216.0 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.4.2-py3-none-any.whl (256.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfia-1.4.2.tar.gz
  • Upload date:
  • Size: 216.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfia-1.4.2.tar.gz
Algorithm Hash digest
SHA256 e2c27c71839dc3e62ca45d5776c7b0afa7584fa4f33e867fb1c653f79f551c61
MD5 5ee796b7d95c1d8b103cc61fa5fad398
BLAKE2b-256 b402ead829cfdb77e735ae1e13e3b57151726c14b30ae5d8fb8c55d6b9d2e0b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfia-1.4.2.tar.gz:

Publisher: publish.yml on mihiarc/pyfia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pyfia-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 256.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfia-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9411d0bad80ceb796e77a32c9a093777f24314ff67fc6cec12b06724d18cd364
MD5 cda099d1c74fd2241ede3bbe69f77b18
BLAKE2b-256 551224a6777be479ef7fa4c75722e6dfe646d3a612c819bf86dd61bcd3dfd7fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfia-1.4.2-py3-none-any.whl:

Publisher: publish.yml on mihiarc/pyfia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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