Skip to main content

Explore nested structures -- dictionaries and lists

Project description

NestView

Explore nested structures in Python at various levels of granularity.

Examples

from nestview import nestview

    from nestview import nestview


    nested_struct = {
        "orders": [
            {
                "id": "id1",
                "quantity": 43,
                "product": {
                    "id": "prodId1",
                    "name": "Prod 1",
                    "desc": "Description",
                },
            },
            {
                "id": "id2",
                "quantity": 12,
                "product": {
                    "id": "prodId1",
                    "name": "Prod 1",
                    "desc": "Description",
                },
            },
            {
                "id": "id3",
                "quantity": 3,
                "product": {
                    "id": "prodId2",
                    "name": "Prod 2",
                    "desc": "Description",
                },
            },
            {
                "id": "id4",
                "quantity": 2,
                "product": {
                    "id": "prodId1",
                    "name": "Prod 1",
                    "desc": "Description",
                },
            },
            {
                "id": "id5",
                "quantity": 4,
                "product": {
                    "id": "prodId1",
                    "name": "Prod 1",
                    "desc": "Description",
                },
            },
        ]
    }


    print(nestview(nested_struct))

gives

{'orders': '[25]'}

For the same structure with more details:

print(nestview(nested_struct, level=2))

gives

{'orders': ['{5}', '{5}', '{5}', '{5}', '{5}']}

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

nestview-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

nestview-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file nestview-0.1.1.tar.gz.

File metadata

  • Download URL: nestview-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.4

File hashes

Hashes for nestview-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e09a3662cf872d459b93f4f36ac176a18383b82fc4d1df48c0f52e0608afe169
MD5 7d4d132b137e1e727efe7d8ed5a539cb
BLAKE2b-256 d07f044e254395a1f81551fc66bcdc138d10b18413ad5be19288dc7b105708a0

See more details on using hashes here.

File details

Details for the file nestview-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nestview-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.4

File hashes

Hashes for nestview-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fad91e1fcd70b8790deecb0e49def3321605c136980469bd5465c58c654f6e52
MD5 9b9a24eb3f0eb605140677a3168d709b
BLAKE2b-256 69246006d19359fec37372b3d6c40194ce555e0b56c9944174ddd1de76109508

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