Skip to main content

Function Signature Dependencies

Project description

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):

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obj2sig-2025.12.11.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obj2sig-2025.12.11-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file obj2sig-2025.12.11.tar.gz.

File metadata

  • Download URL: obj2sig-2025.12.11.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for obj2sig-2025.12.11.tar.gz
Algorithm Hash digest
SHA256 6479bb4e734f0a8121289f86652a74bf3fe2a2ef5df167ca02da3ca4d9fe14aa
MD5 96965072a498cbfc156b283e59557c39
BLAKE2b-256 f408052390b30b39be85493823ee71a8552850b5851608dd1e9aba6d09aeaf5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for obj2sig-2025.12.11.tar.gz:

Publisher: python-publish.yml on majidaldo/obj2sig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obj2sig-2025.12.11-py3-none-any.whl.

File metadata

  • Download URL: obj2sig-2025.12.11-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for obj2sig-2025.12.11-py3-none-any.whl
Algorithm Hash digest
SHA256 81fe7b286acc792e5938a5a1570398e5fab752fd4c866cfaeafd3303a6cf3cc8
MD5 91cff33c4d07fbefffb009529805281e
BLAKE2b-256 ce45ba6174c8906dd509697ca946538ab3805116b07500df770ebc3c5a6e1bb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for obj2sig-2025.12.11-py3-none-any.whl:

Publisher: python-publish.yml on majidaldo/obj2sig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page