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

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

Built distributions (wheels)

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

Total release size: 382.6 MB

Release files / scinumtools3-0.9.11.tar.gz

Download URL scinumtools3-0.9.11.tar.gz
Size 36.8 MB
Tags Source
SHA-256 checksum
How to use checksums
72628af261682f025dbf7a9e149be0d353c8e5953353882b410edbaacba50439
BLAKE2b-256 checksum
How to use checksums
2f5dbabc7205badb1812c744dfac2f163efaba00535693a027a531819ad5bf82
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp313-cp313-win_amd64.whl
Size 49.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
60d60c407e25e68e4b643d8bc28f1b845713dded00fbfef1cc9ac36d7731d5df
BLAKE2b-256 checksum
How to use checksums
ae604953048ed28f12d2a0107d63d2e8d723a1bc9a42a6d294ca1fde1ab1522d
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp313-cp313-manylinux_2_28_x86_64.whl
Size 19.9 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
02bcd73c805aeba6535c66eff84db920c5f35015f09db8642a8bde616033a27f
BLAKE2b-256 checksum
How to use checksums
5175297efa329194e4464e22926c93a2fdf8f68001c9f44d4f56c55379d8b8a5
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp313-cp313-macosx_14_0_arm64.whl
Size 17.5 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0fbef200bb11b4f8c458915458e6ab315b74971704b49b807e5a73e275ef3796
BLAKE2b-256 checksum
How to use checksums
e11efb500c0d8bca5441b74aa45a23e956be639db69317178216eb50ca6e1e82
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp312-cp312-win_amd64.whl
Size 49.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
082a484da39e2263c04fbe04390b99dd873ca0b658435a318d5c6a51b889ebb2
BLAKE2b-256 checksum
How to use checksums
afaee73f9ca016f4eee569c39455f75cc06f3c4e603c3dab519450d75016b2b8
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp312-cp312-manylinux_2_28_x86_64.whl
Size 19.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0e5af5b885ddc7777018b0cd5be7f6c35491f8b4fa40ab858fd967b2484e23a8
BLAKE2b-256 checksum
How to use checksums
36920dbf491419fa1f7106ad0d0a6ac0565f141f8393933b01f4dca0abf39c68
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp312-cp312-macosx_14_0_arm64.whl
Size 17.5 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
83657df0b2a07bd9b2565e54ab888d9e83b6c42afbf88811f72a93ea16d80d1d
BLAKE2b-256 checksum
How to use checksums
0cb241f4e3e3a0b344133b10b07ae4f2a52b174d383489a2387ebb91dc92fb48
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp311-cp311-win_amd64.whl
Size 49.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
341685c78abcc5b366df9cf7b90030979833384b82e64f09610535ac3ef59e40
BLAKE2b-256 checksum
How to use checksums
31b6e13fd2492e0c94c6bba3b11dca4d2b8fc0a0f0f69a1bfb965cefb5e7ffbf
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp311-cp311-manylinux_2_28_x86_64.whl
Size 19.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f78ce642261d3909107af005399b71268a5a3d0d525a9808ee98c19bf28381fa
BLAKE2b-256 checksum
How to use checksums
98da811c94e6990c8626bc5b9a1b2a9609ece90529afdda725cb3a91d2ac9c4e
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp311-cp311-macosx_14_0_arm64.whl
Size 17.5 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
acbf650436c3f125f3c6005cd0211bfdb6b25e56a2ea33520b62cb40f10f0122
BLAKE2b-256 checksum
How to use checksums
281b481fc89eca3823379b43f6eb84af8d119dd337623dca8cf906a931b925f3
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp310-cp310-win_amd64.whl
Size 49.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
f9f5d96b9aecac2b0d22882d966fa45df096fbb69472f7255f288ef97ffafd0f
BLAKE2b-256 checksum
How to use checksums
cad735803fbe88788656662386f045d7f5607a5c8b8f47c0944754b4229587ca
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp310-cp310-manylinux_2_28_x86_64.whl
Size 19.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9b41a804569129b378b5edef8b4571c6a02cca7b601588aea0ebcc60fc70dacc
BLAKE2b-256 checksum
How to use checksums
b8e8bdb5b2e1cabfdc0732c39f828a36fda1c8ed5e0ed3746cf3453944f853cf
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.9.11-cp310-cp310-macosx_14_0_arm64.whl
Size 17.5 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
ca671e4f607d9f2962df514e991c4d5a39c26800ab0239a9774c1c2a77f8cb2f
BLAKE2b-256 checksum
How to use checksums
62c0980741505e4c43624cf8e1b80f6daa34a0087c7e33b078176e185d770e05
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 26, 2026.

Transparency log

Security for scinumtools3 0.9.11

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.11.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 26, 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