This project has been archived by its maintainers, and is no longer receiving any updates.
Python Callabletoolx
Advanced tools for callable objects in Python.
About The Project
Provides advanced tools for callable objects in Python 3.x.
Built With
Getting Started
To get a local copy up and running follow these simple example steps.
Prerequisites
- Python-lib ArumanSignature, has been used for argument models.
Installation
- Clone the repo
git clone https://github.com/TahsinCr/python-callabletoolx.git
- Install PIP packages
pip install callabletoolx
Usage
Let's try to retrieve a callable object's arguments, argument count, return result, and the arguments with their given values.
from callabletoolx import (
get_arguments, get_argument_length, get_return_argument, get_argument_values
)
def item_to_string(key1:str, key2, start:str='-', *keys, sep:str=', ', **items:int) -> str:
items = [f'{k}:{v}' for k, v in items]
return start + sep.join([key1, key2, *keys, items])
func_args = ['test1', 'test2', '--', 'test3']
func_kwargs = {
'ex' : 'test4'
}
arguments = get_arguments(item_to_string)
print("FuncArgs:", *arguments, sep='\n', end='\n\n')
print("FuncArgLength: {}".format(get_argument_length(item_to_string)), end='\n\n')
print("FuncReturnArg: \n{}".format(get_return_argument(item_to_string)), end='\n\n')
print(
"FuncArgValues:",
*get_argument_values(arguments, func_args, func_kwargs),
sep='\n', end='\n\n'
)
Output
FuncArgs:
Argument(name: key1, type: <class 'str'>, default: Ellipsis, argtype: ARG)
Argument(name: key2, type: typing.Any, default: Ellipsis, argtype: ARG)
Argument(name: start, type: <class 'str'>, default: Ellipsis, argtype: ARG)
Argument(name: keys, type: typing.Any, default: Ellipsis, argtype: ARGS)
Argument(name: sep, type: <class 'str'>, default: ', ', argtype: ARG)
Argument(name: items, type: <class 'int'>, default: Ellipsis, argtype: KWARGS)
FuncArgLength: 6
FuncReturnArg:
Argument(name: return, type: <class 'str'>, default: Ellipsis, argtype: RETURN)
FuncArgValues:
ArgumentValue(name: key1, type: <class 'str'>, default: Ellipsis, argtype: ARG, value: 'test1')
ArgumentValue(name: key2, type: typing.Any, default: Ellipsis, argtype: ARG, value: 'test2')
ArgumentValue(name: start, type: <class 'str'>, default: Ellipsis, argtype: ARG, value: '--')
ArgumentValue(name: keys, type: typing.Any, default: Ellipsis, argtype: ARGS, value: ['test3'])
ArgumentValue(name: sep, type: <class 'str'>, default: ', ', argtype: ARG, value: ', ')
ArgumentValue(name: items, type: <class 'int'>, default: Ellipsis, argtype: KWARGS, value: {'ex': 'test4'})
For more examples, please refer to the Documentation
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Tahsin Çirkin - @TahsinCrs - TahsinCr@outlook.com
Project: TahsinCr/python-callabletoolx
Metadata
Release files for callabletoolx 1.0.1
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 |
|---|---|---|---|---|
| callabletoolx-1.0.1.tar.gz | 4.9 kB | Without provenance | Details for callabletoolx-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| callabletoolx-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for callabletoolx-1.0.1-py3-none-any.whl |
Total release size: 9.8 kB
Release files / callabletoolx-1.0.1.tar.gz
| Download URL | callabletoolx-1.0.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbf3f14cee473b053c204e9e89184110c1e18c44619ed0d4470f2442d5cc5dc8
|
|
BLAKE2b-256 checksum How to use checksums |
eaa917d12075b510984cd42d25cd290deaf3a4cbb7efca56b78bd2a3ea0b59b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / callabletoolx-1.0.1-py3-none-any.whl
| Download URL | callabletoolx-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c3f2bcd23fac56dd32f0ab33528b2a06161022e37ff1b499d89a54de5a48c58
|
|
BLAKE2b-256 checksum How to use checksums |
6fa30edda29635770650dc9b37912178c1a638fab60c9749a06a7d3bf99344da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for callabletoolx 1.0.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.