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.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.8.5
File Size Uploaded
scinumtools3-0.8.5.tar.gz 8.1 MB Details

Built distributions (wheels)

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

Total release size: 283.8 MB

Release files / scinumtools3-0.8.5.tar.gz

Download URL scinumtools3-0.8.5.tar.gz
Size 8.1 MB
Tags Source
SHA-256 checksum
How to use checksums
f868f062971732c9e838cf7f3e48b384bf9e4bc2aaa0d0d25aefb2661e66427e
BLAKE2b-256 checksum
How to use checksums
5beb786f3758d8aa5b0f81768850ca4a1a1e05e8aa1b03d532143a4eccb00a0a
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp313-cp313-win_amd64.whl
Size 37.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
2e4db30ed7d05f9964a6ffebb090dacbb79503aeb8d5b654f7de61b20ff37503
BLAKE2b-256 checksum
How to use checksums
bf664124bb0a917080fb8c54006202b8f1b75cf60c53daf6067f92da966708b2
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp313-cp313-manylinux_2_28_x86_64.whl
Size 16.6 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
85567602025a29de8a7a7b2f7137b936fcd5e899fe9bf031421825ead7591e27
BLAKE2b-256 checksum
How to use checksums
991d9b66c44d7dd4fc55665e7fd1e8c06e09c1b575e81c8d5ebf5aadf8683da9
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp313-cp313-macosx_14_0_arm64.whl
Size 14.8 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
bd6221b910d4a383cf4f5c3e18c5852374da4653274d3b5f2b14b19d1f2b2761
BLAKE2b-256 checksum
How to use checksums
cdc16c0a1038e8f4d383cb38f69503dcd3ac88015714700befd6035cae0d623c
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp312-cp312-win_amd64.whl
Size 37.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
e3f357a640d1e2d1701b0e68a792c5dcda8853ef1981738f0633c4358e8f0faa
BLAKE2b-256 checksum
How to use checksums
9177b6b3d7da61b23a02a16bffb3a58883595bfd7ad3b8d350bdc71aac9800ba
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp312-cp312-manylinux_2_28_x86_64.whl
Size 16.6 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1fce572775b84c3590f3a5fbf119068a6d6198b17162305dcd4ac3a7fbb619f8
BLAKE2b-256 checksum
How to use checksums
2f89f87f2ce38a59f123a6f48fb1ddbbcfd977e02462746ac6e68b1fa374c289
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp312-cp312-macosx_14_0_arm64.whl
Size 14.8 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
83ac155dfc4e2c54f3252b7480c10497572a29b2f82fcf3d1b5c0be0dd633bb3
BLAKE2b-256 checksum
How to use checksums
971308d82d221011452d5ac0cd4cdd3721b3126d1097ea6a6836327f16ed5c13
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp311-cp311-win_amd64.whl
Size 37.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
99a45026c5f72a856be1eebfecba1949f98ff2b845582b41971feeb02c76d079
BLAKE2b-256 checksum
How to use checksums
a1d6a541f757bd83f3803e389502d9b1698b01fee9760155b97195d9df53308e
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp311-cp311-manylinux_2_28_x86_64.whl
Size 16.6 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ad369b1fdeaa3b7813af656a6d74b96e74b8b5159bfd9c136cbcd2c36d75f5c7
BLAKE2b-256 checksum
How to use checksums
f7f00816bda3eba25e3e2c720a95dba6cf2fc74f23f5d01154efeeb3d11f49c8
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp311-cp311-macosx_14_0_arm64.whl
Size 14.7 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
80962859325a83bb44f0792230332682b02a6d28a59184f18339503f11a33923
BLAKE2b-256 checksum
How to use checksums
7611d260c4d9c48ee17c2eff3a097c5eb51ad512be639eb80dfd2b4184245104
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp310-cp310-win_amd64.whl
Size 37.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
e1ae48fa93d482bc9787631c1f66727036b29117c6d2bff5b15497e24402f730
BLAKE2b-256 checksum
How to use checksums
382d85ca358ef017c5fc04ca15a018385948f95806d3ecd3d090de57aa94f5f2
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp310-cp310-manylinux_2_28_x86_64.whl
Size 16.6 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
61cb46998ceb7dfedc6f956b815c0027fc63a64f9e366b6ad991d7b09985c0cb
BLAKE2b-256 checksum
How to use checksums
ae7d0a4d40d3d885ce51dfc8b0c63a33ab25a5b8d12e37f05c65557d0f04d549
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 28, 2026.

Transparency log

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

Download URL scinumtools3-0.8.5-cp310-cp310-macosx_14_0_arm64.whl
Size 14.7 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
a7bf4429c5f886aa9b539fbcce9fd507720e91653db0b6ba2d6081ff05f8b9a0
BLAKE2b-256 checksum
How to use checksums
0d47c5b68243c3dea1794e9fc39a5e2066bee75b7f148fa07875938990ab2b6e
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 28, 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