Skip to main content

IPython Extension to pretty print nested dicts

Project description

Utilities to work with hierarchical dictionaries

When working with simulation data or simply creating data visualizations, I often find myself wishing for a readable representation of a nested structure. In python these are typically dicts containing dicts or something alike.

So, this is where this ipython extension comes in:

  • Tab completion across levels for benedicts (plain dicts asap)

tab_completion

  • Pretty printing dictionaries and similar types in a tree-like structure.
dict(
    lorem = "ipsum",
    first_level = dict(
        second_level = dict(
            some_entry = 8.15,
            another_entry = [0, 1, 2, 3, 4],
        )

    )
)
<class 'dict'>
├── lorem .................................... str  ipsum
└── first_level
    └── second_level
        ├── some_entry ..................... float  8.15
        └── another_entry ................... list  (5)

Install

Optional, but recommended

pip install python-benedict
pip install h5py

Required

pip install ipy_dict_hierarchy

In jupyter or ipython, to load manually

%load_ext ipy_dict_hierarchy

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

ipy_dict_hierarchy-0.0.2.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

ipy_dict_hierarchy-0.0.2-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

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