{"repo":"antonagestam/phantom-types","free":true,"listed":false,"github":"https://github.com/antonagestam/phantom-types","clone":"git clone https://github.com/antonagestam/phantom-types.git","description":"Phantom types for Python.","language":"Python","stars":234,"topics":["phantom-types","static-analysis","mypy","python","static-typing","typing","refined-types","refinement-types","refined","python3"],"license":"BSD-3-Clause","category":"dev-tools","readme_excerpt":"phantom-types [Phantom types][ghosts] for Python will help you make illegal states unrepresentable and avoid shotgun parsing by enabling you to practice [\"Parse, don't validate\"][parse]. Checkout the complete documentation on Read the Docs → Installation Extras There are a few extras available that can be used to either enable a feature or install a compatible version of a third-party library. Extra name Feature ---------------- ---------------------------------------------------------------------------------------------------------- [dateutil] Installs [python-dateutil]. Required for parsing strings with [ TZAware and TZNaive ][phantom-datetime]. [phonenumbers] Installs [phonenumbers]. Required to use [ phantom.ext.phonenumbers ][phantom-phonenumbers]. [pydantic] Installs [pydantic]. [hypothesis] Installs [hypothesis]. [all] Installs all of the above. [python-dateutil]: https://pypi.org/project/python-dateutil/ [phonenumbers]: https://pypi.org/project/phonenumbers/ [pydantic]: https://pypi.org/project/pydantic/ [hypothesis]: https://pypi.org/project/hypothesis/ [phantom-datetime]: https://phantom-types.readthedocs.io/en/main/pages/types.html#module-phantom.datetime [phantom-phonenumbers]: https://phantom-types.readthedocs.io/en/main/pages/external-wrappers.html#module-phantom.ext.phonenumbers Examples By introducing a phantom type we can define a pre-condition for a function argument. Now this will be a valid call. ... and so will this. But this will yield a static type chec","default_branch":null,"files":null,"tree":[],"storefront":"/r/antonagestam","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/antonagestam/phantom-types/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}