Skip to main content

Fundamental utilities in python, such as encapsulation, immutability, service patterns, and JSON typing in Python.

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 (local development):

pip install git+https://github.com/ariana126/underpy.git

🚀 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. EOF

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for underpyx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 67b41a6786fc0dad44116929f7623b9ebd55eba74171bbd31c4f5219ddccb4e5
MD5 5dece9350e8c8e57682b75303abe64d8
BLAKE2b-256 5b2d90cdcdf07f77e32c3b42d8393922b251bc4c49bfef775baf48fadbef6caf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: underpyx-0.1.0-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.12.3

File hashes

Hashes for underpyx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3979e27873500b25307f2dff59d594320342e2ff10ccf6d8ee9fe26c333405a
MD5 07d64c96ed6c73ae4cfee7ed47d6006f
BLAKE2b-256 a19ee6d62879d63e59346e0aa0869eb85c0c8cda0cfb0ea355cfb2337e6e832c

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