semvec/pypi-packages huggingface dataset:
adt 0.0.2
Algebraic Data Types in Python
License: MIT
Requires Python: >=3.9

[![Build badge](https://img.shields.io/github/workflow/status/LewisGaul/python_adt/basic-tests/main)](https://github.com/LewisGaul/python_adt/actions/workflows/basic-tests.yml?query=branch%3Amain)
[![Codecov badge](https://img.shields.io/codecov/c/github/LewisGaul/python_adt/main)](https://codecov.io/gh/LewisGaul/python_adt/)
[![Documentation Status](https://readthedocs.org/projects/adt/badge/?version=latest)](https://adt.readthedocs.io/en/latest/?badge=latest)

# Algebraic Data Types in Python

```python
import adt

class MyADT(adt.ADT):
    foo: ()
    bar: (int,)
    baz: (int, bool, str, None)

    @adt.fieldmethod
    def double_first(field, basecls) -> "MyADT":
        if isinstance(field, basecls.foo):
            raise TypeError(
                f"{basecls.foo.__qualname__} does not support doubling"
            )
        field_type = type(field)
        first, *rem = field
        return field_type(first * 2, *rem)

foo = MyADT.foo()
bar = MyADT.bar(4)
baz = MyADT.baz(3, False, "hi", None)

for val in [foo, bar, baz]:
    print(val)
    try:
        doubled = val.double_first()
        print("Doubled:", doubled)
    except TypeError:
        print("Failed to double")
    print()
```

See `examples/`, `adt/example.py` and `tests/test.py`.
sinapy 1.4.0
An asynchronous Python wrapper for the sina API.
License: MIT
Requires Python: >=3.6
Keywords: sina, bot, api, python, asynchronous, aiohttp

EditUsername, Get_username, Search_Id, SendMessageUser, create_group, edit_bio, edit_channel, edit_group, edit_name, get_channel_data, get_group_data, handlers, log_out, on_group_update, on_message_updates_group, run, send_channel_message, send_group_message, show_devices, start