Shared utilities for recipes in the Atomistic Cookbook.
Project description
atomistic-cookbook-utils
Small shared utilities used by the recipes in the Atomistic Cookbook.
The goal is to keep recipe code focused on the science: any boilerplate that would otherwise be copy-pasted across many recipes lives here.
Installation
pip install atomistic-cookbook-utils
For a recipe's environment.yml, add it under pip: with a semantic
version range, e.g.
- atomistic-cookbook-utils >=0.1,<0.2
Contents
download_with_retry
Download a file with automatic retries on transient HTTP errors (429, 500, 502, 503, 504). Skips the download if the file already exists, creates parent directories as needed.
from atomistic_cookbook_utils import download_with_retry
download_with_retry(
"https://zenodo.org/records/10566825/files/gaas_training.xyz",
"data/gaas_training.xyz",
)
run_command
Run a shell-like command string without invoking a shell. The string is
split with shlex.split, so quoting works as expected; pipes, redirection
and globs do not — for those, use subprocess directly.
By default the child inherits the parent's stdout and stderr. Pass
print_output=True to capture the command's combined output and
re-emit it via print() — this makes the output visible in
sphinx-gallery rendered cells (which capture sys.stdout but not raw
file-descriptor writes from child processes).
from atomistic_cookbook_utils import run_command
run_command("mtt train options.yaml")
run_command("ls -la", cwd="data", print_output=True)
Source
This package is developed inside the cookbook repository at
src/atomistic-cookbook-utils/. See CONTRIBUTING.rst at the repo
root for development workflow.
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 atomistic_cookbook_utils-0.1.0.tar.gz.
File metadata
- Download URL: atomistic_cookbook_utils-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65d6aa94d75cfeefd395e2c78e46ad9384268d0386f26ff17e191e81015d1036
|
|
| MD5 |
07cfa7559a5dab61176a7148efc14c77
|
|
| BLAKE2b-256 |
13523e758957345601747d498f87468505b3c6cb65464b78597815f4ac21a6af
|
Provenance
The following attestation bundles were made for atomistic_cookbook_utils-0.1.0.tar.gz:
Publisher:
publish-utils.yml on lab-cosmo/atomistic-cookbook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atomistic_cookbook_utils-0.1.0.tar.gz -
Subject digest:
65d6aa94d75cfeefd395e2c78e46ad9384268d0386f26ff17e191e81015d1036 - Sigstore transparency entry: 1552774672
- Sigstore integration time:
-
Permalink:
lab-cosmo/atomistic-cookbook@a1d3eaaa567cb22e08559a727d74aa8c74e4bc7a -
Branch / Tag:
refs/tags/utils-v0.1.0 - Owner: https://github.com/lab-cosmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-utils.yml@a1d3eaaa567cb22e08559a727d74aa8c74e4bc7a -
Trigger Event:
push
-
Statement type:
File details
Details for the file atomistic_cookbook_utils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: atomistic_cookbook_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56603cfa35f77935f3e19623a6157940603b70a2d4ac08abea0f12f11aa0c66d
|
|
| MD5 |
a1e377a821aca787a526037c20db9d68
|
|
| BLAKE2b-256 |
2e7fb707df1fd45d772815b2d4c6e600c3b0ab05381a75441a6d777c23f511ff
|
Provenance
The following attestation bundles were made for atomistic_cookbook_utils-0.1.0-py3-none-any.whl:
Publisher:
publish-utils.yml on lab-cosmo/atomistic-cookbook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atomistic_cookbook_utils-0.1.0-py3-none-any.whl -
Subject digest:
56603cfa35f77935f3e19623a6157940603b70a2d4ac08abea0f12f11aa0c66d - Sigstore transparency entry: 1552774689
- Sigstore integration time:
-
Permalink:
lab-cosmo/atomistic-cookbook@a1d3eaaa567cb22e08559a727d74aa8c74e4bc7a -
Branch / Tag:
refs/tags/utils-v0.1.0 - Owner: https://github.com/lab-cosmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-utils.yml@a1d3eaaa567cb22e08559a727d74aa8c74e4bc7a -
Trigger Event:
push
-
Statement type: