Package: hyperdict
hyperdictPython dictionaries, but on steroids.hyperdictworks just like the old dictionary but with more additional features. It makes working with dictionaries relatively quicker and easier!Built for clean and shorter adders, getters, and setters.It significantly reduces the lines of code written for dictionary manipulations.Variable names need not be re-written to build the hyperdict (see here).hyperdictretrieve keys when values are given (value-key pairs).Inbuilt unary operations developed with specific functionalities.All inbuilt python dictionary methods work inhyperdict.Installation$ pip install hyperdict
---> 100%

# or

$ poetry add hyperdict
---> 100%User GuideimporthyperdictashdCreate a hyperdict objectUsing theHyperDictclass, we can build a hyper dictionary.d=hd.HyperDict()Basic UsageMultiple keys can be assigned in a single line.d[1,2,'name']=None# HyperDict({1: None, 2: None, 'name': None})# without hyperdictd={i:Noneforiin[1,2,'name']}Usingeach()function, multiple keys can be assigned with coressponding multiple values.d['name','age','skills']=hd.each('Magnus',31,['chess','football'])# HyperDict({'name': 'Magnus', 'age': 31, 'skills': ['chess', 'football']})# without hyperdictd['name']='Magnus'd['age']=31d['skills']=['chess','football']Multiple values can also be retrieved and can also be delelted using the same syntax.d['name','age']# ('Magnus', 31)d['email']# predefined value for a missing key is None# Nonedeld['skills','email']# 'skills' key will be deleted# trial.py:23: Warning: Missing keys: email......# execution continues after warning...hyperdictas a callable instanceOne of the most unique things about hyperdict is value-key retrieval. On accepting value(s) asarguments, the hyperdict function return the keys. On calling it without arguments would return a dictionary of all value keys (raises an error if values are nothashabletypes).The hashable types are cached along with the keys for quicker retrieval from the hyperdict. The cache is cleared when the hyperdict internal dictionary is changed.hashable types: Namelyint(),bool(),str(),tuple(), these types in python are hashable since they areimmutable. They are the types which are allowed to be used as keys in a python dictionary.d=hd.HyperDict()d[1,2,3]=hd.each(0,1,0)d(0)# (1, 3)d(4)# default value for a missing key# Noned(0,1)# ((1, 3), (2,))d()# return a dict() of all the value-key pairs.# {0: (1, 3), 1: (2,)}Attributes and Operatorsd.i# same as list(d.items())d.k# same as list(d.keys())d.v# same as list(d.values())inv_d=~d# Invertor Operation: Returns an Inverts key-values to value-key# WARNING: This `~` operation works as expected if# - values are hashable types (raises an error)# - values are unique like the keys (overwrites the prev key with a new key.)cpy_d=+d# Copy Operation: Returns a python dictionary deep-copied from the hyperdict object-d# Clear Operation: similar to clear() method of python dictionary. Clears the hyperdict dictionary.Methods and functions.to_hd(*a)FunctionCreates ahyperdictusing the variable name as keys.You need not write the key names along with values anymore!Warning: This function does not work in python console, since the nodes from AST are taken as a single expression resulting in None for the expression.name,age,skills=foo_get_data()h=hd.to_hd(name,age,skills)# HyperDict({'name': 'Magnus', 'age': 24, 'skills': ['chess', 'football']})# without hyperdictd={}d['name']=named['age']=aged['skills']=skillschange_no_value(any)andchange_no_key(any): Changes default values for missing key and value(default isNone).d.change_no_key('No key found!')d['name','random key']# ('Magnus', 'No key found!')d.change_no_value('')d(24,'random value')# (('age',), '')hash(): Creates hash of the dictionary exclusively.d.hash()# hash of the dictionary alone.# 123...hash(d)# hash of the whole hyperdict instance.# 321...each(*a): Helper function which is used to map the corresponding values to the given keys.d['name','age','skill']=hd.each('Magnus',31,['Chess','Football'])Docstringsimporthyperdictashdhelp(hd)In-built dictionary methodsAll the methods of python inbuilt dictionary works just the same in hyperdict.Meta dataDependenciesTheto_hd()function in hyperdict usesexecutingby@alexmojakito retrieve object's name and use it as a corresponding key for the value.LicenceThis project is licensed under the terms of theApache License 2.0.DevelopementThis package is developed using:poetry: package and dependency manager.pytest: tests.pcmd:  command line shortener.The whole wrapper is in a single filehyperdict.py.hyperdict
├──__init__.py
└──hyperdict.py<---TestsThe test file istest_hyperdict.pytests
├──__init__.py
└──test_hyperdict.py<---pytest$ pcmd run t

# or 

$ poetry run pytest -vflake8$ pcmd run f

# or

$ flake8 hyperdict/ tests/ --ignore=F401,W504