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 GPL3 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.3.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.3-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: typhe-2025.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 0c911cb7ed8a4da9619714ed5cb8a9e7b8a453810bbd2034d2dd1f09c61e53f0
MD5 f9861af261920d0ff4370122cef52882
BLAKE2b-256 96b6aafa18b75b9ae655f1aa0e00142f209a2b2987e2c73cc18c3c8968fbe4d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typhe-2025.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0b0e8e246e42dc57507a9d5506267b04ca0dc7495255ef7ac3c5d5325a1493
MD5 9bef2208a2913d8f2eae98299f637846
BLAKE2b-256 134f5564b9f40ee8f568b9b8622f064ea28fd4baf8f0ce8f555e186367502aa1

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