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
  • scinumtools3.api for formatted, command-style evaluation
  • NumPy interoperability for array values

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.

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

Parse it into an environment:

from pathlib import Path
from scinumtools3.dip import DIP

dip = DIP()
dip.add_file(Path("parameters.dip"))
env = dip.parse()

You can also add definitions directly:

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.elements() to traverse list elements and cursor.items() to traverse named items in a map. 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.8.4

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.8.4
File Size Uploaded
scinumtools3-0.8.4.tar.gz 7.8 MB Details

Built distributions (wheels)

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

Total release size: 276.6 MB

Release files / scinumtools3-0.8.4.tar.gz

Download URL scinumtools3-0.8.4.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
5e65de5d38216eb1f4e4b0ea98df66d48c6f77033cfd8db24918f56aa4cc353f
BLAKE2b-256 checksum
How to use checksums
8bc1756d06cda206ff529ada3014fc9f1e4339fa76424b165e0e5652075e1674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp313-cp313-win_amd64.whl
Size 36.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
317603d216d861ab9ff853e5858363a9490c3472767b0eedaed7d44ce5d1fcef
BLAKE2b-256 checksum
How to use checksums
876bb8719c0cbb630e6aa97942c4332a9cd1e548f5815175f705375f590c324c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp313-cp313-manylinux_2_28_x86_64.whl
Size 16.2 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
117544332d562ce74fe8dd5c89ab1ea086886948af13d9b4fbdd9b1dbb4bc029
BLAKE2b-256 checksum
How to use checksums
583c1e5ee239bfb3ac33d807631ec0875882f97c552c9a3f6c557055f36c0bd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

Release files / scinumtools3-0.8.4-cp313-cp313-macosx_14_0_arm64.whl

Download URL scinumtools3-0.8.4-cp313-cp313-macosx_14_0_arm64.whl
Size 14.4 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
3a1f475927c815d87b6cefdc6ae7a42f8bd9de4a2d22e44dd78a9cb1c28e53cc
BLAKE2b-256 checksum
How to use checksums
6196c58e9d5446e2f980bd0d2129d9f231c5b4efd37c30fc2e92f67abfa6e640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp312-cp312-win_amd64.whl
Size 36.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
2d2cba4dd8394d586659d1c383cf9e3e1640202db112cc927387d00252efddea
BLAKE2b-256 checksum
How to use checksums
9c706db176129931d2893915237c912c812cccd4d6428c829a9af1da72abb688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp312-cp312-manylinux_2_28_x86_64.whl
Size 16.2 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fbdb817ef504cadd6b333b71db09cf90410e562bf2d065e50d21d87af918c391
BLAKE2b-256 checksum
How to use checksums
fdb835947f41c23eb77103ffbaae0ef2df08d04ad816304989a44b45ecd32680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

Release files / scinumtools3-0.8.4-cp312-cp312-macosx_14_0_arm64.whl

Download URL scinumtools3-0.8.4-cp312-cp312-macosx_14_0_arm64.whl
Size 14.4 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5700011f8fb73ab32f58bf532709e5dbde02e5a1b00ca69279313b78ff5189b3
BLAKE2b-256 checksum
How to use checksums
ff1f738afeb86f10f6765396fc05e56b85ca6dc05ed7e5db6b2f7b5e866f9ac1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp311-cp311-win_amd64.whl
Size 36.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
4c2b3c63cbbc6e74fc14f2bcb46a469d1df640b5548b27ccf17d3424e570d7bb
BLAKE2b-256 checksum
How to use checksums
a2a614eebd71765ecc81d91d9230e36b13353c309e90f1f07ed2972dde734780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp311-cp311-manylinux_2_28_x86_64.whl
Size 16.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
544d535a67f738d0a3e7777f1c4dfbe123fc7aa51d13dae35426bfface724182
BLAKE2b-256 checksum
How to use checksums
56974849a4b98d5ad2e0917791da033c3319a3d0018923cee197dc4316ce38c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

Release files / scinumtools3-0.8.4-cp311-cp311-macosx_14_0_arm64.whl

Download URL scinumtools3-0.8.4-cp311-cp311-macosx_14_0_arm64.whl
Size 14.4 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
9482622ccf4b8b40a26b57edb19a69cc72f6d0bc6ec1614b581c002afd42eefc
BLAKE2b-256 checksum
How to use checksums
0d64d4bc0e37058b5baefddb6d17bef552ed75606a70c71657f473d6a2557525
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp310-cp310-win_amd64.whl
Size 36.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1882d7e30f6fcd9a27df6512bb2c6ca9202eb7fede8037a4811b41bb7ed200df
BLAKE2b-256 checksum
How to use checksums
ce1795d89a93bd1675c656231f3be5ac564f738e6148dbec40764c114fa79fca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

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

Download URL scinumtools3-0.8.4-cp310-cp310-manylinux_2_28_x86_64.whl
Size 16.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ee7e29745c594826feb08ec6ebf522c1d62551d5c3a678c40a87a6a3276430a9
BLAKE2b-256 checksum
How to use checksums
e3f0272a4530c4d3010697c3003c39c863b126b071254ec43489d98d949821a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log

Release files / scinumtools3-0.8.4-cp310-cp310-macosx_14_0_arm64.whl

Download URL scinumtools3-0.8.4-cp310-cp310-macosx_14_0_arm64.whl
Size 14.4 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
e2dfe3e74fb2c9c047f5dc9cb7ad4a2016b739e46529f46a358dc5af8d747ad7
BLAKE2b-256 checksum
How to use checksums
a1744a7b8b45692e5765a0b306eacf3daa4298973585e63e752c21f2c63d99a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 27, 2026.

Transparency log
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