jsonalias-0.1.2
توضیحات
A microlibrary that defines a Json type alias for Python.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | jsonalias-0.1.2 |
| نام | jsonalias |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Kevin Heavey |
| ایمیل نویسنده | ID+username@users.noreply.github.com |
| آدرس صفحه اصلی | https://github.com/kevinheavey/jsonalias |
| آدرس اینترنتی | https://pypi.org/project/jsonalias/ |
| مجوز | MIT |
# jsonalias
A microlibrary that defines a `Json` type alias for Python.
## This README is longer than the library
Seriously, this is all the code:
```python
from typing import Dict, List, Union
Json = Union[Dict[str, "Json"], List["Json"], str, int, float, bool, None]
```
If we only supported Python >= 3.10, it would fit on one line:
```python
Json = dict[str, 'Json'] | list['Json'] | str | int | float | bool | None
```
## Then why make a library out of it?
I want to use this type alias in multiple projects and it's
just about long enough to be annoying.
This alias should probably get added to the Python `typing` module.
If it does and I haven't put a big notice on this README,
please open a PR.
## Example
```python
from jsonalias import Json
d: Json = {"foo": ["bar", {"x": "y"}]}
```
## It's not working please help???
Make sure you're using mypy >= 0.981 and running with the
`--enable-recursive-aliases` flag.
## Special Thanks
GitHub user wbolster for [this comment](https://github.com/python/typing/issues/182#issuecomment-1259412066)
notifying us that mypy could now do JSON.
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl jsonalias-0.1.2:
pip install jsonalias-0.1.2.whl
نصب پکیج tar.gz jsonalias-0.1.2:
pip install jsonalias-0.1.2.tar.gz