Skip to main content

Convert dict to (js)object

Project description

dict2object

dict2object is a dictionary that supports attribute-style access, a la JavaScript

PyPI version downloads license

Install

pip install dict2object-gaponukz

Use

from dict2object.dict2object import Object

user1 = Object(
    name="Adam",
    age = 18,
)

user2 = Object({
    "name": "Max",
    "age": 18,
    "job": {
        "name": "developer",
        "experience": 3
    }
})

user3 = user2.copy()
user3.job.name = "full stack developer"

print(user3)

user4 = Object.load('{"name": "Anna", "age": 20}')
user4.job = user3.job

print(user4)

Requirements

  • python >= 3.8

You can use dict2object with python 3.8.

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

dict2object-gaponukz-0.0.5.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

dict2object_gaponukz-0.0.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file dict2object-gaponukz-0.0.5.tar.gz.

File metadata

  • Download URL: dict2object-gaponukz-0.0.5.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for dict2object-gaponukz-0.0.5.tar.gz
Algorithm Hash digest
SHA256 415347c2070f11f7710a71f058b8296d6cd6e9a9f3fad162fd1758e3e95fa3bd
MD5 1d88f712348f3077f6e0d3e7daac45c9
BLAKE2b-256 87384982824ce519d1dec2aa2bd7b9682b21ee07305ff7a878cd9e8419681d8d

See more details on using hashes here.

File details

Details for the file dict2object_gaponukz-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: dict2object_gaponukz-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for dict2object_gaponukz-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 02750431ebf2cd0c6b45d4cc39a114e7be86754735e6d7629dc309428b130ab3
MD5 55ca82fff14a49a9cabb85c011bf7257
BLAKE2b-256 10624887300f23df54ae56da5478222124e5cbdb7a4de4f0fb4bc16fd8c99288

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