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

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.5
File Size Uploaded
scinumtools3-0.9.5.tar.gz 32.4 MB Details

Built distributions (wheels)

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

Total release size: 339.0 MB

Release files / scinumtools3-0.9.5.tar.gz

Download URL scinumtools3-0.9.5.tar.gz
Size 32.4 MB
Tags Source
SHA-256 checksum
How to use checksums
3550584cbaf05fbe6390d99285c98212dad1e3e281cec450c3167f35fb1f6e1c
BLAKE2b-256 checksum
How to use checksums
958a373bf580e596372a9eb50d9974acead49a9b67011e1043b036add94463c0
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp313-cp313-win_amd64.whl
Size 42.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ae30b4f022c196cb779db42c842e72be2452e95714b1953cf99dd60a48a1c661
BLAKE2b-256 checksum
How to use checksums
1936db9254c8ac0bbec98d8c60debc0bb94476b4eb9f1345c2b00d8842c9c923
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp313-cp313-manylinux_2_28_x86_64.whl
Size 18.2 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6dfb0171ed5e0c5257f43c7216beaf14f8ec6bc5c7035efc1f6ba9cf4cb5586c
BLAKE2b-256 checksum
How to use checksums
d91499bae349f0784f2dc03a03306b1d0b211d9ab9ea23e297e4998a7badcbb5
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp313-cp313-macosx_14_0_arm64.whl
Size 16.2 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
056d0e0409ebe1579836bd0ce3e7758169fffc857500e8f5089e33e22c197c45
BLAKE2b-256 checksum
How to use checksums
70d575ceb414d76c08bfe29582983e7225febba462f87f4e1a3f7401cd909428
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp312-cp312-win_amd64.whl
Size 42.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
25b3e9f193cc76272503000277c46a38fded5890d735aa7eb85f2e6398d3b618
BLAKE2b-256 checksum
How to use checksums
5d5991bf2bfd0f9e698b54db991cc9d4fe87965f360a9496d2752e93104f7537
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp312-cp312-manylinux_2_28_x86_64.whl
Size 18.2 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f2a3e96ff9f0c5fbfe6f92b1e9cd0f5c9229e243078b42043268f3f3fe02627d
BLAKE2b-256 checksum
How to use checksums
fd7804abe9716fe35db47b4c7b4fd2b5485e76932fe2c4d1e42a76e9512f488a
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp312-cp312-macosx_14_0_arm64.whl
Size 16.2 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
8e305d9577d54ab067adcba164e3a335d04586501f977f0e7b50de25890573ea
BLAKE2b-256 checksum
How to use checksums
19b1d617b5dbe58c1d4ef391768c471fd93068afa08a04d08a6e9f72fc633611
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp311-cp311-win_amd64.whl
Size 42.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a189bd0a873019fbabe080b6700948360332f35cfd920470dcc950a5acdcf29b
BLAKE2b-256 checksum
How to use checksums
47bad2c71798658cc4ffcd493fd5651d7955b30d230db8386338f304e6919b78
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp311-cp311-manylinux_2_28_x86_64.whl
Size 18.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7853d5d5d0ae0ed9974fd561a7cc0918f49b75e5618c53f92a560ca7d46c6518
BLAKE2b-256 checksum
How to use checksums
dafc4df1f8902da6170571802b4feb6240ce945da3467470d2e454df71bd5f74
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp311-cp311-macosx_14_0_arm64.whl
Size 16.2 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0f87f063eae7cb86c11c0a42f514432733e98bac34ae4cc97b7d37274d60132a
BLAKE2b-256 checksum
How to use checksums
a766ae8b819c56e6c9d98a82d3f9d93c3a1828215bf7573a4e884d5e5fd6210a
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp310-cp310-win_amd64.whl
Size 42.3 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
3420fb1aa48bf6c880d70a0bb83c85814e9025dc54b723f196cf78487842678b
BLAKE2b-256 checksum
How to use checksums
d9e0df59deb22c7a9522caf0c1fd9b952a1db79fb46c5400674380dcb173fe50
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp310-cp310-manylinux_2_28_x86_64.whl
Size 18.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ef885ae6e1b1a233d6278b97e3f8a58dd76137c45b4230ee1483c870762dc74b
BLAKE2b-256 checksum
How to use checksums
dca068002031066b6cc3b405a3b9fcaca63d742214ca25054c9b90a9c59013d7
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 14, 2026.

Transparency log

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

Download URL scinumtools3-0.9.5-cp310-cp310-macosx_14_0_arm64.whl
Size 16.2 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0afdde30c3c7fce6712d4d4ab7d18e660ccee87feacec49160b9cc7bf6f0d537
BLAKE2b-256 checksum
How to use checksums
15bcbe31ee74810d07f9fa1b1812c5e35a3b42d4332fea52891d8f61d7e2dc44
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 14, 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