Skip to main content

paramtrack

PyPI Tests Documentation

Remembers the arguments of each method's last call, defaults included.

Install

pip install paramtrack

Usage

from paramtrack import track_class

@track_class
class Telescope:
    def observe(self, target, exposure=30, filter="V"):
        ...

telescope = Telescope()
telescope.observe("Vega", exposure=60)

print(telescope.parameters)
observe
├─ target   = 'Vega'
├─ exposure = 60
└─ filter   = 'V'

In Jupyter, put telescope.parameters on the last line of a cell for a foldable view.

Forwarded **kwargs

When a method passes its **kwargs on to another function, the parameters of that function are listed too, defaults included:

def observe(target, exposure=30, filter="V"):
    ...

@track_class
class Telescope:
    def run(self, **kwargs):
        return observe("Vega", **kwargs)

telescope = Telescope()
telescope.run(exposure=60)

print(telescope.parameters)
run
├─ exposure = 60
└─ filter   = 'V'

This works through chains of **kwargs and for calls like self.method(**kwargs) or module.function(**kwargs). The source code has to be available: in a plain python shell, only the passed keywords are shown.

Functions

track_function does the same for plain functions and stores the arguments as function.parameters. Before the first call, it shows the defaults, with ? for arguments that have none:

from paramtrack import track_function

@track_function
def observe(target, exposure=30, filter="V"):
    ...

print(observe.parameters)
observe
├─ target   = ?
├─ exposure = 30
└─ filter   = 'V'

After a call such as observe("Vega"), the values of that call are shown instead.

Development

Run the tests:

uv run pytest

Build the docs into docs/_build/html:

uv run --with-requirements docs/requirements.txt sphinx-build docs docs/_build/html

Metadata

Release files for paramtrack 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paramtrack 0.3.0
File Size Uploaded Provenance
paramtrack-0.3.0.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for paramtrack 0.3.0
File Interpreter ABI Platform
paramtrack-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / paramtrack-0.3.0.tar.gz

Download URL paramtrack-0.3.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0a6dc52e80fcb3331eadb1b51d8c72ebfdde5612443281f8c7410489a5a9965e
BLAKE2b-256 checksum
How to use checksums
3325d6c00ae882ffb50e51b1592d08940ca894e528e3a3ca32b982ede4850224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Nobara Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / paramtrack-0.3.0-py3-none-any.whl

Download URL paramtrack-0.3.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a475929d1057f0801ba3b398a803b88a6a836075f05b668284deeb06036065b
BLAKE2b-256 checksum
How to use checksums
0329f2e7431d12dfcb4d8792597e777ee4b867a73a08f524c5ce233b22d28da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Nobara Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for paramtrack 0.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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