Skip to main content

No project description provided

Project description

dicto

A dict-like object that enables access of its elements as regular fields. Dicto's main feature is delivering an elegant experience while using configuration files/objects.

Example

You can create a Dicto from any dict:

import dicto

params = dicto.Dict({"learning_rate": 0.001, "batch_size": 32 })

optimizer = Adam(params.learning_rate)

Dicto parses through arbitrary nested structures of dicts, list, tuple, and set:

import dicto

params = dicto.Dict({
    "points":[
        {
            "x": 1,
            "y": 2
        },
        {
            "x": 3,
            "y": 4
        }
    ]
})

print(params.points[0].x) # 1

dicto can load json, yaml, and xml formats directly, for example, given this YAML file

# params.yml
learning_rate: 0.001
batch_size: 32

you can load it like this:

import dicto

params = dicto.load("params.yml")
optimizer = Adam(params.learning_rate)

Installation

pip install dicto

License

MIT License

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

dicto-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

dicto-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file dicto-0.2.0.tar.gz.

File metadata

  • Download URL: dicto-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/5.3.0-7629-generic

File hashes

Hashes for dicto-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5fe029e5c9b5f246e9a3dd5933042ce826efb0d862551541148ab3450f5d811a
MD5 41af6f84325350ddf7d53d5cce69a44d
BLAKE2b-256 3bcca72795248df11fa29c85a9801536a7cb1e0fe2da07498badf65b758e2bf4

See more details on using hashes here.

File details

Details for the file dicto-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dicto-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/5.3.0-7629-generic

File hashes

Hashes for dicto-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c110047d763580e4967262598599430014d6a95a89f0befc05f29eed050009f0
MD5 b96c8d9d1c8512142e862ef4cd6ad7b7
BLAKE2b-256 bde962fb8eff27501056bd37d19fe61c3060470a0649ec0b163b89d54419b419

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