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

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.2
File Size Uploaded Provenance Actions
scinumtools3-0.10.2.tar.gz 37.0 MB With provenance Details for scinumtools3-0.10.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for scinumtools3 0.10.2
File Actions
scinumtools3-0.10.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for scinumtools3-0.10.2-cp313-cp313-win_amd64.whl
scinumtools3-0.10.2-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.2-cp313-cp313-manylinux_2_28_x86_64.whl
scinumtools3-0.10.2-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details for scinumtools3-0.10.2-cp313-cp313-macosx_15_0_arm64.whl
scinumtools3-0.10.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for scinumtools3-0.10.2-cp312-cp312-win_amd64.whl
scinumtools3-0.10.2-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.2-cp312-cp312-manylinux_2_28_x86_64.whl
scinumtools3-0.10.2-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details for scinumtools3-0.10.2-cp312-cp312-macosx_15_0_arm64.whl
scinumtools3-0.10.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for scinumtools3-0.10.2-cp311-cp311-win_amd64.whl
scinumtools3-0.10.2-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.2-cp311-cp311-manylinux_2_28_x86_64.whl
scinumtools3-0.10.2-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details for scinumtools3-0.10.2-cp311-cp311-macosx_15_0_arm64.whl
scinumtools3-0.10.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for scinumtools3-0.10.2-cp310-cp310-win_amd64.whl
scinumtools3-0.10.2-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.2-cp310-cp310-manylinux_2_28_x86_64.whl
scinumtools3-0.10.2-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details for scinumtools3-0.10.2-cp310-cp310-macosx_15_0_arm64.whl

Total release size: 413.0 MB

Release files / scinumtools3-0.10.2.tar.gz

Download URL scinumtools3-0.10.2.tar.gz
Size 37.0 MB
Tags Source
SHA-256 checksum
How to use checksums
9c17b9a1dd6dde80859764e07adae54a8a8650483d9f4eabda992cef5a429b1e
BLAKE2b-256 checksum
How to use checksums
0b29808d7ef48f224b134cb13716c65a505f1ff5b89d96bb1e7621737a7abca4
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-cp313-cp313-win_amd64.whl
Size 54.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
a5909a20b0e0cb5c473736cca96284bf11e027e2010d4ea88ffbef19cc8c6603
BLAKE2b-256 checksum
How to use checksums
ff1a0b064c2d6bc6ce5c3e85d3af118812748eb8bbcc5577d579efc35f23dfe8
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
4cb6ef3a99a2e84b66c7ae38c2f106d80ab99db263a959f736dccc7f40e26808
BLAKE2b-256 checksum
How to use checksums
86cea90110703d3f8be0cc1e0e910453375bdbe57de74bcf7c2abfee1622d8c4
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
502a736858b03b64711aec5dc32b8caf1543667f9a7fb0176ced0c7787946c71
BLAKE2b-256 checksum
How to use checksums
6bec96f095dc3b0713b9cab70ef0d781141c133e8995fd2132f4b981e01f4464
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-cp312-cp312-win_amd64.whl
Size 54.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a5f5d2473e428117d4ae48492da09801b68b71bdd1558688f65cfa7ce3395ed0
BLAKE2b-256 checksum
How to use checksums
db7d5d08712bb22771a5d8abf6796e2a6e584be2e5210f4e89e53a97ff18fc5b
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
7b18c182b090dffe6d7cf3869d3923169f469e76984c4b8e3a14e944a4a68435
BLAKE2b-256 checksum
How to use checksums
20e905add4a4b55e8763e38e28d39ba9e70cfc1381efcec03c242efce9a8ee35
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
15c056e43d33b998ff642a5e7f217146d0e978cfed0dbab3f9e19aa588efd14b
BLAKE2b-256 checksum
How to use checksums
b40395ec2b2ee3583170ec882a59064e7c6e2913c4cf60498ce605e7717e42a3
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-cp311-cp311-win_amd64.whl
Size 54.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
0dc4a81a3f170485839dbe30daaaebd6d66d73f2c3b11c24fbb21435cdf543e0
BLAKE2b-256 checksum
How to use checksums
cda6e8902cdc3b1d6eca6a5366285f21838dd38ba20f859632a7303c53cbccca
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
6d484ccd5632c986943ce2707302e9ac079034a8dbc8cba561b5be18431279b9
BLAKE2b-256 checksum
How to use checksums
4c3276f202933faba340433d070fb42f04e4c9cdaee8a2515a903196d71bbe3f
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
ae38118918f3825abceb5e6db7c7cde5c0fdb5499f6ea55f5fcd1656fe109bb9
BLAKE2b-256 checksum
How to use checksums
fbd68be58ea7a7481afa1c5c9322e75f55cafd3d9f0ec6a2641980378ffe980a
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-cp310-cp310-win_amd64.whl
Size 54.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
29c2435952443f969e48136e7985ab167ff5e4f06a7cb61be8f0e27efe980036
BLAKE2b-256 checksum
How to use checksums
56106403f06bd688313777ef6140e5c5f86c8410b98c350d56ec873a36fd839f
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
93a4dbe4327f176606bd7b967bca378f20ac8b712f71de8c4b57ba611e8b2775
BLAKE2b-256 checksum
How to use checksums
755687f7027353e660cf29ec14373c7007bf6ac09b01e1f2da757cab903746b4
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 13, 2026.

Transparency log

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

Download URL scinumtools3-0.10.2-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
88afc61e333d79699d8afc963f7a2c9764b3c02a3944780774d9a8607de53b50
BLAKE2b-256 checksum
How to use checksums
aa85e3bfddc9e2f2f211f5a6b71bd5c1f4c54fb56523372f2c75f1c4ea97d0bf
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 13, 2026.

Transparency log

Security for scinumtools3 0.10.2

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.2.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 13, 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