Benchmarking for dot-accessible dict packages in python

Overview

dotdict-bench

Benchmarking for dot-accessible dict packages in python

deps

More test ideas? Submit an issue!

Package Information

As of 2022-09-21 23:11:19.354375

Package Version Last Commit Stars Forks Description
addict 2.4.0 Tue, 05 Jan 2021 07:16:38 GMT 2277 137 (i)
python-box 6.0.2 Sat, 02 Apr 2022 02:24:21 GMT 2062 89 (i)
dotmap 1.3.30 Wed, 06 Apr 2022 16:26:33 GMT 366 43 (i)
dotwiz 0.4.0 Wed, 21 Sep 2022 22:23:19 GMT 20 1 (i)
easydict 1.9 Sun, 28 Feb 2021 10:26:53 GMT 207 39 (i)
dotsi 0.0.3 Sun, 22 Nov 2020 16:48:22 GMT 18 1 (i)
dictlib 1.1.5 Thu, 15 Aug 2019 23:10:47 GMT 14 3 (i)
diot 0.1.6 Thu, 12 May 2022 20:37:59 GMT 7 2 (i)

Creating an object of the dict subclass

How the packages create an object of the dict subclass

Created
addict {'a': {'b': {'c': 1}}} Type: Dict
python-box {'a': {'b': {'c': 1}}} Type: Box
dotmap DotMap(a=DotMap(b=DotMap(c=1))) Type: DotMap
dotwiz ✫(a=✫(b=✫(c=1))) Type: DotWiz
easydict {'a': {'b': {'c': 1}}} Type: EasyDict
dotsi {'a': {'b': {'c': 1}}} Type: DotsiDict
dictlib {'a': {'b': {'c': 1}}} Type: Dict
diot {'a': Diot({'b': Diot({'c': 1})})} Type: Diot

Creating a dict with preserved keys

How the packages create a dict with preserved keys (e.g. keys, values, items, etc)

Literally, {"keys": 1}

Created or error
addict {'keys': 1}
python-box {'keys': 1}
dotmap DotMap(keys=1)
dotwiz ✫(keys=1)
easydict {'keys': 1}
dotsi {'keys': 1}
dictlib Key 'keys' conflicts with reserved word
diot {'keys': 1}

Creating a dict with magic keys

How the packages create a dict with magic keys (e.g. __name__, __class__, etc)

Literally, {"__name__": 1}

Created or error
addict {'__name__': 1}
python-box {'__name__': 1}
dotmap DotMap(__name__=1)
dotwiz ✫(__name__=1)
easydict {'__name__': 1}
dotsi {'__name__': 1}
dictlib {'__name__': 1}
diot {'__name__': 1}

Accessing values

How the packages to access values

Literally 1 from {"a": {"b": {"c": 1}}}

Way to access value
addict <dict>.a.b.c or <dict>['a']['b']['c']
python-box <dict>.a.b.c or <dict>['a']['b']['c']
dotmap <dict>.a.b.c or <dict>['a']['b']['c']
dotwiz <dict>.a.b.c or <dict>['a']['b']['c']
easydict <dict>.a.b.c or <dict>['a']['b']['c']
dotsi <dict>.a.b.c or <dict>['a']['b']['c']
dictlib dictlib.dig(<dict>, 'a.b.c') or dictlib.Dict(<dict>).a.b.c
diot <dict>.a.b.c or <dict>['a']['b']['c']

Recursive Dot Access

Whether recursive dot access is supported when there are lists in the dict

Literally <dict>.a.b[0].c from {"a": {"b": [{"c": 1}, {"d": 2}]}}

Value or error
addict 1
python-box 1
dotmap 1
dotwiz 1
easydict 1
dotsi 1
dictlib AttributeError: 'dict' object has no attribute 'c'
diot 1

Automatic Hierarchy

Whether a hierarchical structure is created by dot notation

Literally <dict>.a.b.c = 1 creates {"a": {"b": {"c": 1}}}

