Skip to main content

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:

  1. Fork the repo
  2. Create your branch
  3. 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

underpyx-0.2.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

underpyx-0.2.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file underpyx-0.2.1.tar.gz.

File metadata

  • Download URL: underpyx-0.2.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.13

File hashes

Hashes for underpyx-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5024d4654513807dfa2b247492f98296ef95fdc74ed8c90dc986c6a514691091
MD5 63cca74647e003040e1e10d89d3af637
BLAKE2b-256 51c19794b13635210edf3ca42d312be8399034933c525d5dbd457c2d4c407368

See more details on using hashes here.

File details

Details for the file underpyx-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: underpyx-0.2.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.13

File hashes

Hashes for underpyx-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0408f24517747c8d831d479dd1ed562a2633479c56487fdd91c52daa78ec05c8
MD5 9e56da86090aecba39ecbc9a705f85bb
BLAKE2b-256 36da8f075be7bf92b38cf26a91c03378985cae84f3ea90eeba66ab15360e5132

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page