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

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.1
File Size Uploaded
scinumtools3-0.9.1.tar.gz 31.6 MB Details

Built distributions (wheels)

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

Total release size: 321.6 MB

Release files / scinumtools3-0.9.1.tar.gz

Download URL scinumtools3-0.9.1.tar.gz
Size 31.6 MB
Tags Source
SHA-256 checksum
How to use checksums
bf009b75fcb78de60007e0f30d1c86e3500e9b60dbd74e8c37e7209fe78c102d
BLAKE2b-256 checksum
How to use checksums
529ee30a84630d4cae1e0edf2747d9e454c2c1c83d6126bf979039f0f92a366f
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp313-cp313-win_amd64.whl
Size 39.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
7447291d151941201d8cb7661c8fd15219b9dc41188263a8b4c49f4680228c4d
BLAKE2b-256 checksum
How to use checksums
f3c04c05cb81925b610f42a9882c4573759ef2c194ed0f431f0acaf2226bd77f
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4932adc76287eba370456019cd4fecd15c53fc85b8bcc8211b42c442b6cfbc60
BLAKE2b-256 checksum
How to use checksums
7ebc8511d310e2478ae892feefd43a6e699af3782949649f453c8ab76fbc752a
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp313-cp313-macosx_14_0_arm64.whl
Size 15.4 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
55000251c67608d0ba2d102d94dda1cad51372e10dd7e5d0ba73efa3168119e4
BLAKE2b-256 checksum
How to use checksums
eacb1f3a88b6d0394679ea76c61c15382e7e463bc4b8ced307f6cc51f391e14d
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp312-cp312-win_amd64.whl
Size 39.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
3b743b6029d35d0da81005e9cbab9d0c67335153da8206eaba2178750cb1a7da
BLAKE2b-256 checksum
How to use checksums
42f6651de1b828c85b81f48e7f0bf6426ecb6e6eecb02e62f76754ef63537c1c
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4125d2bd7cefa4b1494265e2639daf1bc4076cb4840da5e62d8be9fa4774f807
BLAKE2b-256 checksum
How to use checksums
81c5994d07540665344f588487d3a0d750f710b7360c79f4c0648b308d9dc76f
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp312-cp312-macosx_14_0_arm64.whl
Size 15.4 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
58f8b19047ab26ecc528ebf551d26097fd12e8ed8d5b495b04c0485d710c9ea9
BLAKE2b-256 checksum
How to use checksums
eb545141f94b7cf67c4222303776bad27fec57e6bf6e2425c5ee8caab0bbddf2
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp311-cp311-win_amd64.whl
Size 39.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
ebc890677b194b852b7631646d886673471352b0d47ecd3ce8ca9dd8fbce6c1a
BLAKE2b-256 checksum
How to use checksums
ab191a322081133129eb2af4630c03aa9733e76f73251f8ba25a37ce8a0ea397
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2a19b29f02ce8f6b04dc9b4c032a9dc7bdcf3716bf8c2098a58000f35a638083
BLAKE2b-256 checksum
How to use checksums
06ccb3effd496223f4b02235f07fbdb75ef5700bdc5927189906254c987cdab5
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp311-cp311-macosx_14_0_arm64.whl
Size 15.4 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
dcbf766ee3fe7af51dc106ac898387998ae39d3297e6d04cce6a3a780a870ac8
BLAKE2b-256 checksum
How to use checksums
4231df3fd0c14465fa68fdff1601e4ec016bedc6a44d513424c0e6c00ade74dd
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp310-cp310-win_amd64.whl
Size 39.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5f0d5d18f33b5be9d4866f4fbc0af0e246691d421120cc28b610313f8e78f519
BLAKE2b-256 checksum
How to use checksums
350074bf578a859ffab6d707313f8a2995f0c5736aeb2b03dc683ecc6043358f
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dcadcf90da4d05f55963abd1fc53dd30b4f047b43a0a146ca13343d99a583bf3
BLAKE2b-256 checksum
How to use checksums
0e9b0ea9635528923f3ef51427ade100f1971799740fe1b97f96504dc64da503
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 5, 2026.

Transparency log

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

Download URL scinumtools3-0.9.1-cp310-cp310-macosx_14_0_arm64.whl
Size 15.4 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
addccf1e81d58f44d57fee836bb8bf2a536c33d18e1122e77f3963e0d8aafbb8
BLAKE2b-256 checksum
How to use checksums
320721d5b8680ea79b7f8d845e16c8eee2e88bbaa5ff0bd78b6492cd4ff8537f
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 5, 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