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

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

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

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.9.12
File Size Uploaded Provenance Actions
scinumtools3-0.9.12.tar.gz 36.8 MB With provenance Details for scinumtools3-0.9.12.tar.gz

Built distributions (wheels)

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

Total release size: 389.7 MB

Release files / scinumtools3-0.9.12.tar.gz

Download URL scinumtools3-0.9.12.tar.gz
Size 36.8 MB
Tags Source
SHA-256 checksum
How to use checksums
9867baea2510e408b1fb15fd9b60767d08b8082aaf3bee71d2fcef72031559ef
BLAKE2b-256 checksum
How to use checksums
318c88d2f6e0a5cade308307c8b0bddfd33a2cd6396ffdcb227d52b4f29e53c8
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp313-cp313-win_amd64.whl
Size 50.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
24483ec90452a24efb865496d338067eafc4c88dda2e51b40e811f05bcdc0bb6
BLAKE2b-256 checksum
How to use checksums
e424c88e958f34a768bacf22b6798cd710df39d8ff5402616a800402b6ec2598
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp313-cp313-manylinux_2_28_x86_64.whl
Size 20.3 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3e37120b9c42d4dd335d8cdfac05b29f7c74ff2353ad69f3d9bf30e5951dd880
BLAKE2b-256 checksum
How to use checksums
baea5995c8d2636a746115efcad1ce5f8a4c61c2807ecce1028170cbbe203a00
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp313-cp313-macosx_14_0_arm64.whl
Size 17.8 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
8ecbfe0d0157349fad6f8880bf2d2475e7f126393350ee810647a13e05c253bf
BLAKE2b-256 checksum
How to use checksums
4eacbdd9d66be63134c60ff5da3e3345046b1625669fda832ec428b2affc121b
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp312-cp312-win_amd64.whl
Size 50.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
364e7ef2123a2f43f96a2d5753bb272dc3dad0e63beda62a69037b4bf8345cc3
BLAKE2b-256 checksum
How to use checksums
29c7970d44da2c331531d7782e5964d6d2ce34eedbc615f0d45096659378531a
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp312-cp312-manylinux_2_28_x86_64.whl
Size 20.3 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
916e47f78b6e0dca25ad124b33b61a69375572a748944fba99407d7632d53207
BLAKE2b-256 checksum
How to use checksums
57341da98749b0340a985ab0097ee5ba9a3ffed738f46ff5751339b62e607e74
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp312-cp312-macosx_14_0_arm64.whl
Size 17.8 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
104fcff354b187c4fa486e921d3a0d7fa8e8073198c94b4d4b1632ffcb7fd3d2
BLAKE2b-256 checksum
How to use checksums
149689e57e0c1d33356fa3a5db6b4e03b98431db4e7af2015ebd460f268a1928
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp311-cp311-win_amd64.whl
Size 50.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
aad4e03a6cb25d9f729af675436552113297497f41987d18ab698cfd5c594b60
BLAKE2b-256 checksum
How to use checksums
48f480f58c8c9f740307d8f1d489e4b9525acdadf2364f04c6b3628774700341
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp311-cp311-manylinux_2_28_x86_64.whl
Size 20.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4aeb86335aee0c53bca4895d0d88691cf6e14aef087a2281629a00294cafd42d
BLAKE2b-256 checksum
How to use checksums
27d0fafd35781089bb61e029d605edde7260769a9cacd093fe762101f79f1325
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp311-cp311-macosx_14_0_arm64.whl
Size 17.8 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7c7d35094958ad22969c3c7dc1a8f7129eea5a3f8e9afb494df3903de46f8c49
BLAKE2b-256 checksum
How to use checksums
ae558e4b34ac6cb6659132cb6d99def664918c1c406bfd47bc2e5c0bb25fd31c
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp310-cp310-win_amd64.whl
Size 50.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
398290f8ec4e8150678fc0bc8f0c50da6cd0062925577c222d7b10b1fe64b3ec
BLAKE2b-256 checksum
How to use checksums
d9e6234207e3920b90370b94a86b297e528840380a911f87bdc2d3cc83895344
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp310-cp310-manylinux_2_28_x86_64.whl
Size 20.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eaa23a7b774abb2e69cff76c2debc8763b1403ccd0ff57fdebef88c18adccbbc
BLAKE2b-256 checksum
How to use checksums
4aa18f3338ffad268e6586d507610e59ad9171a43b2d56bca84b289e4b5a517d
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 Oct 27, 2026.

Transparency log

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

Download URL scinumtools3-0.9.12-cp310-cp310-macosx_14_0_arm64.whl
Size 17.8 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
06af2404c05ac362a5dcd90441c0b21c99c9a30458d3a768b0ddc8fe89c46f83
BLAKE2b-256 checksum
How to use checksums
990ee34d6980f915993650b2905995bda2cda35fe51fc59e36c08c9fb52cc675
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 Oct 27, 2026.

Transparency log

Security for scinumtools3 0.9.12

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.9.12.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 Oct 27, 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