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.6.0.tar.gz (58.3 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.6.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dough-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6e73b5979b3441d6353b8ecca5fe1d0fe7da4c3bf621a10737d2677d13de8cef
MD5 1e028078f0b3e80948804ff1ecd30b26
BLAKE2b-256 0651250fd48372a5eb2c5aee1e8ba42d64bda8eb7b7e06675ad7071c3cbf7456

See more details on using hashes here.

Provenance

The following attestation bundles were made for dough-0.6.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.6.0-py3-none-any.whl.

File metadata

  • Download URL: dough-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 22.9 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 289568e93db39973ec2d2f185b1295de304ee8929084d1d5467982630a3b9808
MD5 d488650324fd227a6b86d23f245012a8
BLAKE2b-256 c90895bd60599fda808510cc50c4d9724b0a722e032187c50a59b8547a52d330

See more details on using hashes here.

Provenance

The following attestation bundles were made for dough-0.6.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