Created or error
addict {'a': {'b': {'c': 1}}}
python-box KeyError: "'Box' object has no attribute 'a'"
dotmap DotMap(a=DotMap(b=DotMap(c=1)))
dotwiz AttributeError: 'DotWiz' object has no attribute 'a'
easydict AttributeError: 'EasyDict' object has no attribute 'a'
dotsi KeyError: 'a'
dictlib KeyError: 'a'
diot AttributeError: a

Accessing values with preserved keys

How to access values with conflict keys

Literally, accessing values from {"keys": 1, "__name__": 2}

Package obj.keys obj['keys'] obj.__name__ obj['__name__']
addict <built-in method keys of Dict object at 0x7f4455a49c70> 1 2 2
python-box <bound method Box.keys of Box({'keys': 1, '__name__': 2})> 1 2 2
dotmap <bound method DotMap.keys of DotMap(keys=1, __name__=2)> 1 AttributeError: __name__ 2
dotwiz 1 1 2 2
easydict 1 1 2 2
dotsi <built-in method keys of DotsiDict object at 0x7f4455a49c70> 1 2 2
dictlib Can't create Can't create Can't create Can't create
diot <built-in method keys of Diot object at 0x7f4455a49c70> 1 2 2

Accessing dashed keys

How the values with keys with dash are accessed

Literally <dict>.a_b for {"a-b": 1}

Package obj.a_b obj['a_b'] obj['a-b']
addict {} {} 1
python-box 1 KeyError: "'a_b'" 1
dotmap DotMap() DotMap() 1
dotwiz AttributeError: 'DotWiz' object has no attribute 'a_b' KeyError: 'a_b' 1
easydict AttributeError: 'EasyDict' object has no attribute 'a_b' KeyError: 'a_b' 1
dotsi KeyError: 'a_b' KeyError: 'a_b' 1
dictlib 1 1 1
diot 1 1 1

Frozen Dict Support

Whether the packages support frozen dicts

Support? and how?
addict <dict>.freeze()/.unfreeze()
python-box Box(<dict>, frozen_box=True)
dotmap Not supported
dotwiz Not supported
easydict Not supported
dotsi Not supported
dictlib Not supported
diot FrozenDiot(<dict>) or Diot(<dict>, diot_frozen=True)

Key transformation support

Whether the packages support key transformation for dot access

For example: making <dict>.a_b to access value from {"a.b": 1}

Support? and how?
addict Not supported
python-box Using Conversion Box or Camel Killer Box
dotmap Not supported
dotwiz DotWizPlus turns special-cased keys, such as names with spaces, into valid snake_case words
easydict Not supported
dotsi Not supported
dictlib Not supported
diot Support custom transform function: Diot(..., diot_transform =...)
You might also like...

Python JSON benchmarking and correectness.

json_benchmark This repository contains benchmarks for Python JSON readers & writers. What's the fastest Python JSON parser? Let's find out. To run th

Jul 28, 2022

A simple benchmarking SEO tool written in Python.

A simple benchmarking SEO tool written in Python.

