Skip to main content

SciNumTools3 for Python

PyPI version Python License: MIT

SciNumTools3 provides unit-aware quantities and validated scientific configuration for Python. Use it to convert physical units, perform dimension-aware calculations, and load typed parameters whose units and constraints are checked at runtime.

The package includes:

  • scinumtools3.puq for quantities, uncertainties, unit systems, and conversions
  • scinumtools3.dip for typed, validated configuration files and DIPH5 archives
  • scinumtools3.api for formatted, command-style evaluation
  • NumPy interoperability for array values

Evaluated DIP environments can generate reports in TeX, PDF, Markdown, reStructuredText, HTML, Typst, plain text, or Brief++ document JSON with Environment.generate_report(ReportFormat.HTML, "report.html") (or another ReportFormat). See the Python guide.

Installation

SciNumTools3 requires Python 3.9 or later and depends on NumPy.

pip install scinumtools3

Quick start

from scinumtools3.puq import Quantity

distance = Quantity(1.5, "km")
time = Quantity("2*min")

speed = (distance / time).convert("m*s-1")
print(speed)  # 12.5*m*s-1

Incompatible dimensions are rejected instead of being combined silently.

Quantities and units

Quantity accepts strings, Python numbers and sequences, and NumPy arrays. It supports unit-aware arithmetic, comparisons, uncertainties, and conversion between compatible units and unit systems.

Quantity-aware NumPy operations include np.add, np.sqrt, and np.sum over all elements. Quantity ** exponent and scinumtools3.puq.sqrt(quantity) also preserve units. The sum keeps the quantity's units and adds absolute uncertainties linearly. Use .to_numpy() or .value(numpy=True) when you explicitly want a plain NumPy array without units.

PUEL (Physical Units Expression Language) expressions may contain scalar or array values, uncertainties, dimensions, constants, and units. For example:

from scinumtools3.puq import Quantity

lengths = Quantity("[2,3,4]*km")
measurement = Quantity("1.346591(30)e27*kg")

For conversions between unit systems, pass the target system and, when the dimensions are ambiguous between systems, the physical-quantity context:

from scinumtools3.puq import Quantity
from scinumtools3.puq.systems import ESU

current = Quantity("23*A").convert("statA", ESU, "I")

Input parameters

DIP parses DIPL (Dimensional Input Parameter Language) definitions from strings or files. DIPL provides typed parameters, units, constraints, dependencies, groups, lists, maps, and references.

Given parameters.dip:

simulation
  timestep float = 0.5 fs
    !condition ({.} > 0 fs)
  steps int = 1000000
    !condition ({.} > 1)
  duration float = ( {?simulation.timestep} * {?simulation.steps} ) fs

Load it into an environment:

from scinumtools3.dip import DIP

env = DIP.load("parameters.dip")

DIP.load also accepts .dipl files, a DIPfile project manifest, and .diph5 archives. Use a DIP parser when combining inputs or adding definitions, units, schemas, and overrides before evaluation:

dip = DIP()
dip.add_string("length float = 2.5 dm")
dip.add_string("count int = 42")
env = dip.parse()

Accessing nodes

There are two main ways to access nodes in an environment:

  • Cursor: use env["path"] to inspect a known path or traverse groups and collections.
  • Select: use env.select(...) to discover value nodes by path and tags and inspect snapshots of the results.

Cursor: inspect a known path

cursor = env["length"]
print(cursor.value, cursor.units, cursor.metadata.description)

A cursor accesses a path in the environment. Use cursor.entries() to traverse direct group children, list elements, or map items in order, and cursor.entry_names() when you need only their names or indices as strings. children(), elements(), and items() remain available for specific container types. Cursor values are ordinary Python values: bool, int, float, str, or nested lists. Use cursor.to_numpy() to obtain a NumPy array. A cursor also exposes its units, shape, and child traversal methods. To convert a unit-bearing DIPL result, construct a quantity from its value and the string representation of its units:

