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.

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.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.9.4
File Size Uploaded
scinumtools3-0.9.4.tar.gz 32.3 MB Details

Built distributions (wheels)

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

Total release size: 336.6 MB

Release files / scinumtools3-0.9.4.tar.gz

Download URL scinumtools3-0.9.4.tar.gz
Size 32.3 MB
Tags Source
SHA-256 checksum
How to use checksums
3ff46f1a6bc58c4cb1ac4f2f90709c877ff8a50a41e4f5e8e19e11ddd955cfb7
BLAKE2b-256 checksum
How to use checksums
6dabed0ed739d458a1f706af7def2bb3d4d9bce757ab48cbc915c2431d64ff60
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp313-cp313-win_amd64.whl
Size 41.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
63b055b8f797d9004c5b559457e284d2c83be2d5012ed03d314d5ef9cd730b2b
BLAKE2b-256 checksum
How to use checksums
ff416683ea1c08764b821c560ddf77be3c12bcc92cbc4087c16025027ce69b2c
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp313-cp313-manylinux_2_28_x86_64.whl
Size 18.1 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
69bfa7b76bb97574951ab1fc56ca1eb206caa3ad497a8c4cae4a26a5e4895ce6
BLAKE2b-256 checksum
How to use checksums
03ac97e0e403ed61f04a0e2429eb6e5ffdb56c60cf250e96e8bdd69087d63ce2
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp313-cp313-macosx_14_0_arm64.whl
Size 16.1 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d9b9303f05aca0d79ba9413e89c629680403cfea3d43f7316b9ff2905b0f7f46
BLAKE2b-256 checksum
How to use checksums
37a31adad3a6bf876501e5c9b5ad621da7d73b00de71602bbe8e45d0cf6934e2
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp312-cp312-win_amd64.whl
Size 41.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6373cf47bd45707ac18cec4a204f2c9751c0c42e0ac6aa1faffa18c289516da8
BLAKE2b-256 checksum
How to use checksums
a84cc6ffb8913be6e5172aa3ad1d75ac15970dde7c4039e6c12df1ee2223b9ca
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp312-cp312-manylinux_2_28_x86_64.whl
Size 18.1 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
535907f9dc4a5d32e5ac3cba0dc7d61322f5b1c2ebf6bb400545db9139983589
BLAKE2b-256 checksum
How to use checksums
2862c97e8e8aa57233364cd1b1e238182d21bbc4b031bf7caf6f9d851096918b
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp312-cp312-macosx_14_0_arm64.whl
Size 16.1 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5a7ffbc32a4ef25be7581301925fcdb2389163a9622b16014f15a33c66352272
BLAKE2b-256 checksum
How to use checksums
534afa83790c049d557f8b6dc34e4850941bbb0d41145d5f76a7cde95246f41d
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp311-cp311-win_amd64.whl
Size 41.9 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
efb48bcb085d2c39cde73d520d14bf90e024d3fe0d4893d125c876d13f324389
BLAKE2b-256 checksum
How to use checksums
0fafac790c8d092afbecb5bbcee039803f87edbfbcb6b3d46aa88fd1bed7ecae
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp311-cp311-manylinux_2_28_x86_64.whl
Size 18.1 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
25c69821b0119ee8ce065060434d4aaa21c36b17f8ea139eaced12b93581f846
BLAKE2b-256 checksum
How to use checksums
84148c5418f7cb077e16fbd1e1b7bde657c117312101c3c69f0ef3df44e51416
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp311-cp311-macosx_14_0_arm64.whl
Size 16.1 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7c4dd39b370ac2ebd0afe15f8e306d310de6a450ace064fc7829ca0c54e0689d
BLAKE2b-256 checksum
How to use checksums
67b9fca5e69c8f24ad382badc8a1533a05505be70f26a88b7ff121375c02d90d
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp310-cp310-win_amd64.whl
Size 41.9 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
fe4712e482aec89fcc5f966245f04c00007dac29fcd98b73cbfb5ce64746445f
BLAKE2b-256 checksum
How to use checksums
639dc9b922d9c1852a419fce2c62309c8d46f8e02ff3a976dba8c948c24fbfca
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp310-cp310-manylinux_2_28_x86_64.whl
Size 18.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c6ac6a8e2293d2461347a6ad58c4f30fc1aebb74aaf1797a38bac6ba8f9ea8ad
BLAKE2b-256 checksum
How to use checksums
9b7029a5d620499267f09c5d76db24ff68db5eea52d6d816761c0567ee0386ca
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 Oct 12, 2026.

Transparency log

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

Download URL scinumtools3-0.9.4-cp310-cp310-macosx_14_0_arm64.whl
Size 16.1 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
3590941974be9fba7824b79281e13b43500dd3a60405573e14c38b9ea6de09b7
BLAKE2b-256 checksum
How to use checksums
6aa1895edf596e09efb32d48528b183159981a401027cbb3cb2db2d012bddc1e
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 Oct 12, 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