magicdict
An ordered, one-to-many mapping.
Install
$ pip install -U magicdict
Thread Safety
FrozenMagicDict and its subclasses should be thread safe without additional
locking. If any data races occurred, then that’s a bug. Please file an issue
with reproducing procedure.
Usage
MagicDict should function like collections.OrderedDict except
move_to_end is not defined and d[key] always returns the first
item.
FrozenMagicDict is an immutable version of MagicDict.
FrozenTolerantMagicDict and TolerantMagicDict are
case-insensitive versions of FrozenMagicDict and MagicDict
respectively.
get_first, get_last, get_iter, and get_list:
These methods are available in FrozenMagicDict and its subclasses.
For more details, please read the comments of each method.
add:
Method add is available in MagicDict and
TolerantMagicDict. This method is used as an substitution of
dic[key] = value as it can append a value to the
dictionary without removing the existing one. Setting values like normal
OrderedDict will clear the stored value(s) if any.
Contributing
The repository is hosted on GitLab.
License
Copyright 2020 Kaede Hoshikawa
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Release files for magicdict 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| magicdict-1.0.4.tar.gz | 15.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| magicdict-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.4 kB
Release files / magicdict-1.0.4.tar.gz
| Download URL | magicdict-1.0.4.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82d5b346368ded876cfd0d5e012536adb22bf8b28180caebf94e2c4e3104ec8a
|
|
BLAKE2b-256 checksum How to use checksums |
5d1f8c8d1b7946f9a3d3cca0456937520cee0c325b9eb3020bb97ceb70a4fb3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10
|
Release files / magicdict-1.0.4-py3-none-any.whl
| Download URL | magicdict-1.0.4-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6724c63d80637df561af924e9f258e9299a06e9aafbdd9582de79db86432e784
|
|
BLAKE2b-256 checksum How to use checksums |
e01be5a5828c968996b3ecd5ffe9c1a992c9408d19551c364cf3ba8842f03ac7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10
|