from scinumtools3.puq import Quantity

length = env["length"]
length_cm = Quantity(length.value, length.units.to_string()).convert("cm")
print(length_cm)  # 25*cm

Select: discover and inspect nodes

Use select() to discover values and inspect their tags and metadata directly:

dip = DIP()
dip.add_string('''physics
  speed float = 2 m/s
    !tags ["export", "runtime", "hydro"]
    ?descr "Flow speed"
''')
env = dip.parse()
for node in env.select(
    "?physics.",
    tags_all=["export", "runtime"],
    tags_any=["hydro", "gravity"],
    tags_none=["internal", "deprecated"],
):
    print(node.name, node.value, node.tags, node.metadata.description)

The three filters combine with AND; omitted or empty filters impose no restriction. Only explicitly assigned tags match: children do not inherit their parent's tags. ? selects the whole environment, ?physics. selects a subtree including its value-bearing root and collection members, and ?physics.speed selects an exact node. Results retain fully qualified paths in environment order, with each node returned once. No matches returns an empty list.

Selected nodes are independent snapshots; selection does not modify the environment. Tags are returned as a separate Python list, and metadata remains valid while its Python wrapper is alive.

Additional request helpers remain available in the Python API reference.

Command-style API helpers

The scinumtools3.api.puq and scinumtools3.api.dip modules expose the same application-oriented operations as the snt command-line interface:

from scinumtools3.api.puq import PUQEval

command = PUQEval("1*cm + 2*dm")
print(command.execute())  # 21*cm

Use Quantity and DIP when you need typed Python objects; use the API helpers when you want formatted command-style output without starting a subprocess.

Documentation

License

SciNumTools3 is distributed under the MIT License.

Metadata

Release files for scinumtools3 0.10.0

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

Source distribution (sdist)

Source distribution for scinumtools3 0.10.0
File Size Uploaded Provenance Actions
scinumtools3-0.10.0.tar.gz 36.9 MB With provenance Details for scinumtools3-0.10.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for scinumtools3 0.10.0
File Actions
scinumtools3-0.10.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for scinumtools3-0.10.0-cp313-cp313-win_amd64.whl
scinumtools3-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl
scinumtools3-0.10.0-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details for scinumtools3-0.10.0-cp313-cp313-macosx_15_0_arm64.whl
scinumtools3-0.10.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for scinumtools3-0.10.0-cp312-cp312-win_amd64.whl
scinumtools3-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl
scinumtools3-0.10.0-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details for scinumtools3-0.10.0-cp312-cp312-macosx_15_0_arm64.whl
scinumtools3-0.10.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for scinumtools3-0.10.0-cp311-cp311-win_amd64.whl
scinumtools3-0.10.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.10.0-cp311-cp311-manylinux_2_28_x86_64.whl
scinumtools3-0.10.0-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details for scinumtools3-0.10.0-cp311-cp311-macosx_15_0_arm64.whl
scinumtools3-0.10.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for scinumtools3-0.10.0-cp310-cp310-win_amd64.whl
scinumtools3-0.10.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.10.0-cp310-cp310-manylinux_2_28_x86_64.whl
scinumtools3-0.10.0-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details for scinumtools3-0.10.0-cp310-cp310-macosx_15_0_arm64.whl

Total release size: 412.9 MB

Release files / scinumtools3-0.10.0.tar.gz

Download URL scinumtools3-0.10.0.tar.gz
Size 36.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b3bb4b44c199162b2c651d22695530f4c6147f9385317b99cb534ce2cd9b29d6
BLAKE2b-256 checksum
How to use checksums
424c98eca0d84f8bef20f4668b2eeafdc20fd398f25e244a45c3a1c1ef0ad315
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp313-cp313-win_amd64.whl

