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

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.6
File Size Uploaded
scinumtools3-0.8.6.tar.gz 10.3 MB Details

Built distributions (wheels)

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

Total release size: 292.0 MB

Release files / scinumtools3-0.8.6.tar.gz

Download URL scinumtools3-0.8.6.tar.gz
Size 10.3 MB
Tags Source
SHA-256 checksum
How to use checksums
79052674f41bc2bcaece1633e8ae1409f5b230f0dd0ed2b5ab4f18acb75a8e0b
BLAKE2b-256 checksum
How to use checksums
5a789a0d38c7612777d15864fb8ba6c606611d0fde2eb64d5edac49aa06e9d82
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp313-cp313-win_amd64.whl
Size 38.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
502aeb0489ea62a525e6d0bddf06d98948e67b29668f716e63971977e04ffe01
BLAKE2b-256 checksum
How to use checksums
0a96fb1aeef2203cb1e2ea81b188d08deb904479a6294b8bf3d02db8cae7ce04
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp313-cp313-manylinux_2_28_x86_64.whl
Size 16.9 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9ec13709f181a5925977d88af0265414d84b0a539ef3b435f93950b04341a983
BLAKE2b-256 checksum
How to use checksums
d0ce53d52d3c89400d1bdea1c836ee09304c90294e853dc6632c061914c9ee64
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp313-cp313-macosx_14_0_arm64.whl
Size 15.1 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
a4addeca3d18f1f3305ef1f80ad080656dc53f5407de809aa3b2e45ca54cfd5a
BLAKE2b-256 checksum
How to use checksums
9983d5f2f8588e4e35e6b7a5b732aa5b5ec241bf98c8a8c30aa140981154c974
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp312-cp312-win_amd64.whl
Size 38.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
526ba99fd9d47c6ab6c443cb1dbe65622f8e19813ccbaddf06267391b3c0df97
BLAKE2b-256 checksum
How to use checksums
a58f7dc7c7ea11be58afdf30f0fb8166446b64c39008e21959d8574f67c2a036
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp312-cp312-manylinux_2_28_x86_64.whl
Size 16.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
560f98829466f5b0cc2e58b62b36b0c9eb19c54121c651ded022867d5eca9ae8
BLAKE2b-256 checksum
How to use checksums
00e9428e6f95200666cc61048a5c81acd3eddf4b4c32b8bb559385a4eb254c59
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp312-cp312-macosx_14_0_arm64.whl
Size 15.1 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
f62dc629105f82a03677d584de237642d06254d185b50b2b933bc677c498925e
BLAKE2b-256 checksum
How to use checksums
78cccb0aaefc67029b948154b042d7eeb56b55356629397301faf0cd43ad80f1
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp311-cp311-win_amd64.whl
Size 38.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
23a127a9d9e47dc72180aa21019ff1c63ad38206e18a86c767a03ef30bb4a243
BLAKE2b-256 checksum
How to use checksums
0361afced892c3d48bfd734bc5cbc8a8e427ecb254fee61408d25cba01a24343
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp311-cp311-manylinux_2_28_x86_64.whl
Size 16.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ef8e86a61ab576f79dba7b4c6be13df455a3fc79283cf2cb11623ede915e0eac
BLAKE2b-256 checksum
How to use checksums
a40d29acb8c82d183696a5ec98f6e79753fe347a4fb073a594cd628e42d1317c
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp311-cp311-macosx_14_0_arm64.whl
Size 15.0 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
da3b8acbadbe1581bf6cd488ad7d7ad0e8ffcbc4838aa7851c649c01651341ae
BLAKE2b-256 checksum
How to use checksums
6a57d7ed6c273bb8a878099530ca19f8d6fa2fa233edc9436034d7cfbe280dc2
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp310-cp310-win_amd64.whl
Size 38.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
27d3794a0676f1252ccd2f42ca20714bd70fa4480ec5eac602643abde90d2093
BLAKE2b-256 checksum
How to use checksums
f69cc761339c7c3e53eb76735d53dc324d7afdd7abc82954b6d76c32fb47eb10
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp310-cp310-manylinux_2_28_x86_64.whl
Size 16.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e344980357ddfeddb0adc21beaada6e3c2a38b37ed10c4ba800062d3374662db
BLAKE2b-256 checksum
How to use checksums
4a8472b8591386f50e8480c1f8e4a2cd81edb847843e58ad66adeab56318d807
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 29, 2026.

Transparency log

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

Download URL scinumtools3-0.8.6-cp310-cp310-macosx_14_0_arm64.whl
Size 15.0 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
dfd99d377dcd6b2f462e99357203ac8e276581646487f0c2742d370bd5510793
BLAKE2b-256 checksum
How to use checksums
b7cbd40d31a1076b62decca1e29de16fb1f9f63194c875711de086974bd9a35d
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 29, 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