Skip to main content

More types for Python.

Project description

Typhe

PyPI version Python Version License

Typhe is a lightweight Python library that extends Python's type system with additional integer and string types, as well as structures (struct) to make your code safer and more explicit.


🔹 Supported Types

  • char
  • sint8
  • uint8
  • sint16
  • uint16
  • uint32
  • sint32
  • uint64
  • sint64
  • struct

⚡ Additional Types

  • mint – Limited integer type
  • mstr – Limited string type

📦 Requirements

  • Python >= 3.8
  • setuptools >= 42
  • wheel

⚙️ Installation

Install Typhe via pip:

pip install typhe

💡 Usage Example

from typhe import uint8, struct

class Calculator(struct):
    def __init__(self):
        super().__init__({
            "operator": str,
            "number1": uint8,
            "number2": uint8
        })

calculator = Calculator()
calculator(
    operator="+",
    number1=uint8(5),
    number2=uint8(10)
)

print(calculator.number1)  # Output: 5

🤝 Contributing

Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.


📝 License

Typhe is licensed under the MIT License. See the LICENSE file for details.

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

typhe-2025.0.2.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

typhe-2025.0.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file typhe-2025.0.2.tar.gz.

File metadata

  • Download URL: typhe-2025.0.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for typhe-2025.0.2.tar.gz
Algorithm Hash digest
SHA256 7e3cc80d3dc0f9d8d4e90991c6bae319bb6fde1933137916ff1ff6b485df4a47
MD5 8fa2499b08dc44f84b52f573213b445a
BLAKE2b-256 1f0b30fdfa9d8ba866710339f9492c59b930d47660caf0c47984eb35ee9820c8

See more details on using hashes here.

File details

Details for the file typhe-2025.0.2-py3-none-any.whl.

File metadata

  • Download URL: typhe-2025.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for typhe-2025.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a9d6f251a9b6dc3d72d2087fb14bf41b3aaa2994cfc03461b730f84f16616be
MD5 287f67fa08dcf1488ac56e083d386362
BLAKE2b-256 d99c20aa4ff871338b59ae4041a61c25bbb22d09dbad6f56c221ddc547e1a439

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