Fundamental utilities in python, such as encapsulation, immutability, service patterns, and JSON type hinting.
Project description
underpy 🐍
Reusable Python base classes for clean, maintainable, and scalable projects.
Underpy provides foundational building blocks such as encapsulated data, immutable objects, service patterns, and JSON typing — so you can start every new project with a solid, consistent architecture.
✨ Features
- Encapsulated – Hide internals and expose clean public APIs
- Immutable – Prevent changes to objects after initialization
- Service Class (Singleton) – Enforce a single point of access for core services
- JSON Type – Typed JSON data handling made easy
- Tested with Pytest + AssertPy – Reliable and expressive tests
📦 Installation
Install from source:
pip install git+https://github.com/ariana126/underpy.git
or PyPI
pip install underpyx
🚀 Quick Start
Example: Encapsulated
from underpy import Encapsulated
class User(Encapsulated):
def __init__(self, username):
self._username = username
def get_username(self):
return self._username
user = User("ariana")
print(user.get_username()) # ✅ "ariana"
# Direct access is avoided: user._username
Example: Immutable
from underpy import Immutable
class Config(Immutable):
def __init__(self, host, port):
self.host = host
self.port = port
cfg = Config("localhost", 8080)
# cfg.port = 9000 # ❌ Raises AttributeError
🧪 Running Tests
pytest
📄 License
This project is licensed under the MIT License – see the LICENSE file for details.
🤝 Contributing
Contributions are welcome!
If you have an improvement or find a bug:
- Fork the repo
- Create your branch
- Submit a pull request
💡 About
This project is part of a personal utility toolkit used to maintain a consistent, clean architecture across Python projects.
Originally authored by Ariana.
Project details
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 underpyx-0.3.1.tar.gz.
File metadata
- Download URL: underpyx-0.3.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f8b8fb95a767eb30a7a0935dea865e0d344f66ec48bf4939df5bb32bff0733
|
|
| MD5 |
b5abd0ebe145914b772ccfb6e2cde972
|
|
| BLAKE2b-256 |
3241ff835785edfef44b1d0830cc33c99c4bc1f64d903662eebca02ccfd4a106
|
File details
Details for the file underpyx-0.3.1-py3-none-any.whl.
File metadata
- Download URL: underpyx-0.3.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c727c843e397426aea2fbf1376bb68e8f7991bf7121f538ce4cc06c7a536e68f
|
|
| MD5 |
1e33bc454d8352202e80d9ae33e1733c
|
|
| BLAKE2b-256 |
3d7a322f3c9a3e9f6f296b9698173556318dc8b56bf3472e83f6f1b62b41e829
|