Download URL scinumtools3-0.10.0-cp313-cp313-win_amd64.whl
Size 54.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
1b531711dacca4f8f86ce96221ecc71e9142189b9ec9867bf9dd520c6691a02b
BLAKE2b-256 checksum
How to use checksums
98e47126e3f89f00ab4871497099c3222a3305575e6d30b1faf533f562e6b444
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d062854fd2dec2f554ad2c2b2d605261631deca1e86e3b72377a7b7c4df36544
BLAKE2b-256 checksum
How to use checksums
532c8d08578dcf23236f23e83ba9f52bea1ad405172e35495862834052c34530
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp313-cp313-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.0-cp313-cp313-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
d29beb50c62a4b9009652d14b4815f46fe4b321c1eb9725ff7a532934015e75f
BLAKE2b-256 checksum
How to use checksums
d89eb0e3e7950361003b90b2fc96f4b005d559cca932e2bc2fa7083edaa0b54a
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp312-cp312-win_amd64.whl

Download URL scinumtools3-0.10.0-cp312-cp312-win_amd64.whl
Size 54.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ec16474d1ef72b9d1c5b300f67ebce7cdd830c4c976b90c6736672915e2890db
BLAKE2b-256 checksum
How to use checksums
881504ba26273aa5c19639f2b72dd730a89aaf15485f9f3bec49f31e39667432
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
beda3a21a48a461f3432abcad75175ebd8102acfb796adbb6711ad39614a334d
BLAKE2b-256 checksum
How to use checksums
0e310d6f3942c3c52abb0fc5b2b8485c62cf545f76e6a1f1cbe3626dcd028a11
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp312-cp312-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.0-cp312-cp312-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
1956a8591cf76c1803d0cda000ee5ddea019357298e15868c00c516d743ba23b
BLAKE2b-256 checksum
How to use checksums
d051cce59fbb97f704c9610227c1d6104fb9133bfb9e6ceb3507008af51f2cb5
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp311-cp311-win_amd64.whl

Download URL scinumtools3-0.10.0-cp311-cp311-win_amd64.whl
Size 54.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5a3ca5e052302b9002f91052b2fb8d489205e8d04a26cdb633a5dd99e2377013
BLAKE2b-256 checksum
How to use checksums
9d27d933ac8882585e03cecc3f3bbc122819849822aa43852f4f1a294373f441
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.10.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
36910f562520ba72142f9e689e9162566f13d44b6a0f416e72b3288471f10785
BLAKE2b-256 checksum
How to use checksums
a9c97641e2f8d1cf8762c9432e3a22b11101b6e63fecca9748acdc2f14a94414
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp311-cp311-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.0-cp311-cp311-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
bbbb701c74dda614a7e193cc05e78f1341ca40c7284be8a1f0172f59db3191df
BLAKE2b-256 checksum
How to use checksums
481fa7ab5e8034974dafe6ab2c0ebd2bdb487d2be17c618629f37adf7f0b2e3a
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp310-cp310-win_amd64.whl

Download URL scinumtools3-0.10.0-cp310-cp310-win_amd64.whl
Size 54.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
e699f75c3db5e86e7bdc2d9bd60e9234bfe5a823e5fcca912f285f1289f2d513
BLAKE2b-256 checksum
How to use checksums
ab1d3e0ce66d15cd376409513da10f760f0883ba77a6e3530b1f7afdbe01e6c0
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.10.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3af65db1895d2b693cf236de6e5e0655d48420531b656ded347cee14ce5318bd
BLAKE2b-256 checksum
How to use checksums
f3557b73b81ad22ea35db25fc603d81ebd44438a5632001324cd755ab3858bfd
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 4, 2026.

Transparency log

Release files / scinumtools3-0.10.0-cp310-cp310-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.0-cp310-cp310-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
b83f496d6ae785c23d34861c538c4622351048f96dca75bd3ca566a77584d1ec
BLAKE2b-256 checksum
How to use checksums
6650cf687c24adaada89aa12126a85511b300afb293814040d163ac662dbeab3
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 4, 2026.

Transparency log

Security for scinumtools3 0.10.0

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

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for scinumtools3-0.10.0.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 4, 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.

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