Skip to main content

load python dict data to python class

Project description

pyruicore

Build Status   Coverage Status   codebeat badge   python3.8   issues stars   license

  • This package is used to load python dict data to python class.

Usage

from pyruicore import BaseModel, Field


class Department(BaseModel):
    name: str
    address: str


class User(BaseModel):
    age: int = Field(default_factory=lambda: 1)
    departs: List[Department]


user = User(
    departs=[
        {"name": "de1", "address": "address1"},
        Department(name="2", address="address2"),
    ]
)
user_dict = user.dict()
"""
user_dict = {
    "age": 1,
    "departs": [
        {"name": "de1", "address": "address1"},
        {"name": "2", "address": "address2"},
    ]
}
"""

Maintainers

@ruicore

Contributing

PRs are accepted, this is first workout version, may have many bugs, so welcome to point out bugs and fix it.

License

MIT © 2020 ruicore

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyruicore-0.1.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

pyruicore-0.1.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pyruicore-0.1.3.tar.gz.

File metadata

  • Download URL: pyruicore-0.1.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Darwin/20.2.0

File hashes

Hashes for pyruicore-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ad9c3ea145b4e61b4d0d9cb58c757d9cb41c096ba0e0d8019f3f5c1b03817293
MD5 7f7d14e66daac9263a71af9aac1798be
BLAKE2b-256 824e273bf7eb3b093be12baf60009bb270c36d543402361e6b1ca1a0cb99e6ed

See more details on using hashes here.

File details

Details for the file pyruicore-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyruicore-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Darwin/20.2.0

File hashes

Hashes for pyruicore-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5daba4c5616713df5fa880c48117414a4bd8cb522ad6aff05ee98677fd455599
MD5 63a5a6774ec7209aab49615467ba5f3e
BLAKE2b-256 db6c08fcce0d1d9ac25d603cd6f9c5041a8bf87f4a9ab3d28909af03a49ed48f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page