2014-09-23 14:48:42 +00:00
|
|
|
|
bidict
|
|
|
|
|
======
|
2017-10-11 14:26:20 +00:00
|
|
|
|
|
2015-05-26 05:37:42 +00:00
|
|
|
|
Efficient, Pythonic bidirectional map implementation and related functionality.
|
2015-03-22 18:21:15 +00:00
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
.. image:: ./_static/logo.png
|
2016-06-28 04:05:22 +00:00
|
|
|
|
:target: https://bidict.readthedocs.io/
|
2015-11-28 13:15:39 +00:00
|
|
|
|
:alt: bidict logo
|
|
|
|
|
|
|
|
|
|
|
2015-03-22 18:21:15 +00:00
|
|
|
|
Status
|
|
|
|
|
------
|
|
|
|
|
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
.. Hide until https://github.com/badges/shields/issues/716 is fixed
|
2016-06-28 04:05:22 +00:00
|
|
|
|
.. .. image:: https://img.shields.io/pypi/dm/bidict.svg
|
|
|
|
|
.. :target: https://pypi.python.org/pypi/bidict
|
|
|
|
|
.. :alt: Downloads per month
|
2015-03-22 18:21:15 +00:00
|
|
|
|
|
2017-11-18 03:35:40 +00:00
|
|
|
|
.. image:: https://img.shields.io/pypi/v/bidict.svg
|
2015-03-22 18:21:15 +00:00
|
|
|
|
:target: https://pypi.python.org/pypi/bidict
|
|
|
|
|
:alt: Latest release
|
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
.. image:: https://img.shields.io/readthedocs/bidict/master.svg
|
2016-07-04 03:29:24 +00:00
|
|
|
|
:target: https://bidict.readthedocs.io/en/master/
|
2015-03-22 18:21:15 +00:00
|
|
|
|
:alt: Documentation
|
|
|
|
|
|
2015-04-30 18:49:30 +00:00
|
|
|
|
.. image:: https://travis-ci.org/jab/bidict.svg?branch=master
|
2015-03-22 18:21:15 +00:00
|
|
|
|
:target: https://travis-ci.org/jab/bidict
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:alt: Travis-CI build status (Linux and macOS)
|
|
|
|
|
|
|
|
|
|
.. image:: https://ci.appveyor.com/api/projects/status/gk133415udncwto3/branch/master?svg=true
|
|
|
|
|
:target: https://ci.appveyor.com/project/jab/bidict
|
|
|
|
|
:alt: AppVeyor build status (Windows)
|
2015-03-22 18:21:15 +00:00
|
|
|
|
|
2017-11-20 15:01:49 +00:00
|
|
|
|
.. image:: https://codecov.io/gh/jab/bidict/branch/master/graph/badge.svg
|
|
|
|
|
:target: https://codecov.io/gh/jab/bidict
|
2015-03-22 18:21:15 +00:00
|
|
|
|
:alt: Test coverage
|
|
|
|
|
|
2017-11-18 04:54:53 +00:00
|
|
|
|
.. image:: https://api.codacy.com/project/badge/Grade/6628756a73254cd895656348236833b8
|
|
|
|
|
:target: https://www.codacy.com/app/jab/bidict
|
|
|
|
|
:alt: Codacy grade
|
|
|
|
|
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
.. Hide to reduce clutter
|
|
|
|
|
.. .. image:: https://img.shields.io/pypi/pyversions/bidict.svg
|
|
|
|
|
.. :target: https://pypi.python.org/pypi/bidict
|
|
|
|
|
.. :alt: Supported Python versions
|
2017-11-16 20:44:51 +00:00
|
|
|
|
..
|
|
|
|
|
.. .. image:: https://img.shields.io/pypi/implementation/bidict.svg
|
|
|
|
|
.. :target: https://pypi.python.org/pypi/bidict
|
|
|
|
|
.. :alt: Supported Python implementations
|
2017-11-18 04:54:53 +00:00
|
|
|
|
..
|
|
|
|
|
.. .. image:: https://img.shields.io/badge/lgtm-👍-blue.svg
|
|
|
|
|
.. :target: https://lgtm.com/projects/g/jab/bidict/
|
|
|
|
|
.. :alt: LGTM
|
2015-03-22 18:21:15 +00:00
|
|
|
|
|
2015-04-27 22:20:03 +00:00
|
|
|
|
.. image:: https://img.shields.io/pypi/l/bidict.svg
|
2015-03-22 18:21:15 +00:00
|
|
|
|
:target: https://raw.githubusercontent.com/jab/bidict/master/LICENSE
|
|
|
|
|
:alt: License
|
|
|
|
|
|
2017-10-11 14:26:20 +00:00
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
Bidict:
|
|
|
|
|
^^^^^^^
|
2017-10-11 14:26:20 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- is in use by several teams at Google, Venmo, Bank of America Merrill Lynch,
|
2017-10-11 14:26:20 +00:00
|
|
|
|
and many others,
|
|
|
|
|
- has carefully designed APIs for
|
2017-11-20 03:24:08 +00:00
|
|
|
|
safety, simplicity, flexibility, and ergonomics,
|
2017-10-11 14:26:20 +00:00
|
|
|
|
- is CPython-, PyPy-, Python 2-, and Python 3-compatible,
|
2017-11-20 15:01:49 +00:00
|
|
|
|
- has extensive `test coverage <https://codecov.io/gh/jab/bidict>`_,
|
2017-10-11 14:26:20 +00:00
|
|
|
|
including property-based tests and benchmarks,
|
2017-11-16 20:44:51 +00:00
|
|
|
|
which are run continuously on all supported Python versions and OSes,
|
2017-10-11 14:26:20 +00:00
|
|
|
|
- integrates with Python’s collections interfaces and abstract base classes,
|
2018-01-02 20:32:06 +00:00
|
|
|
|
- has mature, well-factored, well-documented code.
|
|
|
|
|
|
2017-03-15 20:43:23 +00:00
|
|
|
|
|
2017-11-18 04:54:53 +00:00
|
|
|
|
Community and Support
|
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
|
|
.. image:: https://img.shields.io/badge/chat-on%20gitter-5AB999.svg?logo=gitter-white
|
|
|
|
|
:target: https://gitter.im/jab/bidict
|
|
|
|
|
:alt: Chat
|
|
|
|
|
|
2017-03-17 16:16:45 +00:00
|
|
|
|
If you are thinking of using bidict in your work,
|
2017-10-11 14:26:20 +00:00
|
|
|
|
or if you have any questions, comments, or suggestions,
|
|
|
|
|
I'd love to know about your use case
|
|
|
|
|
and provide as much support for it as possible.
|
|
|
|
|
|
|
|
|
|
Please feel free to leave a message in the
|
|
|
|
|
`chatroom <https://gitter.im/jab/bidict>`_
|
|
|
|
|
or `open an issue <https://github.com/jab/bidict/issues>`_
|
|
|
|
|
after reviewing the :doc:`contributors-guide`. [#fn-contributing]_
|
2017-03-17 16:16:45 +00:00
|
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2017-11-18 04:54:53 +00:00
|
|
|
|
Notice of Usage
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
If you are already using bidict, and especially if
|
|
|
|
|
you/your organization is a significant user,
|
|
|
|
|
please `let me know <mailto:jab@math.brown.edu>`_ you're using it!
|
|
|
|
|
|
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
Changelog
|
|
|
|
|
---------
|
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
See the :doc:`changelog` [#fn-changelog]_
|
|
|
|
|
for a history of notable changes to bidict.
|
2017-11-16 20:44:51 +00:00
|
|
|
|
|
|
|
|
|
|
2017-03-31 18:58:44 +00:00
|
|
|
|
.. .. include:: release-notifications.rst.inc
|
2017-11-16 20:44:51 +00:00
|
|
|
|
.. duplicate rather than `include` release-notifications so it renders on GitHub:
|
2017-03-31 18:58:44 +00:00
|
|
|
|
|
|
|
|
|
Release Notifications
|
2017-11-16 20:44:51 +00:00
|
|
|
|
---------------------
|
2017-03-31 18:58:44 +00:00
|
|
|
|
|
2017-11-18 04:54:53 +00:00
|
|
|
|
.. image:: https://img.shields.io/badge/Sibbell-follow-40263B.svg
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:target: https://sibbell.com/github/jab/bidict/releases/
|
|
|
|
|
:alt: Follow on Sibbell
|
2017-03-31 18:58:44 +00:00
|
|
|
|
|
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
Tip: `Follow bidict on Sibbell <https://sibbell.com/github/jab/bidict/releases/>`_
|
2017-11-18 03:35:40 +00:00
|
|
|
|
to be notified when a new version of bidict is released.
|
2017-03-31 18:58:44 +00:00
|
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2014-09-23 16:35:19 +00:00
|
|
|
|
Installation
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
``pip install bidict``
|
|
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2016-12-06 23:09:45 +00:00
|
|
|
|
Usage Documentation
|
|
|
|
|
-------------------
|
2014-09-23 14:48:42 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
Please head to the :doc:`intro` [#fn-intro]_
|
|
|
|
|
for usage documentation.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
|
2018-01-02 20:32:06 +00:00
|
|
|
|
Learning from bidict
|
|
|
|
|
--------------------
|
|
|
|
|
|
2018-01-03 00:24:44 +00:00
|
|
|
|
One of the most rewarding things about working on bidict
|
|
|
|
|
– and also the most surprising,
|
|
|
|
|
especially in light of the small codebase (just ~600 sloc) –
|
|
|
|
|
is how much fun, advanced Python material
|
|
|
|
|
has turned up in the process.
|
|
|
|
|
|
|
|
|
|
Check out the :doc:`learning-from-bidict` [#fn-learning]_ docs
|
|
|
|
|
if you're interested in taking a tour.
|
2018-01-02 20:32:06 +00:00
|
|
|
|
|
|
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
Contributing
|
|
|
|
|
------------
|
|
|
|
|
|
2017-10-11 14:26:20 +00:00
|
|
|
|
Bidict is currently a one-person operation
|
|
|
|
|
maintained on a voluntary basis for the public good.
|
|
|
|
|
Your help would be most welcome.
|
2017-03-17 16:16:45 +00:00
|
|
|
|
|
|
|
|
|
If bidict has helped you accomplish your work,
|
|
|
|
|
especially work you've been paid for,
|
|
|
|
|
please consider supporting bidict's maintenance and development.
|
2016-12-06 23:09:45 +00:00
|
|
|
|
|
|
|
|
|
.. image:: https://raw.githubusercontent.com/jab/bidict/master/_static/support-on-gumroad.png
|
|
|
|
|
:target: https://gumroad.com/l/bidict
|
|
|
|
|
:alt: Support bidict
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2017-10-11 14:26:20 +00:00
|
|
|
|
For information about contributing to the code,
|
|
|
|
|
please see the :doc:`contributors-guide`. [#fn-contributing]_
|
|
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
Finding Documentation
|
|
|
|
|
---------------------
|
2017-10-11 14:26:20 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
If you're viewing this on `<https://bidict.readthedocs.io>`_,
|
|
|
|
|
note that multiple versions of the documentation are available,
|
|
|
|
|
and you can choose a different version using the popup menu at the bottom-right.
|
|
|
|
|
Please make sure you're viewing the version of the documentation
|
|
|
|
|
that corresponds to the version of bidict you'd like to use.
|
|
|
|
|
|
|
|
|
|
If you're viewing this on GitHub, PyPI, or some other place
|
|
|
|
|
that can't render and link this documentation properly
|
|
|
|
|
and are seeing broken links,
|
|
|
|
|
try these alternate links instead:
|
2017-10-11 14:26:20 +00:00
|
|
|
|
|
|
|
|
|
.. [#fn-contributing] `<CONTRIBUTING.rst>`_ | `<https://bidict.readthedocs.io/contributors-guide.html>`_
|
|
|
|
|
|
|
|
|
|
.. [#fn-changelog] `<CHANGELOG.rst>`_ | `<https://bidict.readthedocs.io/changelog.html>`_
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
|
|
|
|
.. [#fn-intro] `<docs/intro.rst>`_ | `<https://bidict.readthedocs.io/intro.html>`_
|
2018-01-02 20:32:06 +00:00
|
|
|
|
|
|
|
|
|
.. [#fn-learning] `<docs/learning-from-bidict.rst>`_ | `<https://bidict.readthedocs.io/learning-from-bidict.html>`_
|