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.1.1.tar.gz (4.2 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.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: underpyx-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for underpyx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1c2e776b9983d8c0aa7f4142c661f11d585586bf68b5277948ef823ac89ce575
MD5 fc99036d35417b8c871c4cf2b6c04d9a
BLAKE2b-256 48dabea17fda1ffa998f2d94070562fd27ea2fddf9a24ca65ebe9ca7076ada4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: underpyx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73df2c0629d2d53a5bae9e0cc8149d3994f8f8ef5ad10781c0fe684bf9fc9dd4
MD5 0e16be4fdab8e015747a8650925ebdf5
BLAKE2b-256 ff9b7f7b3b4ad45c5f7fa38dc5e1f307a7c6188f9373215bf3adcbd9af3831b6

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