fvs2py
A Python wrapper of the Forest Vegetation Simulator (FVS).
This project has been designed to provide programmatic access to FVS through the FVS-API from Python. It is inspired by and generally follows the pattern demonstrated by rFVS, which loads a pre-compiled shared library of a single FVS variant and provides the user access to FVS variables and commands from a modern programming language.
Our initial focus is to replicate the functionality provided by rFVS.
We will then build upon the addition of new subroutines in Fortran that extend the underlying FVS-API and to produce corresponding wrapper functions here in fvs2py that will allow users access to get and set a broader suite of FVS parameters. The ultimate goal for this Python API is to allow users to run FVS, get and set simulation parameters at runtime, and to retrieve FVS output tables at runtime and in-memory without needing to interact with an external database or other output files.
Installation
pip install fvs2py
fvs2py doesn't include the FVS libraries. You supply a compiled FVS variant library, either your own build or one from the usfs-fvs container image (ghcr.io/vibrant-planet-open-science/usfs-fvs), which has every variant's library at /usr/local/lib/FVS<variant>.so.
Usage
from fvs2py import FVS
fvs = FVS("/path/to/FVSpn.so")
fvs.load_keyfile("name.key")
fvs.run()
fvs.summary # pandas DataFrame
Command line
fvs2py also installs an fvs command that works like FVS executables do. These two commands are equivalent:
FVSpn --keywordfile=name.key
fvs --lib=/path/to/FVSpn.so --keywordfile=name.key
Most users of fvs2py should primarily expect to use the Python interface. The CLI is for running FVS in a separate process, so a crash by FVS doesn't take down your program and its output can be captured.
Development
A dev container is provided under .devcontainer/ for VS Code. Open the repository with Dev Containers: Reopen in Container to get the dev Docker target, Python tooling, and extensions preconfigured. On first open, postCreateCommand runs uv sync --frozen --extra dev (creating a project-local .venv in your clone, gitignored) and installs pre-commit hooks. After pulling changes that touch the Dockerfile or lockfile, rebuild the dev container (or run uv sync --extra dev manually).
The .venv directory lives on your host via the bind-mounted workspace (Linux binaries from the container). You can delete it and re-run uv sync --extra dev to recreate.
If you don't want to use a dev container, install dev dependencies and hooks the same way before opening a pull request:
uv sync --extra dev
uv run pre-commit install
Run tests locally or inside the dev container:
uv run pytest .
Hooks run on each commit (secret scan, Ruff, mypy). Run them manually with uv run pre-commit run --all-files. CI runs the same checks on pull requests via the Lint workflow, and runs pytest in the dev Docker image via the Pytest workflow.
Metadata
Release files for fvs2py 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fvs2py-0.2.1.tar.gz | 35.4 kB | With provenance | Details for fvs2py-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fvs2py-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for fvs2py-0.2.1-py3-none-any.whl |
Total release size: 76.6 kB
Release files / fvs2py-0.2.1.tar.gz
| Download URL | fvs2py-0.2.1.tar.gz |
|---|---|
| Size | 35.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bf125429277edfaec973dbaf4acd615b8ebfbd2db2b81c11cbef95804481176
|
|
BLAKE2b-256 checksum How to use checksums |
3cefd54e5638b36ade3bf98e4dbf14cf747e8d60a7530b39b0f690f643d710df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / fvs2py-0.2.1-py3-none-any.whl
| Download URL | fvs2py-0.2.1-py3-none-any.whl |
|---|---|
| Size | 41.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d7477057a0bb573d4c41fca4c72125e3f98664866e191e8ff47d633a2c0617f
|
|
BLAKE2b-256 checksum How to use checksums |
50532fa351fd8b791842e5cc6a5fdbd601ec7c213c5c6d2d3436a0508b64ba9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for fvs2py 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fvs2py-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.