Skip to main content

shorten-func

Reduce to pass the same parameters multiple times when calling a function multiple times

def shorten_func(func_name, *args_global, **kwargs_global)
:param func_name: the function name
:param args_global: arguments passed repeatedly
:param kwargs_global: keyword arguments passed repeatedly
:return: The same function but it requires fewer parameters

#####Installation: https://pypi.org/project/shorten-func/

pip install shorten-func

#####Usage:

def long_function(variable_passed_repeatedly, variable):
    return variable_passed_repeatedly + variable

before:

value_1 = long_function(variable_passed_repeatedly, 'var_1'')
value_2 = long_function(variable_passed_repeatedly, 'var_2')

after:

from shorten_func import shorten_func
get = shorten_func(long_function, variable_passed_repeatedly)
value_1 = get('var_1')
value_2 = get('var_2')

#####Example:

def set_child_full_name(family_name, child_first_name):
    return child_first_name + family_name

before:

child_1 = set_child_full_name('family_name', 'Messi')
child_2 = set_child_full_name('family_name', 'Ronaldo')

after:

from shorten_func import shorten_func
get = shorten_func(set_child_full_name, 'family_name')
child_1 = get('Messi')
child_2 = get('Ronaldo')

Metadata

Release files for shorten-func 0.1.1

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

Source distribution (sdist)

Source distribution for shorten-func 0.1.1
File Size Uploaded Provenance
shorten-func-0.1.1.tar.gz 1.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shorten-func 0.1.1
File Interpreter ABI Platform
shorten_func-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 kB

Release files / shorten-func-0.1.1.tar.gz

Download URL shorten-func-0.1.1.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a5696ccb3684b1489c426a82ab308fb21ecb4258b559f02b60e02e4f80cdc48c
BLAKE2b-256 checksum
How to use checksums
16193f8426fdc9d8ff56844336906caa9e6d15898677fc968fd83370fe735743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

Release files / shorten_func-0.1.1-py3-none-any.whl

Download URL shorten_func-0.1.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aff58eb1c5c41f3fdac87c23cd967d65fc37fa89f04efee8c5682432a99f12a5
BLAKE2b-256 checksum
How to use checksums
f8f80b72c5ccccbc043a40c85a035e63ec896fe5fb4a2f4001267845514000af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

Security for shorten-func 0.1.1

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.

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