Skip to main content

TyperX

TyperX is a library for extending Typer with features useful in Machine Learning applications, including:

  • Basic dataclass type support [x]
  • Basic union type support [x]
  • Recursive dataclass type support [x]
  • pydantic model support [ ]

Installation

Install TyperX using pip:

pip install agentx

Usage Example

Create a file named main.py:

from dataclasses import dataclass
from typing import Union


@dataclass
class Data:
    hi: int = 1
    ho: Union[int, str] = 1


def main(data: Data):
    print(data)


if __name__ == "__main__":
    import typer
    from typerx import with_dataclass

    typer.run(with_dataclass(main))

Run the script and check the help message:

python main.py --help

You should see output similar to this:

 Usage: main.py [OPTIONS]

 a simple demo

╭─ Options ───────────────────────────────────────────────────────────────────────╮
│ --data.hi        INTEGER           [default: 1]                                 │
│ --data.ho        UNION[INT, STR]   [default: 1]                                 │
│ --help                             Show this message and exit.                  │
╰─────────────────────────────────────────────────────────────────────────────────╯

Run the script without any options:

python main.py

This will output:

Data(hi=1, ho=1)

Metadata

Release files for typerx 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typerx 0.1.5
File Size Uploaded Provenance
typerx-0.1.5.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for typerx 0.1.5
File Interpreter ABI Platform
typerx-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / typerx-0.1.5.tar.gz

Download URL typerx-0.1.5.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8799b3ee9056841d38b787c7b0a611d059282a8fbaf1ac5e286c172860b82f20
BLAKE2b-256 checksum
How to use checksums
1bcc3ed54eac72ddfbc533afe3a909b96253839246d31cf44fd173a0b1bcccd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / typerx-0.1.5-py3-none-any.whl

Download URL typerx-0.1.5-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c6a2fa06788eac280ef263e4e81d03614b70310b9b73c72fb18ccf3abcbcf1c
BLAKE2b-256 checksum
How to use checksums
c533c0207ee6d1cc778460b6b77c89c9c56c715e1e93e38c64df155bc04f0fc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Security for typerx 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page