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

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

Built distributions (wheels)

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

Total release size: 327.5 MB

Release files / scinumtools3-0.9.2.tar.gz

Download URL scinumtools3-0.9.2.tar.gz
Size 31.6 MB
Tags Source
SHA-256 checksum
How to use checksums
a5b15ff5ae891d18bd607c66af1c97b3929db9722b7164235e4f5f729617b59e
BLAKE2b-256 checksum
How to use checksums
672e9ba8b18de84a36ebc36312cea2628d28aad0544026656755cb7608947214
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp313-cp313-win_amd64.whl
Size 40.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
704501fad18dc660dd8e90ca30ec7402fecbd31b63a24b58b9249c212f3cff0b
BLAKE2b-256 checksum
How to use checksums
5411437ffc7558e873a77dc5dfe95b3046dae88b5e849696b5b02be240339b24
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp313-cp313-manylinux_2_28_x86_64.whl
Size 17.6 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e0d10612bbfff13705607613654f253cb14b202cabd4c365b111609954826db4
BLAKE2b-256 checksum
How to use checksums
3b23eae97234f5dfebc77fd5679fdfaedfa34de0159f1b8c13406c47a2a456b5
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp313-cp313-macosx_14_0_arm64.whl
Size 15.7 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5f004fc30c23eb59ac7cc8d298141700e1e626396c3dbadadf746825080d6189
BLAKE2b-256 checksum
How to use checksums
20db34f2f5a6cac95391c203575248d8835f8c5788f85306172c2b75174f7b29
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp312-cp312-win_amd64.whl
Size 40.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
593d79fd6eb72a1307826f5e4323c39d68d5452082bfcff27c4aa600a291140d
BLAKE2b-256 checksum
How to use checksums
fef60d6d8a0e08be415b329c90bc9bc437c7a5ef32c0d7ac214d4fa39823efdb
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp312-cp312-manylinux_2_28_x86_64.whl
Size 17.6 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0b6aa5ad3f1c7bf30c8da2735f812a14e164c1bffe8155c41241687ca2455aaf
BLAKE2b-256 checksum
How to use checksums
429f8d0affac93a43a1863e9a5845f5cdc2c706322e987f1f9df2b7a7549588b
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp312-cp312-macosx_14_0_arm64.whl
Size 15.7 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b2652e7421d64fcf9083f5ffaf075429b1b01a2ebe1a917fa093108150a8f22b
BLAKE2b-256 checksum
How to use checksums
56c42b3c18ed1583ff8e650c5900ae6e5dbf0ae0b890e5c22b662607e07829b5
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp311-cp311-win_amd64.whl
Size 40.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
3450af441c69d3ccc914afa6c4be234dd7a2abddde325919054ad9f165d00d95
BLAKE2b-256 checksum
How to use checksums
818ea3ffacda2dbaff001c970782aefc77d8964af238febd33cd22822a2c9b84
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 17.6 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b2b7a9d453378f7f4e8bb01f24b20482c9446e6ef358de0823348186c6fea1f3
BLAKE2b-256 checksum
How to use checksums
f1d9e8380b5f6100215f01db710464264a4dfd8828855a4c2f6fc706ff179372
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp311-cp311-macosx_14_0_arm64.whl
Size 15.7 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
6ba5dceffadbb662838d351bf47aad3ca6759b31ed0afedd887c870c84a16d92
BLAKE2b-256 checksum
How to use checksums
82b0ef748a91a12be0783a28c0ebe0f67b738b8f52d154d28b9b2c8185d2a4ce
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp310-cp310-win_amd64.whl
Size 40.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
0150fcbfe4df7c8d646b27c3860e0050aa14bc365c78f9c2d3c7a6e7bbdbbbb6
BLAKE2b-256 checksum
How to use checksums
24fb7816fa6860f07ad22192a581ce69a4d51b5089ab7c3a22f5bd9feadd39e6
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 17.6 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f6fd5cc34b1a0b0985eee3ef6527bb9323edaf8437ff2416d1253b0eac875e40
BLAKE2b-256 checksum
How to use checksums
e6c3ad5ee0cf14b4fed37727e8d495344625cdedb1265ff1b73110345245db77
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 8, 2026.

Transparency log

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

Download URL scinumtools3-0.9.2-cp310-cp310-macosx_14_0_arm64.whl
Size 15.7 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
886de0e1675872acc3e192cbc8538dbe043d642297b1f5249b862d5465046765
BLAKE2b-256 checksum
How to use checksums
8d26cf22bd255e5593e48a058d1a32037f159ba0c73dd29538fd14ceb02f648c
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 8, 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