Metadata-Version: 2.0
Name: magicdict
Version: 0.1.0
Summary: An ordered, one-to-many mapping.
Home-page: https://gitlab.com/futursolo/magicdict
Author: Kaede Hoshikawa
Author-email: futursolo@icloud.com
License: Apache License 2.0
Platform: UNKNOWN
Classifier: Operating System :: MacOS
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Provides-Extra: test
Requires-Dist: pytest (>=3.0.6,<4); extra == 'test'

magicdict
=========
.. image:: https://codecov.io/gl/futursolo/magicdict/branch/master/graph/badge.svg
  :target: https://codecov.io/gl/futursolo/magicdict

.. image:: https://gitlab.com/futursolo/magicdict/badges/master/build.svg
  :target: https://gitlab.com/futursolo/magicdict/commits/master

An ordered, one-to-many mapping.

Thread Safety
-------------
`FrozenMagicDict` and its classes should be thread safe without additional
locking. If any data races occurred during using, then that's a bug. Please
file an issue with reproducing procedure.

Usage
-----
`MagicDict` should function like a `collections.OrderedDict` except
`move_to_end` is not defined and the item selection always returns the first
item. It it is not, submit an issue.

`FrozenMagicDict` is an immutable version of `MagicDict`.
Also, compared to `MagicDict`, `FrozenMagicDict` is lockless. Hence,
when an action is available in both dictionaries, `FrozenMagicDict` is usually
faster.

`FrozenTolerantMagicDict` and `TolerantMagicDict` are case-insensitive version
of `FrozenMagicDict` and `MagicDict` respectively.

`get_first`, `get_last`, `get_iter`, and `get_list`:
These methods are available in `FrozenMagicDict` and its subclasses to get the
elements. 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 instead of `dic["key"] = "value"` as it can append a value to the
dictionary without removing the former one. Setting values like normal
`OrderedDict` will clear the stored value(s) if any.

Contributing
------------
Data Structure is one of the bedrocks of all the other Python applications.
Hence, code quality is really important. Basically, to be qualified for merging
into master, the code should pass the mypy and pycodestyle check and
have a 100% unit test coverage.

The repository is hosted on `GitLab <https://gitlab.com/futursolo/magicdict>`_.

License
-------
Copyright 2017 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

    http://www.apache.org/licenses/LICENSE-2.0

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.


