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.

Quantity-aware NumPy operations include np.add, np.sqrt, and np.sum over all elements. Quantity ** exponent and scinumtools3.puq.sqrt(quantity) also preserve units. The sum keeps the quantity's units and adds absolute uncertainties linearly. Use .to_numpy() or .value(numpy=True) when you explicitly want a plain NumPy array without units.

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

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.14
File Size Uploaded Provenance Actions
scinumtools3-0.9.14.tar.gz 36.8 MB With provenance Details for scinumtools3-0.9.14.tar.gz

Built distributions (wheels)

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

Total release size: 395.8 MB

Release files / scinumtools3-0.9.14.tar.gz

Download URL scinumtools3-0.9.14.tar.gz
Size 36.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2c42098a000ebf46e94c69c31e0745aea2286205e4ab15394d9ac10409145a5d
BLAKE2b-256 checksum
How to use checksums
3e1ea378b78cc46985182b001bff674235349c68ebb946278fb4022f8a64c0dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp313-cp313-win_amd64.whl
Size 51.4 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ea91b73923706fa73f5e476119941c16189881b76ba9902cf4e051d0f68fe65a
BLAKE2b-256 checksum
How to use checksums
001b34b3c5b3008627fda801d7b913f218c56b27a1a9c0602481a2d16d17585b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp313-cp313-manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
68caf32ae9e236fead906210a48af36b7495e5731fb52ef0ae36796ecf412e4c
BLAKE2b-256 checksum
How to use checksums
00e549437ee6b3e57d28fe601087f3ec08c7cae7516b843cd956934dee2cb7cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Release files / scinumtools3-0.9.14-cp313-cp313-macosx_15_0_arm64.whl

Download URL scinumtools3-0.9.14-cp313-cp313-macosx_15_0_arm64.whl
Size 17.6 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
aead58c704fc0980d78bad398d928ae6db41154bf95690bb839617d684b939e3
BLAKE2b-256 checksum
How to use checksums
2495ebc850db8f36f4b36ece8fecde7850907db343a58286e209d9d21ebbb9ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp312-cp312-win_amd64.whl
Size 51.4 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f2616479da5dad39704150fdfc12dc7a6d4e0d53a4ebf6af5de98fac8e11bcf2
BLAKE2b-256 checksum
How to use checksums
74427f7eabff461239bbc14c3bea5cde17035163b45704a8fdd857059afbff06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp312-cp312-manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dfb8ea3a370b5c34f457387306e8bc4d2ebe58f9d316c36cc73baeef4df27582
BLAKE2b-256 checksum
How to use checksums
a29d60393585ce4ce9755da5ac8f6c9260381abdd764c4785258fa4e7df7266e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Release files / scinumtools3-0.9.14-cp312-cp312-macosx_15_0_arm64.whl

Download URL scinumtools3-0.9.14-cp312-cp312-macosx_15_0_arm64.whl
Size 17.6 MB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
ecc645d3c68a2e2fee2270ba952cd635c7a6de1e1ddb5bcc62d110db98c8ef9a
BLAKE2b-256 checksum
How to use checksums
74e15a78b295432b099b1d667a2960205523bf18b3e9b0b9e783260fc6a8b831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp311-cp311-win_amd64.whl
Size 51.4 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
8011a8f802ad19d895e8d44d0a05129fd5455724e78d3e18c8c88c89b4066acf
BLAKE2b-256 checksum
How to use checksums
e935c8c645d12a59e746a83802a7ce9f2e1ca35261e102c8ed1ab2111fa9c36b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp311-cp311-manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
508bd903d007fa1925676e1d4a5d42d74ce987787e056b94fa28e7a6db5e3232
BLAKE2b-256 checksum
How to use checksums
1eedee193a062e745ffb66ee1d8651b9cbf0a41e19e8d27d964e4429d1961016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Release files / scinumtools3-0.9.14-cp311-cp311-macosx_15_0_arm64.whl

Download URL scinumtools3-0.9.14-cp311-cp311-macosx_15_0_arm64.whl
Size 17.6 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
d36d9756d96f2937b3375b000bde0578b1f4026fc9477bdd0af7126ea0dad559
BLAKE2b-256 checksum
How to use checksums
143e902515b14d6cee49589e81494f4f0c6919b0190614ac27481f461a44299a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp310-cp310-win_amd64.whl
Size 51.4 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5698af6c6dbbb89150d7b58e812ec34748a9dec60c191b72d4407f3f28707110
BLAKE2b-256 checksum
How to use checksums
e2c0a296c42858dc900364261420c72a9f1c726511d30ea84e715de4b1b06640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

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

Download URL scinumtools3-0.9.14-cp310-cp310-manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a57f21c44ea93643a8a025ce415111315d8e9ef0e9c2cf5b15a0e823c6f8d86e
BLAKE2b-256 checksum
How to use checksums
ae698f5c8c2984a6ffe93e0aab29d953db146b928e2254d204395d80fedf1152
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Release files / scinumtools3-0.9.14-cp310-cp310-macosx_15_0_arm64.whl

Download URL scinumtools3-0.9.14-cp310-cp310-macosx_15_0_arm64.whl
Size 17.6 MB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
d3bd72614bee2498d8681471e1f6dffe03fe636b8471f873cd55c85bfca2a4c2
BLAKE2b-256 checksum
How to use checksums
f4adb202fd6eabe0898205699abeff5b831d2b6ab990ec1814cee10decab3c20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Security for scinumtools3 0.9.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.

Full provenance

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for scinumtools3-0.9.14.tar.gz

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 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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