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_propertyto 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
class Params1:
@var_property
def l(self): return ...#[]
@paramize(Params1())
def f1():
"""f1"""
return
f1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6479bb4e734f0a8121289f86652a74bf3fe2a2ef5df167ca02da3ca4d9fe14aa
|
|
| MD5 |
96965072a498cbfc156b283e59557c39
|
|
| BLAKE2b-256 |
f408052390b30b39be85493823ee71a8552850b5851608dd1e9aba6d09aeaf5c
|
Provenance
The following attestation bundles were made for obj2sig-2025.12.11.tar.gz:
Publisher:
python-publish.yml on majidaldo/obj2sig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obj2sig-2025.12.11.tar.gz -
Subject digest:
6479bb4e734f0a8121289f86652a74bf3fe2a2ef5df167ca02da3ca4d9fe14aa - Sigstore transparency entry: 741844765
- Sigstore integration time:
-
Permalink:
majidaldo/obj2sig@cd6e08d9599163b2204c3aa9495d4a81638156ec -
Branch / Tag:
refs/heads/main - Owner: https://github.com/majidaldo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cd6e08d9599163b2204c3aa9495d4a81638156ec -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81fe7b286acc792e5938a5a1570398e5fab752fd4c866cfaeafd3303a6cf3cc8
|
|
| MD5 |
91cff33c4d07fbefffb009529805281e
|
|
| BLAKE2b-256 |
ce45ba6174c8906dd509697ca946538ab3805116b07500df770ebc3c5a6e1bb4
|
Provenance
The following attestation bundles were made for obj2sig-2025.12.11-py3-none-any.whl:
Publisher:
python-publish.yml on majidaldo/obj2sig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obj2sig-2025.12.11-py3-none-any.whl -
Subject digest:
81fe7b286acc792e5938a5a1570398e5fab752fd4c866cfaeafd3303a6cf3cc8 - Sigstore transparency entry: 741844778
- Sigstore integration time:
-
Permalink:
majidaldo/obj2sig@cd6e08d9599163b2204c3aa9495d4a81638156ec -
Branch / Tag:
refs/heads/main - Owner: https://github.com/majidaldo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cd6e08d9599163b2204c3aa9495d4a81638156ec -
Trigger Event:
push
-
Statement type: