Skip to main content

Utilities to work with configurations for the ACCESS climate models.

Project description

access-config-utils

CI codecov License Code style: black

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.

  1. Create and activate a virtual environment
# Create a virtual environment
python3 -m venv .venv

# Activate the virtual environment
source .venv/bin/activate
  1. 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.

  1. 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

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

access_config_utils-0.1.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

access_config_utils-0.1-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

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

Hashes for access_config_utils-0.1.tar.gz
Algorithm Hash digest
SHA256 7ff5588b35e7e5e6b28b8b13665b32f1b640864ec64435f6cfab67f5c0ca1c8c
MD5 6fad74ff2359c7eb8c60f4dda85b3415
BLAKE2b-256 ae6d28d7c6fa6806f27e04184ddfd7a656e848bcb674b30fb267efe0891b2378

See more details on using hashes here.

Provenance

The following attestation bundles were made for access_config_utils-0.1.tar.gz:

Publisher: cd.yml on ACCESS-NRI/access-config-utils

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

File details

Details for the file access_config_utils-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for access_config_utils-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4787e7a34131256658009fe5db856caecd3adb66247952b639d4c16e2ab7f07
MD5 eaf88cdd5fb5b3526765cee5558b29b6
BLAKE2b-256 2b14324c04d682a0c99183c0520235b40bae64f57e5c7f62584cec761d2cdfa0

See more details on using hashes here.

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

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