Skip to main content

Roll your own typed wrapper

Project description

Templated from python-copier

dough

Roll your own typed wrapper.

[!WARNING] dough is still pre-1.0. The API is still evolving and can break in minor releases.

dough is a small framework for building typed Python wrappers around the output files of simulation codes. It ships the generic machinery — file parsers, declarative output mappings, optional library converters — and stays out of the way of the code-specific details. Code-specific wrappers live in their own packages (see Packages built on dough below).

🌯 The current layers

  • Parsers — turn one output file into a plain dict. One parser per file format; stateless, with a single parse(content) method.
  • Output mappings — frozen dataclasses whose fields are Annotated[T, Spec(...)]. Each field declares the output's name, type, unit (in its docstring), and how to extract it from the parsed dicts via a glom Spec. One source of truth per quantity.
  • Converters — optional adapters that turn base Python outputs into ase, pymatgen, or aiida-core objects. Heavy third-party imports stay lazy so wrapper packages don't pay for them at import time.

See the outputs design page for the full picture.

🧪 Testing

dough.testing ships shared pytest fixtures (json_serializer, robust_data_regression_check) used by downstream wrapper packages for regression tests. It's an opt-in plugin — activate it in your top-level conftest.py with pytest_plugins = ["dough.testing.plugin"]. See the testing design page.

🚀 Bootstrapping a wrapper

First create a git-tracked package directory:

mkdir my-package
cd my-package
git init

Or clone a fresh repo from e.g. GitHub. Then copy the template:

copier copy --trust https://github.com/mbercx/dough .

This renders the typed-output scaffolding, then chains an opinionated non-interactive python-copier run for the Python project skeleton.

📦 Packages built on dough

Package Code Status
qe-tools Quantum ESPRESSO alpha — pw.x, dos.x outputs
strudel VASP alpha — basic outputs + magnetization

📚 Docs

Full documentation at mbercx.github.io/dough.

🤝 Contributing

It's still early days, and too soon to accept external contributions. Feedback is most welcome though, feel free to open issue!

Project details


Download files

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

Source Distribution

dough-0.5.0.tar.gz (49.7 kB view details)

Uploaded Source

Built Distribution

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

dough-0.5.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file dough-0.5.0.tar.gz.

File metadata

  • Download URL: dough-0.5.0.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dough-0.5.0.tar.gz
Algorithm Hash digest
SHA256 bf3d10662d766b530ec3f9f32b9ea224c09d3ee71ba783aea03e628824c0a624
MD5 a377f5b5b21651786fc101861652b69f
BLAKE2b-256 654205d420ffc8a15a922d0c3d1a2f19161cec444597da27c666ee3ab1e2d801

See more details on using hashes here.

Provenance

The following attestation bundles were made for dough-0.5.0.tar.gz:

Publisher: cd.yaml on mbercx/dough

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

File details

Details for the file dough-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: dough-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dough-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9220db0c6b95fefdb030a818947053e0e5f638cf59d6536561107c1ba63859b6
MD5 f29055dabdb692c32c1cc2e46fb1da02
BLAKE2b-256 8c910e5dbd8d9e602fe98148da5705b5f98e55ae58741640b219f20381eb3cda

See more details on using hashes here.

Provenance

The following attestation bundles were made for dough-0.5.0-py3-none-any.whl:

Publisher: cd.yaml on mbercx/dough

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