Skip to main content

A module to access Python props using dotpath.

Project description

dotpath

A simple module to access Python props using dotpath.

Example

from dotpath import dotpath

# A object
pets_dic = {
    'pets': {
        'dog': {
            'name': 'Billy',
            'age': 5,
            'friends': ['Joe', 'Jack'],
        },
        'cat': {
            'name': 'Joe',
            'age': 6,
            'friends': ['Billy', 'Pop'],
        },
    },
}

dog_name = getpath(pets_dic, 'pets.dog.name') # Returns Billy
cat_name = getpath(pets_dic, 'pets.cat.name') # Returns Joe

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

dotpath-0.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

dotpath-0.1.0-py3-none-any.whl (1.8 kB view details)

Uploaded Python 3

File details

Details for the file dotpath-0.1.0.tar.gz.

File metadata

  • Download URL: dotpath-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.5 Darwin/20.5.0

File hashes

Hashes for dotpath-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3823a96d98f8cb8d7bccf8ff22f066bdf3f9c9dba001bdc6b1b3e6a904ac469
MD5 1d2b9befc0626a347e86391d255d6d59
BLAKE2b-256 933730d08c96a6f4254643613b47a6f05aa22060dcd6ad2e98b401b247005117

See more details on using hashes here.

File details

Details for the file dotpath-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dotpath-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.5 Darwin/20.5.0

File hashes

Hashes for dotpath-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40b942af5dd5f9cb8f8506fac5aec946dc2e5215aac149fec386b11c6bb537ee
MD5 f43444d179d21078285b18d890c901ad
BLAKE2b-256 b671b96118fad966b9961b13f2b0ca2068f7c3ac834b1d3f64feadf18eee8ae3

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