pyTooling is a powerful collection of arbitrary useful classes, decorators, meta-classes and exceptions.
Project description
pyTooling
pyTooling is a powerful collection of arbitrary useful classes, decorators, meta-classes and exceptions. It's useful for any Python-base project independent if it's a library, framework or CLI tool.
Introduction
TODO
Package Details
Common Classes
- pyTooling.CallByRef.*
Emulation of call-by-reference parameters. - pyTooling.Versioning.*
Class representations of semantic version (SemVer) and calendar version (CalVer) numbers.
Data Structures
- Trees
- Tree data structure
→ A fast and simple implementation using a singleNodeclass.
- Tree data structure
Decorators
- Documentation
@InheritDocString
→ Copy the doc-string from given base-class.
- Visibility
@export
→ Register the given function or class as publicly accessible in a module.
Exceptions
- EnvironmentException
... is raised when an expected environment variable is missing. - PlatformNotSupportedException
... is raise if the platform is not supported. - NotConfiguredException
... is raise if the requested setting is not configured.
Meta-Classes
- Overloading
→Overloadingallows method overloading in Python classes. It dispatches method calls based on method signatures (type annotations). - Singleton
→ A class created from meta-classSingletonallows only a single instance to exist. If a further instance is tried to be created, a cached instance will be returned. - SlottedType
→ All type-annotated fields in a class get stored in a slot rather than in__dict__. This improves the memory footprint as well as the field access performance of all class instances. The behavior is automatically inherited to all derived classes.
Packaging
tbd
Examples
@export Decorator
from pyTooling.Decorators import export
@export
class MyClass:
pass
CallByRefIntParam
from pyTooling.CallByRef import CallByRefIntParam
# define a call-by-reference parameter for integer values
myInt = CallByRefIntParam(3)
# a function using a call-by-reference parameter
def func(param: CallByRefIntParam):
param <<= param * 4
# call the function and pass the wrapper object
func(myInt)
print(myInt.Value)
Contributors
- Patrick Lehmann (Maintainer)
- Sven Köhler
- and more...
License
This Python package (source code) licensed under Apache License 2.0.
The accompanying documentation is licensed under Creative Commons - Attribution 4.0 (CC-BY 4.0).
SPDX-License-Identifier: Apache-2.0
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 pyTooling-2.1.1.tar.gz.
File metadata
- Download URL: pyTooling-2.1.1.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f949bebc354f2183cc3e14d21f50149b8cb59d8ee2d6b74d5ea349719f3b9432
|
|
| MD5 |
7d7386547ed7bffd8a51fdfdcec18718
|
|
| BLAKE2b-256 |
36f4b78659b3b271e42be3110db55198649838efb74785015f2fbf64ab47830c
|
File details
Details for the file pyTooling-2.1.1-py3-none-any.whl.
File metadata
- Download URL: pyTooling-2.1.1-py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
898ab8c750b827c25cdb70e1627785473507243664ffca757694bd1b3b5198e3
|
|
| MD5 |
aeafb8646aade7b9e6018040095ec35e
|
|
| BLAKE2b-256 |
0e9b3f5d2c12c51445f3da8c0f3778adb95c76d234f55420f73004ace0f906e2
|