python-technical-primitives
General-purpose Python utilities (datetime, text, patterns).
Installation
pip install python-technical-primitives
Usage
Datetime Utilities
from python_technical_primitives.datetime import utc_now, add_days, is_expired
now = utc_now()
future = add_days(now, 7)
expired = is_expired(now) # False
Text Utilities
from python_technical_primitives.text import to_snake_case, sanitize_filename
snake = to_snake_case("HelloWorld") # "hello_world"
safe = sanitize_filename("my file?.txt") # "my_file.txt"
Specification Pattern
from python_technical_primitives.patterns import Specification
class AdultSpec(Specification[User]):
description = "User must be 18+"
def is_satisfied_by(self, user):
return user.age >= 18
class VerifiedSpec(Specification[User]):
description = "User must be verified"
def is_satisfied_by(self, user):
return user.verified
# Combine specifications
spec = AdultSpec() & VerifiedSpec()
if spec(user):
print("User is adult and verified")
else:
print(f"Errors: {spec.errors}")
Features
- ✅ Zero dependencies
- ✅ Framework-agnostic
- ✅ Type-safe
- ✅ Well-tested utilities
License
MIT
Metadata
Release files for python-technical-primitives 0.1.0
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 |
|---|---|---|---|---|
| python_technical_primitives-0.1.0.tar.gz | 5.8 kB | Without provenance | Details for python_technical_primitives-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_technical_primitives-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for python_technical_primitives-0.1.0-py3-none-any.whl |
Total release size: 12.8 kB
Release files / python_technical_primitives-0.1.0.tar.gz
| Download URL | python_technical_primitives-0.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c333450c9a39363a32e5833bfd8e2056ffba305aa63b61533a4ac7cf718826d1
|
|
BLAKE2b-256 checksum How to use checksums |
a40709b88fa62a5f75abe02a87d9f6c135318cd0efebaccf44bd7792abfee629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / python_technical_primitives-0.1.0-py3-none-any.whl
| Download URL | python_technical_primitives-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3837461c53cd6c75144dc532dd04ec5655c1aa5ac34c142230928bc66498fc3
|
|
BLAKE2b-256 checksum How to use checksums |
d9042f8d4d4a8daf111716bb10bff00184c5d2bf0478067eaca40faf48075986
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for python-technical-primitives 0.1.0
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.