Skip to main content

to_dict

Project description

py_todict

Usage

from to_dict import Dictable

class B(Dictable):
    def __init__(self, val: int):
        self.val = val

class A(Dictable):
    def __init__(self):
        self.a = 5
        self.b = 'b'
        self.version2 = B(999)

print(A().dict)
# Outputs: {'a': 5, 'b': 'b', 'version2': {'val': 999}}

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

to_dict-0.0.2.tar.gz (1.4 kB view hashes)

Uploaded Source

Built Distribution

to_dict-0.0.2-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

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