Skip to main content

Function Signature Dependencies

Project description

obj2sig

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.10.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.10-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: obj2sig-2025.12.10.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.10.tar.gz
Algorithm Hash digest
SHA256 823c80aee5db66f6e0bd0c24f317e27f8e677b1742c3b869fa94f4e338a50793
MD5 446679901eeef0c2bdbafbe6ca087204
BLAKE2b-256 68d9734f5adfa752cc69e168ba8502c0b21207bcd4c9f8fb39ff826f4122cbc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for obj2sig-2025.12.10.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.10-py3-none-any.whl.

File metadata

  • Download URL: obj2sig-2025.12.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 57d4b87b15ee6f789f7584c1c0da80cf54c11a96a44d689b57a2ef276c64b715
MD5 709eb318470c75ee65b3460128bb47fa
BLAKE2b-256 9c9b66e0a2a8f4a5938cb3c97d61d52461c7d936aa831d948603444b30ab1033

See more details on using hashes here.

Provenance

The following attestation bundles were made for obj2sig-2025.12.10-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