gqylpy-dict
English | 中文
gqylpy-dictis based on the built-indictand serves as an enhancement to it. It can do everything the built-indictcan do, and even more. (Designed specifically for the neurologically diverse)
pip3 install gqylpy_dict
>>> from gqylpy_dict import gdict
>>> gdict == dict
True
>>> gdict is dict
False
>>> x = {'a': [{'b': 'B'}]}
>>> x = gdict(x)
>>> x.a[0].b
'B'
>>> x.deepget('a[0].b')
'B'
Let's delve deeper into the functionalities and usages of the gdict class.
Firstly, the gdict class is a custom dictionary class that inherits from Python's built-in dict class. A special feature of gdict is its support for accessing and modifying key-value pairs in the dictionary using dot notation (.). This means we can access dictionary values as if they were object attributes. For instance, given a dictionary {'name': 'Tom', 'age': 25}, we can define a gdict object as follows:
my_dict = gdict({'name': 'Tom', 'age': 25})
Using dot notation, we can access the dictionary values:
my_dict.name # 'Tom'
my_dict.age # 25
We can even modify the dictionary values:
my_dict.name = 'Jerry'
At this point, the value associated with the 'name' key in the dictionary has been changed to 'Jerry'.
Additionally, gdict supports multi-level nested data structures, meaning the keys and values stored in a gdict object can also be dictionaries. For example:
my_dict = gdict({
'personal_info': {'name': 'Tom', 'age': 25},
'work_info': {'company': 'ABC Inc.', 'position': 'Engineer'}
})
We can access and modify values in nested dictionaries:
my_dict.personal_info.name # 'Tom'
my_dict.work_info.position = 'Manager'
Aside from dot notation, we can also access and modify values in a gdict object using traditional dictionary access methods:
my_dict['personal_info']['name'] # 'Tom'
my_dict['work_info']['position'] = 'Manager'
Lastly, the gdict class supports various input formats during instantiation:
my_dict = gdict({'name': 'Tom', 'age': 25})
my_dict = gdict(name='Tom', age=25)
my_dict = gdict([('name', 'Tom'), ('age', 25)])
In summary, the design and implementation of the gdict class provide a convenient and extensible data structure that allows for more flexible manipulation of Python dictionary objects.
Metadata
Release files for gqylpy-dict 1.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gqylpy_dict-1.2.6.tar.gz | 12.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gqylpy_dict-1.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.2 kB
Release files / gqylpy_dict-1.2.6.tar.gz
| Download URL | gqylpy_dict-1.2.6.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd20a98a855b25f4906b2c8cbeaeed7c6fd87c0bf8231dcb0276aa95ae6c92d0
|
|
BLAKE2b-256 checksum How to use checksums |
c32e41bfa0ef1a20ea397d37c1d968cf348ce06513749b3a0090ce01188f93f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / gqylpy_dict-1.2.6-py3-none-any.whl
| Download URL | gqylpy_dict-1.2.6-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e355fb1ca6b375e6cb28dae97c0cf3efe8c0be5feaa16a9c37b9f35a9e91ba6
|
|
BLAKE2b-256 checksum How to use checksums |
5dfc0e69b3777601450d8f95b93567bf7bdc3c25c47f12e3dbd48c683af440c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for gqylpy-dict 1.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.