Mew: python dataclass serializer/deserializer
from dataclasses import dataclass
from enum import Enum
from typing import List
import mew
class Type(Enum):
normal = 'normal'
electric = 'electric'
fire = 'fire'
fighting = 'fighting'
water = 'water'
psychic = 'psychic'
@mew.serializable
@dataclass
class Pokemon:
name: str
pokedex: int
type: Type
abilities: List[str]
>>> pikachu = Pokemon('Pikachu', 25, Type.electric, ['static', 'lightning rod'])
>>> pikachu
Pokemon(name='Pikachu', pokedex=25, type=<Type.electric: 'electric'>, abilities=['static', 'lightning rod'])
>>> pikachu.dumps()
'{"name": "Pikachu", "pokedex": 25, "type": "electric", "abilities": ["static", "lightning rod"]}'
>>> assert pikachu == Pokemon.loads(pikachu.dumps())
Metadata
Release files for mew 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mew-0.1.4.tar.gz | 5.0 kB | Without provenance | Details for mew-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mew-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for mew-0.1.4-py2.py3-none-any.whl |
Total release size: 10.8 kB
Release files / mew-0.1.4.tar.gz
| Download URL | mew-0.1.4.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d38595e049aed4f580dea9b0537a94be275adc3c1e67bfa51689a9465a04de0
|
|
BLAKE2b-256 checksum How to use checksums |
ab65ba5ccbcc6079982eee4bd353c840e961dddc5d57bde902a674f561c39edb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
|
Release files / mew-0.1.4-py2.py3-none-any.whl
| Download URL | mew-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f4a7d2652bcb4eec10a105930200574c201733ec25c88cb0fb8e8c03eec61e97
|
|
BLAKE2b-256 checksum How to use checksums |
1254217c0df8bce456f93b019d7dac9310b498615f68de804205e8dbcd9f02f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
|
Security for mew 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.