Metadata-Version: 2.4
Name: python-technical-primitives
Version: 0.1.0
Summary: General-purpose Python utilities (datetime, text, patterns)
Author-email: GridFlow Team <vialogue@proton.me>
License: MIT
Project-URL: Homepage, https://github.com/firstunicorn/python-web-toolkit
Project-URL: Repository, https://github.com/firstunicorn/python-web-toolkit
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: hypothesis>=6.92.0; extra == "dev"

# python-technical-primitives

General-purpose Python utilities (datetime, text, patterns).

## Installation

```bash
pip install python-technical-primitives
```

## Usage

### Datetime Utilities

```python
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

```python
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

```python
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






