Castfit 0.1.0 | Coderz Repository

castfit 0.1.0

Last updated:

0 purchases

castfit 0.1.0 Image
castfit 0.1.0 Images

Free

Languages

Categories

Add to Cart

Description:

castfit 0.1.0

castfit
Basic type casting.



Changelog - Issues - Documentation
Why?
I'm writing more and more type-checked code, but I often get a bunch of strings I need to convert (e.g., from docopt).

pydantic feels heavy.
type-docopt uses a new syntax.
bottle seems like good inspiration for small, useful libraries.

Install
python -m pip install castfit

Example
from pathlib import Path
from castfit import castfit

class Cat:
name: str
age: int
weight: float
logo: Path

bob = castfit(Cat, dict(name="Bob", age="4", weight="3.2", logo="./bob.png"))
assert bob.name == "Bob"
assert bob.age == 4
assert bob.weight == 3.2
assert bob.logo == Path("./bob.png")

License
MIT License

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.