arglabels
A simple decorator to enable Swift-like argument labels for Python functions.
It re-labels certain keyword arguments, so that your function parameters can have an external and an internal name like argument labels and parameter names in Swift.
Installation
Install from PyPI with:
pip install arglabels
Usage
If you have a function like the following:
def invite(name, activity):
return f"Hey {name}! Would you like to go {activity}?"
When calling that function it would be nice to have a syntax that almost reads like plain english, for example:
invite("Alex", to_go="fishing")
You can achieve this with the arglabels decorator, by using it on the function definition like so:
from arglabels import arglabels
@arglabels(activity="to_go")
def invite(name, activity):
return f"Hey {name}! Would you like to go {activity}?"
Metadata
Release files for arglabels 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| arglabels-0.0.6.tar.gz | 1.8 kB | Without provenance | Details for arglabels-0.0.6.tar.gz |
Release files / arglabels-0.0.6.tar.gz
| Download URL | arglabels-0.0.6.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f95feb2ae04a7196745890b909c0c64fede523044cf1f303a9cbd9d1fe6c211
|
|
BLAKE2b-256 checksum How to use checksums |
f8e60be5ab8b6a32e51d202b3bbcce4d982517f75f90c5db39f1f9c86d9c2888
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.7
|
Security for arglabels 0.0.6
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.