Skip to main content

ImplicitDict base class that turns a subclass into a dict indexing attributes, making [de]serialization easy for complex typing-annotated data types.

Project description

implicitdict

This library primarily provides the ImplicitDict base class which enables the inheriting class to implicitly be treated like a dict with entries corresponding to the fields of the inheriting class. Simple example:

class MyData(ImplicitDict):
    foo: str
    bar: int = 0
    baz: Optional[float]

data: MyData = ImplicitDict.parse({'foo': 'asdf', 'bar': 1}, MyData)
assert json.dumps(data) == '{"foo": "asdf", "bar": 1}'

See class documentation for ImplicitDict and test_normal_usage.py for more information.

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

implicitdict-4.0.1.tar.gz (57.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

implicitdict-4.0.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file implicitdict-4.0.1.tar.gz.

File metadata

  • Download URL: implicitdict-4.0.1.tar.gz
  • Upload date:
  • Size: 57.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for implicitdict-4.0.1.tar.gz
Algorithm Hash digest
SHA256 6413da2faeb03f1d20a537f357c05a58cef8ab32e8923eae4e79ee2396546074
MD5 29ac9002a0a323da2849a5ed617a1eb8
BLAKE2b-256 e892335c435d15e2d198a679c3fbb56cd20907f204c386c1b8facdc06cea8256

See more details on using hashes here.

File details

Details for the file implicitdict-4.0.1-py3-none-any.whl.

File metadata

  • Download URL: implicitdict-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for implicitdict-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71e16dc977a944c0279f5f383db63b44a14a9961b32b535e011fbba782e88a70
MD5 169afa3923f98e09ee71b4cefa0156ce
BLAKE2b-256 02ced947f5995b160d56a2e4a2ba48eacc59884cc2cabfb9eafe4ac49d80575d

See more details on using hashes here.

Supported by

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