Skip to main content

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), restarting the download if the connection breaks while the file is being received. 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",
)

If the ATOMISTIC_COOKBOOK_CACHE environment variable points to a directory, downloads go through a cache in that directory, keyed by URL: a file that is already in the cache (e.g. because another recipe downloaded it) is copied from there instead of being downloaded again. The cookbook CI uses this to share data files across recipes. If the variable is not set, files are downloaded directly to their destination. Any problem with the cache directory also falls back to a direct download, and overwrite=True always bypasses the cache.

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.

Metadata

Release files for atomistic-cookbook-utils 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atomistic-cookbook-utils 0.1.1
File Size Uploaded Provenance Actions
atomistic_cookbook_utils-0.1.1.tar.gz 7.8 kB With provenance Details for atomistic_cookbook_utils-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atomistic-cookbook-utils 0.1.1
File Interpreter ABI Platform Actions
atomistic_cookbook_utils-0.1.1-py3-none-any.whl Python 3 none any Details for atomistic_cookbook_utils-0.1.1-py3-none-any.whl

Total release size: 14.5 kB

Release files / atomistic_cookbook_utils-0.1.1.tar.gz

Download URL atomistic_cookbook_utils-0.1.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ab80097166cb9dd72cbf5f30ca3427b12440f11ea18ae87c311d14e4a5f64763
BLAKE2b-256 checksum
How to use checksums
e478d0abcfebb752a1a59f6c39adf26cdc95287430f5ac85338a7f4ec853c979
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 12, 2026.

Transparency log

Release files / atomistic_cookbook_utils-0.1.1-py3-none-any.whl

Download URL atomistic_cookbook_utils-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0980c6265766c4915e72a659942b4ee353b15e7beaafbb93e033c4b939f8e400
BLAKE2b-256 checksum
How to use checksums
7c48213b23c68d2e6fbb426c7a8580e117eae8c4e68b3aa0810f3fdff9dbc294
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 12, 2026.

Transparency log

Security for atomistic-cookbook-utils 0.1.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.

Select from 2 files

Attestation for atomistic_cookbook_utils-0.1.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 12, 2026.

Transparency log

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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page