Utilities to work with configurations for the ACCESS climate models.
Project description
access-config-utils
About
A Python package providing various utilities to work with configurations for the models developed at ACCESS-NRI.
Key Features
Parsers:
- Various parsers for configuration files used across ACCESS-NRI models
- Support for round-trip parsing, preserving comments and formatting
- Simple API
Documentation
Coming soon.
Installation
Using pip
You can install the latest release directly from PyPI:
pip install access-config-utils
From source
If you prefer to install from source:
git clone https://github.com/ACCESS-NRI/access-config-utils.git
cd access-config-utils
pip install .
Usage
Configuration files parsers
Here is a simple example of how to parse a text and modify its contents.
To parse some text, one just needs to call the parse function of the appropriate parser:
from access.config import FortranNMLParser
text = '''&data_nml
parameterA = 1
parameterB = 'abc'
/'''
config = FortranNMLParser().parse(text)
print(config)
&data_nml
parameterA = 1
parameterB = 'abc'
/
The parsed content can then be modified just like any Python dict:
config["data_nml"]["parameterA"] = 2
print(config)
&data_nml
parameterA = 2
parameterB = 'abc'
/
Development installation
If you intend to contribute or modify the package, it is recommended to work inside a virtual environment.
- Create and activate a virtual environment
# Create a virtual environment
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activate
- Install in editable mode with development and test dependencies
pip install -e ".[devel,test]"
This will install the package in editable mode, meaning changes to the source code are reflected immediately without reinstallation. Development dependencies such as testing tools will also be installed.
- Run the test suite
pytest
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you’d like to add features, fix bugs, or improve documentation.
For significant contributions, we recommend discussing proposed changes in an issue before opening a pull request.
License
This project is licensed under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file access_config_utils-0.1.tar.gz.
File metadata
- Download URL: access_config_utils-0.1.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ff5588b35e7e5e6b28b8b13665b32f1b640864ec64435f6cfab67f5c0ca1c8c
|
|
| MD5 |
6fad74ff2359c7eb8c60f4dda85b3415
|
|
| BLAKE2b-256 |
ae6d28d7c6fa6806f27e04184ddfd7a656e848bcb674b30fb267efe0891b2378
|
Provenance
The following attestation bundles were made for access_config_utils-0.1.tar.gz:
Publisher:
cd.yml on ACCESS-NRI/access-config-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
access_config_utils-0.1.tar.gz -
Subject digest:
7ff5588b35e7e5e6b28b8b13665b32f1b640864ec64435f6cfab67f5c0ca1c8c - Sigstore transparency entry: 611545551
- Sigstore integration time:
-
Permalink:
ACCESS-NRI/access-config-utils@178a4083392bc475224d4c135a6f3ebcdb55c793 -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/ACCESS-NRI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@178a4083392bc475224d4c135a6f3ebcdb55c793 -
Trigger Event:
push
-
Statement type:
File details
Details for the file access_config_utils-0.1-py3-none-any.whl.
File metadata
- Download URL: access_config_utils-0.1-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4787e7a34131256658009fe5db856caecd3adb66247952b639d4c16e2ab7f07
|
|
| MD5 |
eaf88cdd5fb5b3526765cee5558b29b6
|
|
| BLAKE2b-256 |
2b14324c04d682a0c99183c0520235b40bae64f57e5c7f62584cec761d2cdfa0
|
Provenance
The following attestation bundles were made for access_config_utils-0.1-py3-none-any.whl:
Publisher:
cd.yml on ACCESS-NRI/access-config-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
access_config_utils-0.1-py3-none-any.whl -
Subject digest:
f4787e7a34131256658009fe5db856caecd3adb66247952b639d4c16e2ab7f07 - Sigstore transparency entry: 611545609
- Sigstore integration time:
-
Permalink:
ACCESS-NRI/access-config-utils@178a4083392bc475224d4c135a6f3ebcdb55c793 -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/ACCESS-NRI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@178a4083392bc475224d4c135a6f3ebcdb55c793 -
Trigger Event:
push
-
Statement type: