././@PaxHeader 0000000 0000000 0000000 00000000033 00000000000 010211 x ustar 00 27 mtime=1630855987.643365
bidict-0.21.3/ 0000755 0001751 0000171 00000000000 00000000000 012373 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.LICENSE_HEADER 0000644 0001751 0000171 00000000373 00000000000 014471 0 ustar 00runner docker Copyright 2009-2019 Joshua Bronson. All Rights Reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.coveragerc 0000644 0001751 0000171 00000000261 00000000000 014513 0 ustar 00runner docker [run]
branch = True
source = bidict
dynamic_context = test_function
[report]
precision = 1
exclude_lines =
pragma: no cover
def __repr__
@.*overload
if .*TYPE_CHECKING
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.editorconfig 0000644 0001751 0000171 00000000353 00000000000 015051 0 ustar 00runner docker # http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[*.yml]
indent_size = 2
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.lgtm.yml 0000644 0001751 0000171 00000000224 00000000000 014135 0 ustar 00runner docker queries:
- exclude: py/missing-equals
- exclude: py/conflicting-attributes
- exclude: py/unused-import
- exclude: py/import-and-import-from
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.pre-commit-config.yaml 0000644 0001751 0000171 00000002576 00000000000 016666 0 ustar 00runner docker repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: double-quote-string-fixer
# This stopped working so comment out for now (started applying to files that didn't need it):
# - id: fix-encoding-pragma
- id: check-yaml
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
exclude: bidict/_version.py
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
# https://pre-commit.com/#repository-local-hooks
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
# This stopped working so comment out for now (started applying to files that didn't need it):
# - id: insert-license
# files: \.py$
# args:
# # Renamed LICENSE_HEADER -> .LICENSE_HEADER to avoid confusing licensee
# # (https://github.com/benbalter/licensee - what GitHub uses to detect license)
# - --license-filepath=.LICENSE_HEADER
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.pylintrc 0000644 0001751 0000171 00000001706 00000000000 014244 0 ustar 00runner docker # https://docs.pylint.org/en/latest/technical_reference/features.html
[MASTER]
jobs = 0
ignore =
conf.py,
run_tests.py,
_version.py,
[MESSAGES CONTROL]
disable =
abstract-method,
arguments-differ,
arguments-renamed,
attribute-defined-outside-init,
bad-continuation,
broad-except,
duplicate-code,
import-error,
invalid-name,
isinstance-second-argument-not-valid-type, # https://github.com/PyCQA/pylint/issues/3507
line-too-long,
missing-function-docstring, # prevents idiomatic type hints
multiple-statements, # prevents idiomatic type hints
no-init,
no-member,
no-self-use, # prevents idiomatic type hints
not-callable,
protected-access,
redefined-builtin,
signature-differs,
super-init-not-called,
too-few-public-methods,
too-many-ancestors,
too-many-branches,
too-many-locals,
unsubscriptable-object, # pylint bug with generic types
unused-argument,
wrong-import-order,
wrong-import-position,
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/.readthedocs.yml 0000644 0001751 0000171 00000000332 00000000000 015457 0 ustar 00runner docker # https://docs.readthedocs.io/en/latest/config-file/
version: 2
formats:
- htmlzip
build:
image: latest
python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/CHANGELOG.rst 0000644 0001751 0000171 00000106471 00000000000 014425 0 ustar 00runner docker .. Forward declarations for all the custom interpreted text roles that
Sphinx defines and that are used below. This helps Sphinx-unaware tools
(e.g. rst2html, PyPI's and GitHub's renderers, etc.).
.. role:: doc
.. role:: ref
Changelog
=========
Release Notifications
---------------------
.. duplicated in README.rst
(would use `.. include::` but GitHub doesn't understand it)
.. image:: https://img.shields.io/badge/libraries.io-subscribe-5BC0DF.svg
:target: https://libraries.io/pypi/bidict
:alt: Follow on libraries.io
Tip: Subscribe to releases
`on GitHub `__ or
`libraries.io `__
to be notified when new versions of ``bidict`` are released.
0.21.3 (2021-09-05)
-------------------
- All bidicts now provide the :meth:`~bidict.BidictBase.equals_order_sensitive` method,
not just :class:`bidict.OrderedBidict`\s.
Since support for Python < 3.6 was dropped in v0.21.0,
non-:class:`Ordered ` bidicts preserve a deterministic ordering
on all supported Python versions,
so all bidicts can now provide :meth:`~bidict.BidictBase.equals_order_sensitive`.
- Take better advantage of the fact that dicts are reversible in Python 3.8+.
This allows even non-:class:`Ordered ` bidicts
to efficiently provide a :meth:`~bidict.BidictBase.__reversed__` implementation,
which they now do.
As a result, if you are using Python 3.8+,
:class:`~bidict.frozenbidict` now gives you everything that
:class:`~bidict.FrozenOrderedBidict` gives you with less space overhead.
- Drop `setuptools_scm `__
as a ``setup_requires`` dependency.
- Remove the ``bidict.__version_info__`` attribute.
0.21.2 (2020-09-07)
-------------------
- Include `py.typed `__
file to mark :mod:`bidict` as type hinted.
0.21.1 (2020-09-07)
-------------------
This release was yanked and replaced with the 0.21.2 release,
which actually provides the intended changes.
0.21.0 (2020-08-22)
-------------------
- :mod:`bidict` now provides
`type hints `__! ⌨️ ✅
Adding type hints to :mod:`bidict` poses particularly interesting challenges
due to the combination of generic types,
dynamically-generated types
(such as :ref:`inverse bidict classes `
and :func:`namedbidicts `),
and complicating optimizations
such as the use of slots and weakrefs.
It didn't take long to hit bugs and missing features
in the state of the art for type hinting in Python today,
e.g. missing higher-kinded types support
(`python/typing#548 `__),
too-narrow type hints for :class:`collections.abc.Mapping`
(`python/typeshed#4435 `__),
a :class:`typing.Generic` bug in Python 3.6
(`BPO-41451 `__), etc.
That said, this release should provide a solid foundation
for code using :mod:`bidict` that enables static type checking.
As always, if you spot any opportunities to improve :mod:`bidict`
(including its new type hints),
please don't hesitate to submit a PR!
- Add :class:`bidict.MutableBidirectionalMapping` ABC.
The :ref:`other-bidict-types:Bidict Types Diagram` has been updated accordingly.
- Drop support for Python 3.5,
which reaches end of life on 2020-09-13,
represents a tiny percentage of bidict downloads on
`PyPI Stats `__,
and lacks support for
`variable type hint syntax `__,
`ordered dicts `__,
and :attr:`object.__init_subclass__`.
- Remove the no-longer-needed ``bidict.compat`` module.
- Move :ref:`inverse bidict class access `
from a property to an attribute set in
:attr:`~bidict.BidictBase.__init_subclass__`,
to save function call overhead on repeated access.
- :meth:`bidict.OrderedBidictBase.__iter__` no longer accepts
a ``reverse`` keyword argument so that it matches the signature of
:meth:`container.__iter__`.
- Set the ``__module__`` attribute of various :mod:`bidict` types
(using :func:`sys._getframe` when necessary)
so that private, internal modules are not exposed
e.g. in classes' repr strings.
- :func:`~bidict.namedbidict` now immediately raises :class:`TypeError`
if the provided ``base_type`` does not provide
``_isinv`` or :meth:`~object.__getstate__`,
rather than succeeding with a class whose instances may raise
:class:`AttributeError` when these attributes are accessed.
0.20.0 (2020-07-23)
-------------------
The following breaking changes are expected to affect few if any users.
Remove APIs deprecated in the previous release:
- ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
- The ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments of
:meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
- The ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
:class:`~bidict.bidict` class attributes.
- Remove :meth:`bidict.BidirectionalMapping.__subclasshook__`
due to lack of use and maintenance cost.
Fixes a bug introduced in 0.15.0
that caused any class with an ``inverse`` attribute
to be incorrectly considered a subclass of :class:`collections.abc.Mapping`.
`#111 `__
0.19.0 (2020-01-09)
-------------------
- Drop support for Python 2
:ref:`as promised in v0.18.2 `.
The ``bidict.compat`` module has been pruned accordingly.
This makes bidict more efficient on Python 3
and enables further improvement to bidict in the future.
- Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
- Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
An :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
- Expose the new :class:`~bidict.OnDup` class
to contain the three :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the three kinds of duplication that can occur
(*key*, *val*, *kv*).
- Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
- Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
These have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=RAISE, val=...))``.
Or pass one of the instances already provided,
such as :attr:`~bidict.ON_DUP_DROP_OLD`.
Or just don't pass an *on_dup* argument
to use the default value of :attr:`~bidict.ON_DUP_RAISE`.
The :ref:`basic-usage:Values Must Be Unique` docs
have been updated accordingly.
- Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
:class:`~bidict.bidict` class attributes.
A :class:`UserWarning` will now be emitted if these are used.
These have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
- Improve the more efficient implementations of
:meth:`~bidict.BidirectionalMapping.keys`,
:meth:`~bidict.BidirectionalMapping.values`, and
:meth:`~bidict.BidirectionalMapping.items`,
and now also provide a more efficient implementation of
:meth:`~bidict.BidirectionalMapping.__iter__`
by delegating to backing :class:`dict`\s
in the bidict types for which this is possible.
- Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
- No longer use ``__all__`` in :mod:`bidict`'s ``__init__.py``.
0.18.4 (2020-11-02)
-------------------
- Backport fix from v0.20.0
that removes :meth:`bidict.BidirectionalMapping.__subclasshook__`
due to lack of use and maintenance cost.
0.18.3 (2019-09-22)
-------------------
- Improve validation of names passed to :func:`~bidict.namedbidict`:
Use :meth:`str.isidentifier` on Python 3,
and a better regex on Python 2.
- On Python 3,
set :attr:`~definition.__qualname__` on :func:`~bidict.namedbidict` classes
based on the provided ``typename`` argument.
0.18.2 (2019-09-08)
-------------------
- Warn that Python 2 support will be dropped in a future release
when Python 2 is detected.
0.18.1 (2019-09-03)
-------------------
- Fix a regression introduced by the memory optimizations added in 0.15.0
which caused
:func:`deepcopied ` and
:func:`unpickled `
bidicts to have their inverses set incorrectly.
`#94 `__
0.18.0 (2019-02-14)
-------------------
- Rename ``bidict.BidirectionalMapping.inv`` to :attr:`~bidict.BidirectionalMapping.inverse`
and make :attr:`bidict.BidictBase.inv` an alias for :attr:`~bidict.BidictBase.inverse`.
`#86 `__
- :meth:`bidict.BidirectionalMapping.__subclasshook__` now requires an ``inverse`` attribute
rather than an ``inv`` attribute for a class to qualify as a virtual subclass.
This breaking change is expected to affect few if any users.
- Add Python 2/3-compatible ``bidict.compat.collections_abc`` alias.
- Stop testing Python 3.4 on CI,
and warn when Python 3 < 3.5 is detected
rather than Python 3 < 3.3.
Python 3.4 reaches `end of life `__ on 2019-03-18.
As of January 2019, 3.4 represents only about 3% of bidict downloads on
`PyPI Stats `__.
0.17.5 (2018-11-19)
-------------------
Improvements to performance and delegation logic,
with minor breaking changes to semi-private APIs.
- Remove the ``__delegate__`` instance attribute added in the previous release.
It was overly general and not worth the cost.
Instead of checking ``self.__delegate__`` and delegating accordingly
each time a possibly-delegating method is called,
revert back to using "delegated-to-fwdm" mixin classes
(now found in ``bidict._delegating_mixins``),
and resurrect a mutable bidict parent class that omits the mixins
as :class:`bidict.MutableBidict`.
- Rename ``__repr_delegate__`` to
:class:`~bidict.BidictBase._repr_delegate`.
0.17.4 (2018-11-14)
-------------------
Minor code, interop, and (semi-)private API improvements.
- :class:`~bidict.OrderedBidict` optimizations and code improvements.
Use ``bidict``\s for the backing ``_fwdm`` and ``_invm`` mappings,
obviating the need to store key and value data in linked list nodes.
- Refactor proxied- (i.e. delegated-) to-``_fwdm`` logic
for better composability and interoperability.
Drop the ``_Proxied*`` mixin classes
and instead move their methods
into :class:`~bidict.BidictBase`,
which now checks for an object defined by the
``BidictBase.__delegate__`` attribute.
The ``BidictBase.__delegate__`` object
will be delegated to if the method is available on it,
otherwise a default implementation
(e.g. inherited from :class:`~collections.abc.Mapping`)
will be used otherwise.
Subclasses may set ``__delegate__ = None`` to opt out.
Consolidate ``_MutableBidict`` into :class:`bidict.bidict`
now that the dropped mixin classes make it unnecessary.
- Change ``__repr_delegate__``
to simply take a type like :class:`dict` or :class:`list`.
- Upgrade to latest major
`sortedcontainers `__
version (from v1 to v2)
for the :ref:`extending:\`\`SortedBidict\`\` Recipes`.
- ``bidict.compat.{view,iter}{keys,values,items}`` on Python 2
no longer assumes the target object implements these methods,
as they're not actually part of the
:class:`~collections.abc.Mapping` interface,
and provides fallback implementations when the methods are unavailable.
This allows the :ref:`extending:\`\`SortedBidict\`\` Recipes`
to continue to work with sortedcontainers v2 on Python 2.
0.17.3 (2018-09-18)
-------------------
- Improve packaging by adding a pyproject.toml
and by including more supporting files in the distribution.
`#81 `__
- Drop pytest-runner and support for running tests via ``python setup.py test``
in preference to ``pytest`` or ``python -m pytest``.
0.17.2 (2018-04-30)
-------------------
Memory usage improvements
+++++++++++++++++++++++++
- Use less memory in the linked lists that back
:class:`~bidict.OrderedBidict`\s
by storing node data unpacked
rather than in (key, value) tuple objects.
0.17.1 (2018-04-28)
-------------------
Bugfix Release
++++++++++++++
Fix a regression in 0.17.0 that could cause erroneous behavior
when updating items of an :class:`~bidict.Orderedbidict`'s inverse,
e.g. ``some_ordered_bidict.inv[foo] = bar``.
0.17.0 (2018-04-25)
-------------------
Speedups and memory usage improvements
++++++++++++++++++++++++++++++++++++++
- Pass
:meth:`~bidict.bidict.keys`,
:meth:`~bidict.bidict.values`, and
:meth:`~bidict.bidict.items` calls
(as well as their ``iter*`` and ``view*`` counterparts on Python 2)
through to the backing ``_fwdm`` and ``_invm`` dicts
so that they run as fast as possible
(i.e. at C speed on CPython),
rather than using the slower implementations
inherited from :class:`collections.abc.Mapping`.
- Use weakrefs in the linked lists that back
:class:`~bidict.OrderedBidict`\s
to avoid creating strong reference cycles.
Memory for an ordered bidict that you create
can now be reclaimed in CPython
as soon as you no longer hold any references to it,
rather than having to wait until the next garbage collection.
`#71 `__
Misc
++++
- Add ``bidict.__version_info__`` attribute
to complement :attr:`bidict.__version__`.
0.16.0 (2018-04-06)
-------------------
Minor code and efficiency improvements to
:func:`~bidict.inverted` and
:func:`~bidict._iter._iteritems_args_kw`
(formerly ``bidict.pairs()``).
Minor Breaking API Changes
++++++++++++++++++++++++++
The following breaking changes are expected to affect few if any users.
- Rename ``bidict.pairs()`` → ``bidict._util._iteritems_args_kw``.
0.15.0 (2018-03-29)
-------------------
Speedups and memory usage improvements
++++++++++++++++++++++++++++++++++++++
- Use :ref:`slots` to speed up bidict attribute access and reduce memory usage.
On Python 3,
instantiating a large number of bidicts now uses ~57% the amount of memory
that it used before,
and on Python 2 only ~33% the amount of memory that it used before,
in a simple but representative
`benchmark `__.
- Use weakrefs to refer to a bidict's inverse internally,
no longer creating a strong reference cycle.
Memory for a bidict that you create can now be reclaimed
in CPython as soon as you no longer hold any references to it,
rather than having to wait for the next garbage collection.
See the new
:ref:`addendum:\`\`bidict\`\` Avoids Reference Cycles`
documentation.
`#24 `__
- Make :func:`bidict.BidictBase.__eq__` significantly
more speed- and memory-efficient when comparing to
a non-:class:`dict` :class:`~collections.abc.Mapping`.
(``Mapping.__eq__()``\'s inefficient implementation will now never be used.)
The implementation is now more reusable as well.
- Make :func:`bidict.OrderedBidictBase.__iter__` as well as
equality comparison slightly faster for ordered bidicts.
Minor Bugfixes
++++++++++++++
- :func:`~bidict.namedbidict` now verifies that the provided
``keyname`` and ``valname`` are distinct,
raising :class:`ValueError` if they are equal.
- :func:`~bidict.namedbidict` now raises :class:`TypeError`
if the provided ``base_type``
is not a :class:`~bidict.BidirectionalMapping`.
- If you create a custom bidict subclass whose ``_fwdm_cls``
differs from its ``_invm_cls``
(as in the ``FwdKeySortedBidict`` example
from the :ref:`extending:\`\`SortedBidict\`\` Recipes`),
the inverse bidirectional mapping type
(with ``_fwdm_cls`` and ``_invm_cls`` swapped)
is now correctly computed and used automatically
for your custom bidict's
:attr:`~bidict.BidictBase.inverse` bidict.
Miscellaneous
+++++++++++++
- Classes no longer have to provide an ``__inverted__``
attribute to be considered virtual subclasses of
:class:`~bidict.BidirectionalMapping`.
- If :func:`bidict.inverted` is passed
an object with an ``__inverted__`` attribute,
it now ensures it is :func:`callable`
before returning the result of calling it.
- :func:`~bidict.BidictBase.__repr__` no longer checks for a ``__reversed__``
method to determine whether to use an ordered or unordered-style repr.
It now calls the new ``__repr_delegate__`` instead
(which may be overridden if needed), for better composability.
Minor Breaking API Changes
++++++++++++++++++++++++++
The following breaking changes are expected to affect few if any users.
- Split back out the :class:`~bidict.BidictBase` class
from :class:`~bidict.frozenbidict`
and :class:`~bidict.OrderedBidictBase`
from :class:`~bidict.FrozenOrderedBidict`,
reverting the merging of these in 0.14.0.
Having e.g. ``issubclass(bidict, frozenbidict) == True`` was confusing,
so this change restores ``issubclass(bidict, frozenbidict) == False``.
See the updated :ref:`other-bidict-types:Bidict Types Diagram`
and :ref:`other-bidict-types:Polymorphism` documentation.
- Rename:
- ``bidict.BidictBase.fwdm`` → ``._fwdm``
- ``bidict.BidictBase.invm`` → ``._invm``
- ``bidict.BidictBase.fwd_cls`` → ``._fwdm_cls``
- ``bidict.BidictBase.inv_cls`` → ``._invm_cls``
- ``bidict.BidictBase.isinv`` → ``._isinv``
Though overriding ``_fwdm_cls`` and ``_invm_cls`` remains supported
(see :doc:`extending`),
this is not a common enough use case to warrant public names.
Most users do not need to know or care about any of these.
- The :attr:`~bidict.RAISE`,
``OVERWRITE``, and ``IGNORE``
duplication policies are no longer available as attributes of
``DuplicationPolicy``,
and can now only be accessed as attributes of
the :mod:`bidict` module namespace,
which was the canonical way to refer to them anyway.
It is now no longer possible to create an infinite chain like
``DuplicationPolicy.RAISE.RAISE.RAISE...``
- Make ``bidict.pairs()`` and :func:`bidict.inverted`
no longer importable from ``bidict.util``,
and now only importable from the top-level :mod:`bidict` module.
(``bidict.util`` was renamed ``bidict._util``.)
- Pickling ordered bidicts now requires
at least version 2 of the pickle protocol.
If you are using Python 3,
:attr:`pickle.DEFAULT_PROTOCOL` is 3 anyway,
so this will not affect you.
However if you are using in Python 2,
:attr:`~pickle.DEFAULT_PROTOCOL` is 0,
so you must now explicitly specify the version
in your :func:`pickle.dumps` calls,
e.g. ``pickle.dumps(ob, 2)``.
0.14.2 (2017-12-06)
-------------------
- Make initializing (or updating an empty bidict) from only another
:class:`~bidict.BidirectionalMapping`
more efficient by skipping unnecessary duplication checking.
- Fix accidental ignoring of specified ``base_type`` argument
when (un)pickling a :func:`~bidict.namedbidict`.
- Fix incorrect inversion of
``some_named_bidict.inv._for`` and
``some_named_bidict.inv._for``.
- Only warn when an unsupported Python version is detected
(e.g. Python < 2.7) rather than raising :class:`AssertionError`.
0.14.1 (2017-11-28)
-------------------
- Fix a bug introduced in 0.14.0 where hashing a
:class:`~bidict.frozenbidict`\’s inverse
(e.g. ``f = frozenbidict(); {f.inv: '...'}``)
would cause an ``AttributeError``.
- Fix a bug introduced in 0.14.0 for Python 2 users
where attempting to call ``viewitems()``
would cause a ``TypeError``.
`#48 `__
0.14.0 (2017-11-20)
-------------------
- Fix a bug where :class:`~bidict.bidict`\’s
default *on_dup_kv* policy was set to :attr:`~bidict.RAISE`,
rather than matching whatever *on_dup_val* policy was in effect
as was :ref:`documented `.
- Fix a bug that could happen when using Python's optimization (``-O``) flag
that could leave an ordered bidict in an inconsistent state
when dealing with duplicated, overwritten keys or values.
If you do not use optimizations
(specifically, skipping ``assert`` statements),
this would not have affected you.
- Fix a bug introduced by the optimizations in 0.13.0 that could cause
a frozen bidict that compared equal to another mapping
to have a different hash value from the other mapping,
violating Python's object model.
This would only have affected you if you were inserting a
frozen bidict and some other immutable mapping that it compared equal to
into the same set or mapping.
- Add :meth:`~bidict.OrderedBidictBase.equals_order_sensitive`.
- Reduce the memory usage of ordered bidicts.
- Make copying of ordered bidicts faster.
- Improvements to tests and CI, including:
- Test on Windows
- Test with PyPy3
- Test with CPython 3.7-dev
- Test with optimization flags
- Require pylint to pass
Breaking API Changes
++++++++++++++++++++
This release includes multiple API simplifications and improvements.
- Rename:
- ``orderedbidict`` → :class:`~bidict.OrderedBidict`
- ``frozenorderedbidict`` → :class:`~bidict.FrozenOrderedBidict`
so that these now match the case of :class:`collections.OrderedDict`.
The names of the
:class:`~bidict.bidict`,
:func:`~bidict.namedbidict`, and
:class:`~bidict.frozenbidict` classes
have been retained as all-lowercase
so that they continue to match the case of
:class:`dict`, :func:`~collections.namedtuple`, and
:class:`frozenset`, respectively.
- The ``ON_DUP_VAL`` duplication policy value for *on_dup_kv* has been removed.
Use ``None`` instead.
- Merge :class:`~bidict.frozenbidict` and ``BidictBase``
together and remove ``BidictBase``.
:class:`~bidict.frozenbidict`
is now the concrete base class that all other bidict types derive from.
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
- Merge :class:`~bidict.frozenbidict` and ``FrozenBidictBase``
together and remove ``FrozenBidictBase``.
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
- Merge ``frozenorderedbidict`` and ``OrderedBidictBase`` together
into a single :class:`~bidict.FrozenOrderedBidict`
class and remove ``OrderedBidictBase``.
:class:`~bidict.OrderedBidict` now extends
:class:`~bidict.FrozenOrderedBidict`
to add mutable behavior.
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
- Make :meth:`~bidict.OrderedBidictBase.__eq__`
always perform an order-insensitive equality test,
even if the other mapping is ordered.
Previously,
:meth:`~bidict.OrderedBidictBase.__eq__`
was only order-sensitive for other ``OrderedBidictBase`` subclasses,
and order-insensitive otherwise.
Use the new :meth:`~bidict.OrderedBidictBase.equals_order_sensitive`
method for order-sensitive equality comparison.
- ``orderedbidict._should_compare_order_sensitive()`` has been removed.
- ``frozenorderedbidict._HASH_NITEMS_MAX`` has been removed.
Since its hash value must be computed from all contained items
(so that hash results are consistent with
equality comparisons against unordered mappings),
the number of items that influence the hash value should not be limitable.
- ``frozenbidict._USE_ITEMSVIEW_HASH`` has been removed, and
``frozenbidict.compute_hash()``
now uses ``collections.ItemsView._hash()`` to compute the hash always,
not just when running on PyPy.
Override ``frozenbidict.compute_hash()``
to return ``hash(frozenset(iteritems(self)))``
if you prefer the old default behavior on CPython,
which takes linear rather than constant space,
but which uses the ``frozenset_hash`` routine
(implemented in ``setobject.c``)
rather than the pure Python ``ItemsView._hash()`` routine.
- ``loosebidict`` and ``looseorderedbidict`` have been removed.
A simple recipe to implement equivalents yourself is now given in
:doc:`extending`.
- Rename ``FrozenBidictBase._compute_hash()`` →
``frozenbidict.compute_hash()``.
- Rename ``DuplicationBehavior`` → ``DuplicationPolicy``.
- Rename:
- ``BidictBase._fwd_class`` → ``.fwd_cls``
- ``BidictBase._inv_class`` → ``.inv_cls``
- ``BidictBase._on_dup_key`` → ``on_dup_key``
- ``BidictBase._on_dup_val`` → ``on_dup_val``
- ``BidictBase._on_dup_kv`` → ``on_dup_kv``
0.13.1 (2017-03-15)
-------------------
- Fix regression introduced by the new
:meth:`~bidict.BidirectionalMapping.__subclasshook__`
functionality in 0.13.0 so that
``issubclass(OldStyleClass, BidirectionalMapping)`` once again
works with old-style classes,
returning ``False`` rather than raising :class:`AttributeError`
`#41 `__
0.13.0 (2017-01-19)
-------------------
- Support Python 3.6.
(Earlier versions of bidict should work fine on 3.6, but it is officially
supported starting in this version.)
- :class:`~bidict.BidirectionalMapping`
has been refactored into an abstract base class,
following the way :class:`collections.abc.Mapping` works.
The concrete method implementations it used to provide have been moved
into a new ``BidictBase`` subclass.
:class:`~bidict.BidirectionalMapping`
now also implements
:meth:`~bidict.BidirectionalMapping.__subclasshook__`,
so any class that provides a conforming set of attributes
(enumerated in :attr:`~bidict.BidirectionalMapping._subclsattrs`)
will be considered a
:class:`~bidict.BidirectionalMapping`
subclass automatically.
- ``OrderedBidirectionalMapping`` has been renamed to ``OrderedBidictBase``,
to better reflect its function. (It is not an ABC.)
- A new ``FrozenBidictBase`` class has been factored out of
:class:`~bidict.frozenbidict` and
:class:`frozenorderedbidict `.
This implements common behavior such as caching the result of
``__hash__`` after the first call.
- The hash implementations of
:class:`~bidict.frozenbidict` and
:class:`frozenorderedbidict `.
have been reworked to improve performance and flexibility.
:class:`frozenorderedbidict `\’s
hash implementation is now order-sensitive.
See
``frozenbidict._compute_hash()`` and
``frozenorderedbidict._compute_hash``
for more documentation of the changes,
including the new
``frozenbidict._USE_ITEMSVIEW_HASH`` and
``frozenorderedbidict._HASH_NITEMS_MAX``
attributes.
If you have an interesting use case that requires overriding these,
or suggestions for an alternative implementation,
please `share your feedback `__.
- Add ``_fwd_class`` and ``_inv_class`` attributes
representing the backing :class:`~collections.abc.Mapping` types
used internally to store the forward and inverse dictionaries, respectively.
This allows creating custom bidict types with extended functionality
simply by overriding these attributes in a subclass.
See the new :doc:`extending` documentation for examples.
- Pass any parameters passed to :meth:`~bidict.bidict.popitem`
through to ``_fwd.popitem`` for greater extensibility.
- More concise repr strings for empty bidicts.
e.g. ``bidict()`` rather than ``bidict({})`` and
``orderedbidict()`` rather than ``orderedbidict([])``.
- Add ``bidict.compat.PYPY`` and
remove unused ``bidict.compat.izip_longest``.
0.12.0 (2016-07-03)
-------------------
- New/renamed exceptions:
- :class:`~bidict.KeyDuplicationError`
- :class:`~bidict.ValueDuplicationError`
- :class:`~bidict.KeyAndValueDuplicationError`
- :class:`~bidict.DuplicationError` (base class for the above)
- :func:`~bidict.bidict.put`
now accepts ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` keyword args
which allow you to override the default policy
when the key or value of a given item
duplicates any existing item's.
These can take the following values:
- :attr:`~bidict.RAISE`
- ``OVERWRITE``
- ``IGNORE``
``on_dup_kv`` can also take ``ON_DUP_VAL``.
If not provided,
:func:`~bidict.bidict.put` uses the
:attr:`~bidict.RAISE` policy by default.
- New :func:`~bidict.bidict.putall` method
provides a bulk :func:`~bidict.bidict.put` API,
allowing you to override the default duplication handling policy
that :func:`~bidict.bidict.update` uses.
- :func:`~bidict.bidict.update` now fails clean,
so if an :func:`~bidict.bidict.update` call raises a
:class:`~bidict.DuplicationError`,
you can now be sure that none of the given items was inserted.
Previously, all of the given items that were processed
before the one causing the failure would have been inserted,
and no facility was provided to recover
which items were inserted and which weren't,
nor to revert any changes made by the failed
:func:`~bidict.bidict.update` call.
The new behavior makes it easier to reason about and control
the effects of failed :func:`~bidict.bidict.update` calls.
The new :func:`~bidict.bidict.putall` method also fails clean.
Internally, this is implemented by storing a log of changes
made while an update is being processed, and rolling back the changes
when one of them is found to cause an error.
This required reimplementing :class:`orderedbidict `
on top of two dicts and a linked list, rather than two OrderedDicts,
since :class:`~collections.OrderedDict` does not expose
its backing linked list.
- :func:`orderedbidict.move_to_end() `
now works on Python < 3.2 as a result of the new
:class:`orderedbidict ` implementation.
- Add
- ``bidict.compat.viewkeys``
- ``bidict.compat.viewvalues``
- ``bidict.compat.iterkeys``
- ``bidict.compat.itervalues``
- ``bidict.compat.izip``
- ``bidict.compat.izip_longest``
to complement the existing
``bidict.compat.iteritems`` and
``bidict.compat.viewitems``
compatibility helpers.
- More efficient implementations of
``bidict.pairs()``,
:func:`~bidict.inverted`, and
:func:`~bidict.BidictBase.copy`.
- Implement :func:`~bidict.BidictBase.__copy__`
for use with the :mod:`copy` module.
- Fix issue preventing a client class from inheriting from ``loosebidict``.
`#34 `__
- Add benchmarking to tests.
- Drop official support for CPython 3.3.
(It may continue to work, but is no longer being tested.)
Breaking API Changes
++++++++++++++++++++
- Rename ``KeyExistsException`` → :class:`~bidict.KeyDuplicationError`
and ``ValueExistsException`` → :class:`~bidict.ValueDuplicationError`.
- When overwriting the key of an existing value in an :class:`orderedbidict `,
the position of the existing item is now preserved,
overwriting the key of the existing item in place,
rather than moving the item to the end.
This now matches the behavior of overwriting the value of an existing key,
which has always preserved the position of the existing item.
(If inserting an item whose key duplicates that of one existing item
and whose value duplicates that of another,
the existing item whose value is duplicated is still dropped,
and the existing item whose key is duplicated
still gets its value overwritten in place, as before.)
For example:
.. code:: python
>>> from bidict import orderedbidict # doctest: +SKIP
>>> o = orderedbidict([(0, 1), (2, 3)]) # doctest: +SKIP
>>> o.forceput(4, 1) # doctest: +SKIP
previously would have resulted in:
.. code:: python
>>> o # doctest: +SKIP
orderedbidict([(2, 3), (4, 1)])
but now results in:
.. code:: python
>>> o # doctest: +SKIP
orderedbidict([(4, 1), (2, 3)])
0.11.0 (2016-02-05)
-------------------
- Add
:class:`orderedbidict `,
``looseorderedbidict``, and
:class:`frozenorderedbidict `.
- Add :doc:`code-of-conduct`.
- Drop official support for pypy3.
(It still may work but is no longer being tested.
Support may be added back once pypy3 has made more progress.)
0.10.0.post1 (2015-12-23)
-------------------------
- Minor documentation fixes and improvements.
0.10.0 (2015-12-23)
-------------------
- Remove several features in favor of keeping the API simpler
and the code more maintainable.
- In the interest of protecting data safety more proactively, by default
bidict now raises an error on attempting to insert a non-unique value,
rather than allowing its associated key to be silently overwritten.
See discussion in `#21 `__.
- New :meth:`~bidict.bidict.forceupdate` method
provides a bulk :meth:`~bidict.bidict.forceput` operation.
- Fix bugs in
:attr:`~bidict.bidict.pop` and
:attr:`~bidict.bidict.setdefault`
which could leave a bidict in an inconsistent state.
Breaking API Changes
++++++++++++++++++++
- Remove ``bidict.__invert__``, and with it, support for the ``~b`` syntax.
Use :attr:`~bidict.BidictBase.inv` instead.
`#19 `__
- Remove support for the slice syntax.
Use ``b.inv[val]`` rather than ``b[:val]``.
`#19 `__
- Remove ``bidict.invert``.
Use :attr:`~bidict.BidictBase.inv`
rather than inverting a bidict in place.
`#20 `__
- Raise ``ValueExistsException``
when attempting to insert a mapping with a non-unique key.
`#21 `__
- Rename ``collapsingbidict`` → ``loosebidict``
now that it suppresses
``ValueExistsException``
rather than the less general ``CollapseException``.
`#21 `__
- ``CollapseException`` has been subsumed by
``ValueExistsException``.
`#21 `__
- :meth:`~bidict.bidict.put` now raises ``KeyExistsException``
when attempting to insert an already-existing
key, and ``ValueExistsException`` when
attempting to insert an already-existing value.
0.9.0.post1 (2015-06-06)
------------------------
- Fix metadata missing in the 0.9.0rc0 release.
0.9.0rc0 (2015-05-30)
---------------------
- Add this changelog,
`Contributors' Guide `__,
`Gitter chat room `__,
and other community-oriented improvements.
- Adopt Pytest.
- Add property-based tests via
`hypothesis `__.
- Other code, tests, and docs improvements.
Breaking API Changes
++++++++++++++++++++
- Move ``bidict.iteritems()`` and ``bidict.viewitems()``
to new ``bidict.compat`` module.
- Move :class:`bidict.inverted`
to new ``bidict.util`` module
(still available from top-level :mod:`bidict` module as well).
- Move ``bidict.fancy_iteritems()`` → ``bidict.util.pairs()``
(also available from top level as ``bidict.pairs()``).
- Rename :func:`bidict.namedbidict`\'s ``bidict_type`` argument → ``base_type``.
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/CODE_OF_CONDUCT.rst 0000644 0001751 0000171 00000006317 00000000000 015411 0 ustar 00runner docker Code of Conduct
===============
Our Pledge
----------
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our
project and our community a harassment-free experience for everyone,
regardless of age, body size, disability, ethnicity, gender identity and
expression, level of experience, nationality, personal appearance, race,
religion, or sexual identity and orientation.
Our Standards
-------------
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual
attention or advances
- Trolling, insulting/derogatory comments, and personal or political
attacks
- Public or private harassment
- Publishing others' private information, such as a physical or
electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
Our Responsibilities
--------------------
Project maintainers are responsible for clarifying the standards of
acceptable behavior and are expected to take appropriate and fair
corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct, or to ban
temporarily or permanently any contributor for other behaviors that they
deem inappropriate, threatening, offensive, or harmful.
Scope
-----
This Code of Conduct applies both within project spaces and in public
spaces when an individual is representing the project or its community.
Examples of representing a project or community include using an
official project e-mail address, posting via an official social media
account, or acting as an appointed representative at an online or
offline event. Representation of a project may be further defined and
clarified by project maintainers.
Enforcement
-----------
Instances of abusive, harassing, or otherwise unacceptable behavior may
be reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a
response that is deemed necessary and appropriate to the circumstances.
The project team is obligated to maintain confidentiality with regard to
the reporter of an incident. Further details of specific enforcement
policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in
good faith may face temporary or permanent repercussions as determined
by other members of the project's leadership.
Attribution
-----------
This Code of Conduct is adapted from the `Contributor
Covenant `__, version 1.4, available at
`https://www.contributor-covenant.org/version/1/4 `__.
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/CONTRIBUTING.rst 0000644 0001751 0000171 00000014274 00000000000 015044 0 ustar 00runner docker .. Forward declarations for all the custom interpreted text roles that
Sphinx defines and that are used below. This helps Sphinx-unaware tools
(e.g. rst2html, PyPI's and GitHub's renderers, etc.).
.. role:: doc
.. role:: ref
Contributors' Guide
===================
Bug reports, feature requests, patches, and other contributions are warmly welcomed.
Contribution should be as easy and friendly as possible.
Below are a few guidelines contributors should follow to facilitate the process.
Getting Started
---------------
- `Create a GitHub account `__ if you don't have one
already.
- Search through the `issue tracker `__
to see if an issue or pull request has already been created for what you're interested in.
If so, feel free to add comments to it or just hit the "subscribe" button to follow progress.
If not, you can `join the chat room `__ to discuss there,
or go ahead and `create a new issue `__:
- Clearly describe the issue giving as much relevant context as possible.
- If it is a bug, include reproduction steps,
all known environments in which the bug is exhibited,
and ideally a failing test case.
- If you would like to contribute a patch,
make sure you've `created your own fork `__
and have cloned it to your computer.
Making Changes
--------------
- Before making changes, please
(create a `virtualenv `__ and)
install the extra packages required for development:
``pip install -r requirements/dev.txt``
We use `EditorConfig `__
and `pre-commit `__
to help achieve uniform style and quality standards
across a diversity of development environments.
pre-commit gets installed when you run the command above
and ensures that various code checks are run before every commit
(look in ``.pre-commit-config.yaml`` to see which hooks are run).
Ensure the configured hooks are installed by running
``pre-commit install --install-hooks``.
EditorConfig allows us to provide a single ``.editorconfig`` file
to configure settings like indentation consistently
across a variety of supported editors.
See https://editorconfig.org/#download to install the plugin for your editor.
- Create a topic branch off of main for your changes:
``git checkout -b main``
- Make commits of logical units.
- Match the existing code style and quality standards.
If you're adding a feature, include accompanying tests and documentation
demonstrating its correctness and usage.
- Run the tests locally with `tox `__
to make sure they pass for all supported Python versions
(see ``envlist`` in ``tox.ini`` for the complete list).
If you do not have all the referenced Python versions available locally,
you can also push the changes on your branch to GitHub
to automatically trigger a new
`GitHub Actions `__ build,
which should run the tests for all supported Python versions.
- Create a concise but comprehensive commit message in the following style::
Include an example commit message in CONTRIBUTING guide #9999
Without this patch the CONTRIBUTING guide would contain no examples of
a model commit message. This is a problem because the contributor is left
to imagine what the commit message should look like and may not get it
right. This patch fixes the problem by providing a concrete example.
The first line is an imperative statement summarizing the changes with an
issue number from the tracker. The body describes the behavior without
the patch, why it's a problem, and how the patch fixes the problem.
Submitting Changes
------------------
- Push your changes to a topic branch in your fork of the repository:
``git push --set-upstream origin ``
- Submit a pull request providing any additional relevant details necessary.
- Acknowledgment should typically be fast
but please allow 1-2 weeks for a full response / code review.
- The code review process often involves some back-and-forth
to get everything right before merging.
This is typical of quality software projects that accept patches.
- All communication should be supportive and appreciative of good faith efforts to contribute,
creating a welcoming and inclusive community.
Expect nothing less of any project.
Sponsoring
----------
.. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
:target: https://github.com/sponsors/jab
:alt: Sponsor through GitHub
.. image:: https://img.shields.io/badge/Gumroad-sponsor-55a0a4.svg
:target: https://gumroad.com/l/bidict
:alt: Sponsor through Gumroad
.. image:: https://img.shields.io/badge/PayPal-sponsor-blue.svg
:target: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=jabronson%40gmail%2ecom&lc=US&item_name=Sponsor%20bidict%20(name%20a%20fair%20price)
:alt: Sponsor through PayPal
.. duplicated in README.rst
(would use `.. include::` but GitHub doesn't understand it)
Bidict is the product of thousands of hours of my unpaid work
over the 12+ years I've been maintaining it.
If bidict has helped you accomplish your work,
especially work you've been paid for,
it's easy to
`sponsor me through GitHub `__.
Choose a tier and GitHub handles everything else.
The sponsorship just goes on your regular GitHub bill;
there's nothing extra to do.
You can also sponsor me through
`Gumroad `__ or
`PayPal `__.
Read more about
`companies supporting open source developers
`__.
Code of Conduct
---------------
All participation in this project should respect the
:doc:`code-of-conduct`. [#fn-coc]_
By participating, you are expected to honor this code.
.. [#fn-let-me-know] ``__
.. [#fn-coc] ``_ | ``__
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/LICENSE 0000644 0001751 0000171 00000040525 00000000000 013406 0 ustar 00runner docker Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/MANIFEST.in 0000644 0001751 0000171 00000001252 00000000000 014131 0 ustar 00runner docker # Tip: pip install check-manifest && check-manifest -uv
include .LICENSE_HEADER
include LICENSE
include *.py
include *.rst
include *.sh
include *.yaml
include *.yml
include .coveragerc
include .editorconfig
include .pre-commit-config.yaml
include .pylintrc
include mypy.ini
include pyproject.toml
include pytest.ini
include tox.ini
include docs/_static/custom.css
include docs/_static/bidict-types-diagram.dot
include bidict/py.typed
recursive-include assets *.*
recursive-include docs/_static *.*
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile
recursive-include requirements *.*
recursive-include tests *.py
recursive-include tests *.txt
././@PaxHeader 0000000 0000000 0000000 00000000033 00000000000 010211 x ustar 00 27 mtime=1630855987.643365
bidict-0.21.3/PKG-INFO 0000644 0001751 0000171 00000026247 00000000000 013503 0 ustar 00runner docker Metadata-Version: 2.1
Name: bidict
Version: 0.21.3
Summary: The bidirectional mapping library for Python.
Home-page: https://bidict.readthedocs.io
Author: Joshua Bronson
Author-email: jabronson@gmail.com
License: MPL 2.0
Description: .. Forward declarations for all the custom interpreted text roles that
Sphinx defines and that are used below. This helps Sphinx-unaware tools
(e.g. rst2html, PyPI's and GitHub's renderers, etc.).
.. role:: doc
.. Use :doc: rather than :ref: references below for better interop as well.
bidict
======
The bidirectional mapping library for Python.
.. image:: https://raw.githubusercontent.com/jab/bidict/main/assets/logo-sm-white-bg.jpg
:target: https://bidict.readthedocs.io/
:alt: bidict logo
Status
------
.. image:: https://img.shields.io/pypi/v/bidict.svg
:target: https://pypi.org/project/bidict
:alt: Latest release
.. image:: https://img.shields.io/readthedocs/bidict/main.svg
:target: https://bidict.readthedocs.io/en/main/
:alt: Documentation
.. image:: https://github.com/jab/bidict/workflows/Tests/badge.svg
:target: https://github.com/jab/bidict/actions
:alt: GitHub Actions CI status
.. image:: https://codecov.io/gh/jab/bidict/branch/main/graph/badge.svg
:target: https://codecov.io/gh/jab/bidict
:alt: Test coverage
.. Hide to reduce clutter
.. image:: https://img.shields.io/lgtm/alerts/github/jab/bidict.svg
:target: https://lgtm.com/projects/g/jab/bidict/
:alt: LGTM alerts
.. image:: https://bestpractices.coreinfrastructure.org/projects/2354/badge
:target: https://bestpractices.coreinfrastructure.org/en/projects/2354
:alt: CII best practices badge
.. image:: https://img.shields.io/badge/tidelift-pro%20support-orange.svg
:target: https://tidelift.com/subscription/pkg/pypi-bidict?utm_source=pypi-bidict&utm_medium=referral&utm_campaign=docs
:alt: Paid support available via Tidelift
.. image:: https://img.shields.io/pypi/pyversions/bidict.svg
:target: https://pypi.org/project/bidict
:alt: Supported Python versions
.. image:: https://img.shields.io/pypi/implementation/bidict.svg
:target: https://pypi.org/project/bidict
:alt: Supported Python implementations
.. image:: https://img.shields.io/pypi/l/bidict.svg
:target: https://raw.githubusercontent.com/jab/bidict/main/LICENSE
:alt: License
.. image:: https://static.pepy.tech/badge/bidict
:target: https://pepy.tech/project/bidict
:alt: PyPI Downloads
.. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
:target: https://github.com/sponsors/jab
:alt: Sponsor through GitHub
bidict:
^^^^^^^
- has been used for many years by several teams at
**Google, Venmo, CERN, Bank of America Merrill Lynch, Bloomberg, Two Sigma,** and many others
- has carefully designed APIs for
**safety, simplicity, flexibility, and ergonomics**
- is **fast, lightweight, and has no runtime dependencies** other than Python's standard library
- **integrates natively** with Python’s ``collections.abc`` interfaces
- provides **type hints** for all public APIs
- is implemented in **concise, well-factored, pure (PyPy-compatible) Python code**
that is **optimized for running efficiently**
as well as for **reading and learning** [#fn-learning]_
- has **extensive docs and test coverage**
(including property-based tests and benchmarks)
run continuously on all supported Python versions
Installation
------------
``pip install bidict``
Quick Start
-----------
.. code:: python
>>> from bidict import bidict
>>> element_by_symbol = bidict({'H': 'hydrogen'})
>>> element_by_symbol['H']
'hydrogen'
>>> element_by_symbol.inverse['hydrogen']
'H'
For more usage documentation,
head to the :doc:`intro` [#fn-intro]_
and proceed from there.
Voluntary Community Support
---------------------------
.. image:: https://img.shields.io/badge/gitter-chat-5AB999.svg?logo=gitter-white
:target: https://gitter.im/jab/bidict
:alt: Chat
Please feel free to leave a message in the
`bidict chatroom `__
or open a new issue on GitHub
for voluntary community support.
You can search through
`existing issues `__
before creating a new one
in case your issue has been addressed already.
Enterprise Support
------------------
.. image:: https://img.shields.io/badge/tidelift-enterprise%20support-orange.svg
:target: https://tidelift.com/subscription/pkg/pypi-bidict?utm_source=pypi-bidict&utm_medium=referral&utm_campaign=readme
:alt: Enterprise support via Tidelift
Enterprise-level support for bidict can be obtained via the
`Tidelift subscription `__.
Notice of Usage
---------------
If you use bidict,
and especially if your usage or your organization is significant in some way,
please let me know in any of the following ways:
- `star bidict on GitHub `__
- `create an issue `__
- leave a message in the `chat room `__
- `email me `__
Changelog
---------
See the :doc:`changelog` [#fn-changelog]_
for a history of notable changes to bidict.
Release Notifications
---------------------
.. duplicated in CHANGELOG.rst:
(would use `.. include::` but GitHub doesn't understand it)
.. image:: https://img.shields.io/badge/libraries.io-subscribe-5BC0DF.svg
:target: https://libraries.io/pypi/bidict
:alt: Follow on libraries.io
Watch releases
`on GitHub `__ or
`libraries.io `__
to be notified when new versions of bidict are released.
Learning from bidict
--------------------
One of the best things about bidict
is that it touches a surprising number of
interesting Python corners,
especially given its small size and scope.
Check out :doc:`learning-from-bidict` [#fn-learning]_
if you're interested in learning more.
Contributing
------------
bidict is currently a one-person operation
maintained on a voluntary basis.
Your help would be most welcome!
See the :doc:`contributors-guide` [#fn-contributing]_
for more information.
Sponsoring
^^^^^^^^^^
.. duplicated in CONTRIBUTING.rst
(would use `.. include::` but GitHub doesn't understand it)
.. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
:target: https://github.com/sponsors/jab
:alt: Sponsor through GitHub
Bidict is the product of thousands of hours of my unpaid work
over the 12+ years I've been maintaining it.
If bidict has helped you accomplish your work,
especially work you've been paid for,
it's easy to
`sponsor me through GitHub `__.
Choose a tier and GitHub handles everything else.
The sponsorship just goes on your regular GitHub bill;
there's nothing extra to do.
You can also sponsor me through
`Gumroad `__ or
`PayPal `__.
Read more about
`companies supporting open source developers
`__.
Finding Documentation
---------------------
If you're viewing this on ``__,
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:
.. [#fn-learning] ``__ | ``__
.. [#fn-changelog] ``__ | ``__
.. [#fn-intro] ``__ | ``__
.. [#fn-contributing] ``__ | ``__
----
Next: :doc:`intro` [#fn-intro]_
Keywords: dict dictionary mapping datastructure bimap bijection bijective injective inverse reverse bidirectional two-way 2-way
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/PYPI_DOWNLOAD_STATS.rst 0000644 0001751 0000171 00000001250 00000000000 016151 0 ustar 00runner docker Retrieving PyPI Download Stats
------------------------------
As of May 2016,
PyPI download stats are now available from BigQuery at:
https://bigquery.cloud.google.com/table/the-psf:pypi.downloads
Here is an example query for number of downloads in the last 30 days:
.. code:: sql
SELECT
DATE(timestamp) as day,
file.project,
file.version,
COUNT(*) as total_downloads,
FROM
TABLE_DATE_RANGE(
[the-psf:pypi.downloads],
DATE_ADD(CURRENT_TIMESTAMP(), -1, 'month'),
CURRENT_TIMESTAMP()
)
WHERE
file.project = 'bidict'
GROUP BY
day, file.project, file.version
ORDER BY
day asc
LIMIT
99999999
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/README.rst 0000644 0001751 0000171 00000020112 00000000000 014056 0 ustar 00runner docker .. Forward declarations for all the custom interpreted text roles that
Sphinx defines and that are used below. This helps Sphinx-unaware tools
(e.g. rst2html, PyPI's and GitHub's renderers, etc.).
.. role:: doc
.. Use :doc: rather than :ref: references below for better interop as well.
bidict
======
The bidirectional mapping library for Python.
.. image:: https://raw.githubusercontent.com/jab/bidict/main/assets/logo-sm-white-bg.jpg
:target: https://bidict.readthedocs.io/
:alt: bidict logo
Status
------
.. image:: https://img.shields.io/pypi/v/bidict.svg
:target: https://pypi.org/project/bidict
:alt: Latest release
.. image:: https://img.shields.io/readthedocs/bidict/main.svg
:target: https://bidict.readthedocs.io/en/main/
:alt: Documentation
.. image:: https://github.com/jab/bidict/workflows/Tests/badge.svg
:target: https://github.com/jab/bidict/actions
:alt: GitHub Actions CI status
.. image:: https://codecov.io/gh/jab/bidict/branch/main/graph/badge.svg
:target: https://codecov.io/gh/jab/bidict
:alt: Test coverage
.. Hide to reduce clutter
.. image:: https://img.shields.io/lgtm/alerts/github/jab/bidict.svg
:target: https://lgtm.com/projects/g/jab/bidict/
:alt: LGTM alerts
.. image:: https://bestpractices.coreinfrastructure.org/projects/2354/badge
:target: https://bestpractices.coreinfrastructure.org/en/projects/2354
:alt: CII best practices badge
.. image:: https://img.shields.io/badge/tidelift-pro%20support-orange.svg
:target: https://tidelift.com/subscription/pkg/pypi-bidict?utm_source=pypi-bidict&utm_medium=referral&utm_campaign=docs
:alt: Paid support available via Tidelift
.. image:: https://img.shields.io/pypi/pyversions/bidict.svg
:target: https://pypi.org/project/bidict
:alt: Supported Python versions
.. image:: https://img.shields.io/pypi/implementation/bidict.svg
:target: https://pypi.org/project/bidict
:alt: Supported Python implementations
.. image:: https://img.shields.io/pypi/l/bidict.svg
:target: https://raw.githubusercontent.com/jab/bidict/main/LICENSE
:alt: License
.. image:: https://static.pepy.tech/badge/bidict
:target: https://pepy.tech/project/bidict
:alt: PyPI Downloads
.. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
:target: https://github.com/sponsors/jab
:alt: Sponsor through GitHub
bidict:
^^^^^^^
- has been used for many years by several teams at
**Google, Venmo, CERN, Bank of America Merrill Lynch, Bloomberg, Two Sigma,** and many others
- has carefully designed APIs for
**safety, simplicity, flexibility, and ergonomics**
- is **fast, lightweight, and has no runtime dependencies** other than Python's standard library
- **integrates natively** with Python’s ``collections.abc`` interfaces
- provides **type hints** for all public APIs
- is implemented in **concise, well-factored, pure (PyPy-compatible) Python code**
that is **optimized for running efficiently**
as well as for **reading and learning** [#fn-learning]_
- has **extensive docs and test coverage**
(including property-based tests and benchmarks)
run continuously on all supported Python versions
Installation
------------
``pip install bidict``
Quick Start
-----------
.. code:: python
>>> from bidict import bidict
>>> element_by_symbol = bidict({'H': 'hydrogen'})
>>> element_by_symbol['H']
'hydrogen'
>>> element_by_symbol.inverse['hydrogen']
'H'
For more usage documentation,
head to the :doc:`intro` [#fn-intro]_
and proceed from there.
Voluntary Community Support
---------------------------
.. image:: https://img.shields.io/badge/gitter-chat-5AB999.svg?logo=gitter-white
:target: https://gitter.im/jab/bidict
:alt: Chat
Please feel free to leave a message in the
`bidict chatroom `__
or open a new issue on GitHub
for voluntary community support.
You can search through
`existing issues `__
before creating a new one
in case your issue has been addressed already.
Enterprise Support
------------------
.. image:: https://img.shields.io/badge/tidelift-enterprise%20support-orange.svg
:target: https://tidelift.com/subscription/pkg/pypi-bidict?utm_source=pypi-bidict&utm_medium=referral&utm_campaign=readme
:alt: Enterprise support via Tidelift
Enterprise-level support for bidict can be obtained via the
`Tidelift subscription `__.
Notice of Usage
---------------
If you use bidict,
and especially if your usage or your organization is significant in some way,
please let me know in any of the following ways:
- `star bidict on GitHub `__
- `create an issue `__
- leave a message in the `chat room `__
- `email me `__
Changelog
---------
See the :doc:`changelog` [#fn-changelog]_
for a history of notable changes to bidict.
Release Notifications
---------------------
.. duplicated in CHANGELOG.rst:
(would use `.. include::` but GitHub doesn't understand it)
.. image:: https://img.shields.io/badge/libraries.io-subscribe-5BC0DF.svg
:target: https://libraries.io/pypi/bidict
:alt: Follow on libraries.io
Watch releases
`on GitHub `__ or
`libraries.io `__
to be notified when new versions of bidict are released.
Learning from bidict
--------------------
One of the best things about bidict
is that it touches a surprising number of
interesting Python corners,
especially given its small size and scope.
Check out :doc:`learning-from-bidict` [#fn-learning]_
if you're interested in learning more.
Contributing
------------
bidict is currently a one-person operation
maintained on a voluntary basis.
Your help would be most welcome!
See the :doc:`contributors-guide` [#fn-contributing]_
for more information.
Sponsoring
^^^^^^^^^^
.. duplicated in CONTRIBUTING.rst
(would use `.. include::` but GitHub doesn't understand it)
.. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
:target: https://github.com/sponsors/jab
:alt: Sponsor through GitHub
Bidict is the product of thousands of hours of my unpaid work
over the 12+ years I've been maintaining it.
If bidict has helped you accomplish your work,
especially work you've been paid for,
it's easy to
`sponsor me through GitHub `__.
Choose a tier and GitHub handles everything else.
The sponsorship just goes on your regular GitHub bill;
there's nothing extra to do.
You can also sponsor me through
`Gumroad `__ or
`PayPal `__.
Read more about
`companies supporting open source developers
`__.
Finding Documentation
---------------------
If you're viewing this on ``__,
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:
.. [#fn-learning] ``__ | ``__
.. [#fn-changelog] ``__ | ``__
.. [#fn-intro] ``__ | ``__
.. [#fn-contributing] ``__ | ``__
----
Next: :doc:`intro` [#fn-intro]_
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/SECURITY.rst 0000644 0001751 0000171 00000000206 00000000000 014372 0 ustar 00runner docker Security
========
Please see
`tidelift.com/security `__
for how to report a security issue in bidict.
././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1630855987.6353645
bidict-0.21.3/assets/ 0000755 0001751 0000171 00000000000 00000000000 013675 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/assets/bidict-types-diagram.dot 0000644 0001751 0000171 00000003420 00000000000 020406 0 ustar 00runner docker // Copyright 2009-2021 Joshua Bronson. All Rights Reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// See ../build-docs.sh for how to generate an image from this file.
digraph G {
rankdir=BT
dpi=300
node [fontsize="12", shape="box"]
subgraph ABCs {
node [fillcolor="#EFEFEF", color="#666666", fontcolor="#333333", style="filled", fontname="Cousine Nerd Font Italic"]
Mapping [label="collections.abc.Mapping"]
MutableMapping [label="collections.abc.MutableMapping"]
Hashable [label="collections.abc.Hashable"]
MutableMapping -> Mapping
{ rank=same Mapping MutableMapping Hashable }
BidirectionalMapping [label="bidict._abc.BidirectionalMapping", style="filled, bold", fontcolor="black", fontname="Cousine Nerd Font Bold Italic"]
MutableBidirectionalMapping [label="bidict._abc.MutableBidirectionalMapping", style="filled, bold", fontcolor="black", fontname="Cousine Nerd Font Bold Italic"]
BidirectionalMapping -> Mapping
MutableBidirectionalMapping -> BidirectionalMapping
MutableBidirectionalMapping -> MutableMapping
}
subgraph {
node [style="bold", fontname="FiraMono Nerd Font Bold"]
bidict [label="bidict.bidict"]
frozenbidict [label="bidict.frozenbidict"]
OrderedBidict [label="bidict.OrderedBidict"]
FrozenOrderedBidict [label="bidict.FrozenOrderedBidict"]
bidict -> { MutableBidirectionalMapping }
OrderedBidict -> { MutableBidirectionalMapping }
FrozenOrderedBidict -> { BidirectionalMapping, Hashable }
frozenbidict -> { BidirectionalMapping, Hashable }
{ rank=same bidict frozenbidict OrderedBidict FrozenOrderedBidict }
}
}
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1630855982.0
bidict-0.21.3/assets/bidict-types-diagram.png 0000644 0001751 0000171 00000235136 00000000000 020417 0 ustar 00runner docker PNG
IHDR ; bKGD ̿ :IDATxg$eDsNG'^rI(HV
*IQPd$gX`wL[nt0;]=SOj$ @ Pi Ta> G @ Pq Ta> G @ Pq Ta> G @ PqD\D$[{hTH]t4$ɡx0I%#IzaLB¦s1&Ių|$)$|0_/'I|0_O0$I!\0/D\]Q'I݄1$|Q"I.]5N_I0_OI|a0$I
I|a>I|II|a>IR/$Ia0$)$|a>I$|$|$)$|0_/'I|$$I
!'IR/'I
$Ia0_O$|0_O$IROI$I
$Ia0$)I0_OI|a0$I
I|a>I|a>II|a>IR/$Ia>IR/'IRa>I|a>IR/'I
|$)$|0_/'I|0_O0_O$|0_O$IRO0$Ia0_O0_OI|a0$I
$Ia0$)I0$)$)II|a>IR/$Ia0$)$|a>I$|$|$)$|0_/'I|0_O0|$|0_O$IR/'I
$Ia0_O$$Ia0$Ia0$I
$Ia0$)I0($|0_/'IR/'I
$Ia0_O$|0_O$IROICO0_OI|a0$I
$Ia0$)I0$)$)$Ia0$)$|a>I$|$$)$|0_/'I|a>IR/'I
|$)'I
$I
$IR/'I
$Ia0_O$|0_O$I
$Ia0$)I0_OI|a0?-c[7+$8cNFcf1 O0+X{Xyߊ0qa~o\?dwuc^J/̯hK:iߥ*_h2f8a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