Skip to main content

obj2sig

Use Python objects to define function signatures.

Why?

To programmatically encode relationships between function arguments. Other benefits follow from treating parameters as object properties such as documentation.

How?

Use objects for encoding relationships between arguments. Use a decorator to dynamically create a function.

from obj2sig import paramize, var_property
help(paramize)

Takes an object's property attributes to be used as function arguments as follows:

  • Function argument order will match the order in which the object properties are defined.
  • Property return values are taken as default values. Ellipsis, ..., indicates no default value.
  • Property return types are used as parameter types.
  • Use the special property name 'star' to mark keyword-only arguments.
  • Use var_property to mean a variable length argument.
class Params:
    @property
    def p(self) -> int: return ...
    _star_ = ''
    @property
    def z(self) -> str: return 'z'
    @property
    def a(self): return 'a'
    @var_property
    def k(self): return ...

@paramize(Params())
def f():
    """sdfsdf"""
    return
f
functionf
sdfsdf
def f(p: int, *, z: str = 'z', a='a', **k):
class Params1:
    @var_property
    def l(self): return ...#[]

@paramize(Params1())
def f1():
    """f1"""
    return

f1
functionf1
f1
def f1(*l):

Metadata

Release files for obj2sig 2025.12.11

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

Source distribution (sdist)

Source distribution for obj2sig 2025.12.11
File Size Uploaded Provenance Actions
obj2sig-2025.12.11.tar.gz 5.3 kB With provenance Details for obj2sig-2025.12.11.tar.gz

Built distribution (wheel)

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

Total release size: 8.8 kB

Release files / obj2sig-2025.12.11.tar.gz

Download URL obj2sig-2025.12.11.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6479bb4e734f0a8121289f86652a74bf3fe2a2ef5df167ca02da3ca4d9fe14aa
BLAKE2b-256 checksum
How to use checksums
f408052390b30b39be85493823ee71a8552850b5851608dd1e9aba6d09aeaf5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 4, 2025.

Transparency log

Release files / obj2sig-2025.12.11-py3-none-any.whl

Download URL obj2sig-2025.12.11-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81fe7b286acc792e5938a5a1570398e5fab752fd4c866cfaeafd3303a6cf3cc8
BLAKE2b-256 checksum
How to use checksums
ce45ba6174c8906dd509697ca946538ab3805116b07500df770ebc3c5a6e1bb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 4, 2025.

Transparency log

Security for obj2sig 2025.12.11

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for obj2sig-2025.12.11.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 Dec 4, 2025.

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