Skip to content

MAGALA-RICHARD/apsimNGpy

Repository files navigation

License: Apache-2.0 Documentation PyPI version Total PyPI downloads Read Publication Ask Teams APSIM Next Generation version

Run APSIM simulation

Links

Documentation

Publication.

Version 1.5.5 passed unit tests under Python 3.14+

For the complete list of new features, improvements, and bug fixes, see the v1.5.3 release notes.

apsimNGpy: The Next Generation Agroe-cosystem Simulation Library

apsimNGpy is an open-source framework for advanced agroecosystem modeling, built entirely in Python. It enables object-oriented, data-driven workflows for interacting with APSIM Next Generation models, offering capabilities for:

  • Batch file simulation and model evaluation
  • APSIMX file editing and parameter inspection
  • Weather data retrieval and pre-processing
  • Optimization and performance diagnostics
  • Efficient soil profile development and validation
  • Parameter sensitivity analysis

Python serves as the execution environment, integrating scientific computing, data analysis, and automation for sustainable agricultural systems.

Requirements

  1. .NET SDK — install from https://learn.microsoft.com/en-us/dotnet/core/install/
  2. Python 3.10+
  3. APSIM Next Generation — ensure the directory containing Models.exe is added to your system PATH.
  4. (Optional) Use the official APSIM installer for easiest setup.
  5. Minimum 8 GB RAM recommended.

Installation

## Run APSIM in Python

Option 1 – Install from PyPI (stable)

pip install apsimNGpy

If using the uv virtual environment manager:

uv pip install apsimNGpy

Option 2 – Clone the development repository

git clone https://github.com/MAGALA-RICHARD/apsimNGpy.git
cd apsimNGpy
pip install .

Option 3 – Install directly from GitHub

pip install git+https://github.com/MAGALA-RICHARD/apsimNGpy.git

APSIM Next Generation (NG) Installation Tip

Use the pinned APSIM release indicated on the documentation homepage to avoid forward-compatibility issues. The pinned version represents the latest APSIM NG build verified against apsimNGpy’s API and unit tests.

About

ApsimNGpy is a Python library designed as an implementation of the APSIM Next Generation crop and environmental simulation model. This library is built upon the Pythonnet API, providing direct communication with the APSIM model. Notably, it offers a significant speed advantage, being twice as fast as pure Python.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors