No project description provided
Project description
typeduck
Introduction
A lightweight utility for comparing annotation declarations for their compatibility.
Installation
Requires Python 3.8 or above.
pip install typeduck
Usage
from typing import Union, List
from typeduck import TypeDuck
source = List[str]
target = List[Union[str, int]]
td = TypeDuck(source, target)
td.validate() # returns a boolean when validation passes
# OR
td.validate(raises=True) # will raise a TypeError when validation fails
See more examples in the tests.py file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
typeduck-0.0.1.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file typeduck-0.0.1.tar.gz
.
File metadata
- Download URL: typeduck-0.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 525e0dc099cf50695d3e9ccc654871f2be041b6e38def1de08e37d26fae8a169 |
|
MD5 | 6d2584ace423c6907efb169dc4cc194c |
|
BLAKE2b-256 | a2d928d251d2fd51b2572ad9b550fcce6e159b5b1a45125ce95950715d9d963e |
File details
Details for the file typeduck-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: typeduck-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da4e7904f4b99b50894e5caafcdb90d4b24236e79498bb12258aab3338620f21 |
|
MD5 | b64794d141ce683b6ec51458ee20fbd1 |
|
BLAKE2b-256 | 4c69a848d3c8bd5016c4f90a1e575e6e7b0d50e24168107e67d672d66df031fb |