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

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

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.3
File Size Uploaded
scinumtools3-0.8.3.tar.gz 7.8 MB Details

Built distributions (wheels)

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

Total release size: 272.3 MB

Release files / scinumtools3-0.8.3.tar.gz

Download URL scinumtools3-0.8.3.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f7619e7288ee066709ef0848d30e5b2e88fee4fae4b687c0fba6f45d8b5d6b82
BLAKE2b-256 checksum
How to use checksums
9c578c7e1bfaefb127ffe4bfad7e54df375cdbfcda469b815e6e3696d5e493c9
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp313-cp313-win_amd64.whl
Size 36.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b4004a332a847464ecd30a88d6a620910431ee09548e6ce1e245ab834d078cc0
BLAKE2b-256 checksum
How to use checksums
564e8de716e71e6f8d9304092324f8c0bf760ab24e9e4ee11dbcec5761c5a956
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp313-cp313-manylinux_2_28_x86_64.whl
Size 15.9 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b735c1c13fcfb52db4ba8be0537253b3bd5272871f276e3e66dc8b9befbb2cf9
BLAKE2b-256 checksum
How to use checksums
9c859a347893aaa899bb2993e95df7e4cb0fdfb663bec38d35c9b2cd03f3e1dd
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp313-cp313-macosx_14_0_arm64.whl
Size 14.2 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
112a0e6b7f587af2bea8efe483b7163a699e7a057179571a5c7c744018fb0eb2
BLAKE2b-256 checksum
How to use checksums
24f6b2dfbcb2d1f3ef8ae6707d25ff0e1ddd3dd82609c4eca742125f548d462f
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp312-cp312-win_amd64.whl
Size 36.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7875d009ce6535d71c375fffeb47294701179604d216bd0cfef014696865a4cf
BLAKE2b-256 checksum
How to use checksums
17f5eecc57f0949b3f1c6920c17e3c160553acce4b585dc299a8791083df2274
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp312-cp312-manylinux_2_28_x86_64.whl
Size 15.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
55b2e58dc7f22c046162ff81ed9c9359654fc92c0b4aa5a0b8406ff0bf5ad947
BLAKE2b-256 checksum
How to use checksums
6044b08674451c4e1293700b11ab9d4fcd186f1440ecacb6c334435b3aa4edb8
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp312-cp312-macosx_14_0_arm64.whl
Size 14.2 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
71d18ff1a21ff17992a0fe96d1c18dbcc5bbed54645fb3eab16f0ad50a334779
BLAKE2b-256 checksum
How to use checksums
42ff10d324eedf249e5159778b56a2f01573ec1f1f8bdd4ff0c54cdd7b20bd27
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp311-cp311-win_amd64.whl
Size 36.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
34e01a7084182b6bab157d8e6a37e7106b8b0b49f2d1fb4933711d888f832840
BLAKE2b-256 checksum
How to use checksums
db3ed8d9790f8f3f75d3df952aab9240a0bb3945d0020c2027279b488cfaed5a
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp311-cp311-manylinux_2_28_x86_64.whl
Size 15.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
86e1b64223a4f489f9b228ce89e2c68d9d03092d72cbd798a7e558d0f367926a
BLAKE2b-256 checksum
How to use checksums
2220a0f2e741dd6f749f924e615958374fc18a57394b65f6af7d23938704fe9f
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp311-cp311-macosx_14_0_arm64.whl
Size 14.2 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d4c6cfe8fe8bface452502780ad973605bcb0ebc425c11ba6176bfb6ed535e17
BLAKE2b-256 checksum
How to use checksums
da75400c0e2fc6402473a368f404df7e2792b200615f070698f1abbec0f52ad2
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp310-cp310-win_amd64.whl
Size 36.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d2ce5dd405a41255bf6d4c59757e2646d0e8a4d3136b2f38ca7169f3e8634f57
BLAKE2b-256 checksum
How to use checksums
86603ae581e397f38c55a9dd73f64f001c2b137922fabaea12f971ffe0919747
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp310-cp310-manylinux_2_28_x86_64.whl
Size 15.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5d96e13ca877bc016c666731215cf8268aee9462c3015dc1274111f79f227f63
BLAKE2b-256 checksum
How to use checksums
6a7cf86b298d71b20578fb856d0c4375a98cb915f71e4ce72f8eac96eb14ce2f
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 26, 2026.

Transparency log

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

Download URL scinumtools3-0.8.3-cp310-cp310-macosx_14_0_arm64.whl
Size 14.2 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
4b93d5316fe5f831b8e9aa66edb203b9ce346dbe90d7ed6117ff2fe4ec7e7221
BLAKE2b-256 checksum
How to use checksums
ef1df814cffc7112f6737ea0b43cc6592f8b56f685e87218c32f2bb951d72301
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 26, 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