argscall
argscall is python library that can be used to call functions while mapping and validating dynamic input arguments «*args or **kwargs» using the function arguments signature.
Usage
from argscall import argsCaller
# A simple function that requires one argument
def do_something(name):
print(name.upper())
# Call the function passing a list with arguments
argscall(do_something, "a").call()
It becomes more usefull when used with dynamic input arguments, e.g command line arguments:
# test.py
import sys
from argscall import argsCaller
# A sample function that requires an argument
def do_something(name):
print(name.upper())
# Call the function passing the command line arguments
argsCaller(do_something, *sys.argv[1:]).call()
Testing different use cases
$ python test.py Joe
JOE
$ python test.py
Traceback (most recent call last)
...
argscall.exceptions.MissingArgument: Missing required argument: name
$ python test.py Joe Black
Traceback (most recent call last)
...
argscall.exceptions.TooManyArgument: Got more arguments than expected (value: 'Black')
Metadata
Release files for argscall 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| argscall-0.0.2.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| argscall-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / argscall-0.0.2.tar.gz
| Download URL | argscall-0.0.2.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a57024ec45dd7ce319c0110c19f3bdf203bfb6e6927affb778a0b3dee10a00f
|
|
BLAKE2b-256 checksum How to use checksums |
20c3598b533ef6c4deb2a10861cdd1908dcb89fc2b18bf1498eda63a1de17de8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Release files / argscall-0.0.2-py3-none-any.whl
| Download URL | argscall-0.0.2-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
875f84451d891f2e6f01275e05a7dd1e93d1880a24367011652b5f321a4707e4
|
|
BLAKE2b-256 checksum How to use checksums |
4ff8689520aa2afb55ab4ea3e06e96942485897ad13643ab87ba91a94aba8cc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|