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.3.0.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.3.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for underpyx-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5f14d1e9831228023ce9859f375e69ee6d52c5d47db6be448c1408fc624d5f4b
MD5 1b631b512439ed945c7ab8106c02357b
BLAKE2b-256 98c4dfe87cff3cc9ee48bc189f8db2797d71add440ae758dee7f5a538b7ae187

See more details on using hashes here.

File details

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

File metadata

  • Download URL: underpyx-0.3.0-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.14

File hashes

Hashes for underpyx-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64814e89deac06228d683915f3142287fbcc3615f525ee971bf811f5e55f5703
MD5 5c47c3827ea9a67c821521a1bbb12d07
BLAKE2b-256 ff1525e70004b1a1ca3b2bc2a6b06a3d65af5f6cb97a343f4c9e3348da2dd32d

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