SEO-Project A simple benchmarking SEO tool written in Python. The program extracts and compares the values of the sites you enter for you (the data is

Sep 18, 2022

Home of the PaRoutes framework for benchmarking multi-step retrosynthesis predictions.

Home of the PaRoutes framework for benchmarking multi-step retrosynthesis predictions.

PaRoutes is a framework for benchmarking multi-step retrosynthesis methods, i.e. route predictions. It provides: A curated reaction dataset for buildi

Sep 8, 2022

[ICML'22] Benchmarking and Analyzing Point Cloud Robustness under Corruptions

[ICML'22] Benchmarking and Analyzing Point Cloud Robustness under Corruptions

Benchmarking and Analyzing Point Cloud Robustness under Corruptions Jiawei Ren, Lingdong Kong, Liang Pan, Ziwei Liu S-Lab, Nanyang Technological Unive

Sep 18, 2022

Multi-Modal Lidar Dataset for Benchmarking General-Purpose Localization and Mapping Algorithms

 Multi-Modal Lidar Dataset for Benchmarking General-Purpose Localization and Mapping Algorithms

Multi-Modal Lidar Dataset for Benchmarking General-Purpose Localization and Mapping Algorithms (Left) Front view of the multi-modal data acquisition s

Sep 22, 2022

Benchmarking toolkit for patch-based histopathology image classification.

ChampKit ChampKit: Comprehensive Histopathology Assessment of Model Predictions toolKit. A benchmarking toolkit for patch-based image classification i

Aug 2, 2022

Source code for the ECCV 2022 paper "Benchmarking Localization and Mapping for Augmented Reality".

The LaMAR Benchmark for Localization and Mapping in Augmented Reality This repository hosts the source code for our upcoming ECCV 2022 paper: LaMAR: B

Sep 27, 2022

Benchmarking Panoptic Scene Graph Generation (PSG), ECCV'22

Benchmarking Panoptic Scene Graph Generation (PSG), ECCV'22

Panoptic Scene Graph Generation Panoptic Scene Graph Generation Jingkang Yang, Yi Zhe Ang, Zujin Guo, Kaiyang Zhou, Wayne Zhang, Ziwei Liu S-Lab, Nany

Sep 29, 2022

A tool for benchmarking image generation models.

🖼️ Dream Bench 📊 What does it do? dream_bench provides a simplified interface for benchmarking your image-generation models. This repository also ho

Aug 25, 2022
Releases(0.0.0)
Owner
null
Pre-commit hooks for linting .dot files

graphviz-dot-hooks This is a pre-commit hook that uses graphviz python library to validate or render .dot files Installation Whether you use it as a c

Bastien Gérard 1 Jul 20, 2022
Shared, streaming Python dict

UltraDict Sychronized, streaming Python dictionary that uses shared memory as a backend Warning: This is an early hack. There are only few unit tests

Ronny Rentner 178 Sep 23, 2022
Based on python's dict bottom layer, it implements management similar to redis interface

pydis Based on python's dict bottom layer, it implements management similar to redis interface If you want to manage memory like redis, but don't want

null 12 Aug 26, 2022
A library for users to write (experiment in research) configurations in Python Dict or JSON format, while can read parameters from the command line.

请您Star Please Star 如果你觉得此工具不错,请轻轻点击此页面右上角Star按钮增加项目曝光度,谢谢! If you think this tool is good, please gently click the Star button in the upper right corn

Naibo Wang 270 Oct 1, 2022
Author: Wenhao Yu ([email protected]). ACL 2022 Dict-BERT: Enhancing Language Model Pre-training with Dictionary

Dict-BERT: Enhancing Language Model Pre-training with Dictionary Introduction -- This is the pytorch implementation of our ACL 2022 paper "Dict-BERT:

Wenhao Yu 34 Sep 14, 2022
An IoT prototype to enhance the convenience, safety and cleanliness of accessible washrooms.

Working Prototype for Accessible Washroom Occupancy Status & Usage Analysis This repository contains working code for an Internet of Things (IoT) syst

Aznor Yusof 1 Mar 31, 2022
A web application that would provide a public, accessible resource that helps educate consumers about the brands they support so they can make well-informed, more ethical decisions.

hackKU3.0 Hackathon Project for HackKU 2022 Clarity Inspiration Our ultimate vision is to create a platform where users can look up a company's name a

Morgan Bergen 1 Aug 24, 2022
A PyTorch Dataset that caches samples in shared memory, accessible globally to all processes

SharedDataset A PyTorch Dataset that keeps a cache of arbitrary tensors in shared memory, accessible globally to all processes. This can yield enormou

Joao Henriques 18 Sep 19, 2022
makemore is the most accessible way of tinkering with a GPT.

makemore makemore is the most accessible way of tinkering with a GPT. The one-file script makemore.py takes one text file as input, where each line is

Andrej 365 Sep 23, 2022
Decrypted Notes for Distributed Systems. Only accessible to NIT Patna students.

Decrypted Lecture Notes For the NITP 2k19-23 batch. Is baar public website nhi rkhenge, koshish hoga ki google drive ka link ho Provides decrypted lec

Aditya Gupta 3 Aug 7, 2022