Debian Codegraph @

README.rst

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 .. role:: doc
2 .. (Forward declaration for the "doc" role that Sphinx defines for interop with renderers that
3 are often used to show this doc and that are unaware of Sphinx (GitHub.com, PyPI.org, etc.).
4 Use :doc: rather than :ref: here for better interop as well.)
5
6
7 bidict
8 ======
9
10 *The bidirectional mapping library for Python.*
11
12
13 Status
14 ------
15
16 .. image:: https://img.shields.io/pypi/v/bidict.svg
17 :target: https://pypi.org/project/bidict
18 :alt: Latest release
19
20 .. image:: https://img.shields.io/readthedocs/bidict/main.svg
21 :target: https://bidict.readthedocs.io/en/main/
22 :alt: Documentation
23
24 .. image:: https://github.com/jab/bidict/actions/workflows/test.yml/badge.svg
25 :target: https://github.com/jab/bidict/actions/workflows/test.yml?query=branch%3Amain
26 :alt: GitHub Actions CI status
27
28 .. image:: https://img.shields.io/pypi/l/bidict.svg
29 :target: https://raw.githubusercontent.com/jab/bidict/main/LICENSE
30 :alt: License
31
32 .. image:: https://static.pepy.tech/badge/bidict
33 :target: https://pepy.tech/project/bidict
34 :alt: PyPI Downloads
35
36 .. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
37 :target: https://github.com/sponsors/jab
38 :alt: Sponsor
39
40
41 Features
42 --------
43
44 - Mature: Depended on by
45 Google, Venmo, CERN, Baidu, Tencent,
46 and teams across the world since 2009
47
48 - Familiar, Pythonic APIs
49 that are carefully designed for
50 safety, simplicity, flexibility, and ergonomics
51
52 - Lightweight, with no runtime dependencies
53 outside Python's standard library
54
55 - Implemented in
56 concise, well-factored, fully type-hinted Python code
57 that is optimized for running efficiently
58 as well as for long-term maintenance and stability
59 (as well as `joy <#learning-from-bidict>`__)
60
61 - Extensively `documented <https://bidict.readthedocs.io>`__
62
63 - 100% test coverage
64 running continuously across all supported Python versions
65 (including property-based tests and benchmarks)
66
67
68 Installation
69 ------------
70
71 ``pip install bidict``
72
73
74 Quick Start
75 -----------
76
77 .. code:: python
78
79 >>> from bidict import bidict
80 >>> element_by_symbol = bidict({'H': 'hydrogen'})
81 >>> element_by_symbol['H']
82 'hydrogen'
83 >>> element_by_symbol.inverse['hydrogen']
84 'H'
85
86
87 For more usage documentation,
88 head to the :doc:`intro` [#fn-intro]_
89 and proceed from there.
90
91
92 Enterprise Support
93 ------------------
94
95 Enterprise-level support for bidict can be obtained via the
96 `Tidelift subscription <https://tidelift.com/subscription/pkg/pypi-bidict?utm_source=pypi-bidict&utm_medium=referral&utm_campaign=readme>`__
97 or by `contacting me directly <mailto:[email protected]>`__.
98
99 I have a US-based LLC set up for invoicing,
100 and I have over 20 years of professional experience
101 delivering software and support to companies successfully.
102
103 You can also sponsor my work through several platforms, including GitHub Sponsors.
104 See the `Sponsoring <#sponsoring>`__ section below for details,
105 including rationale and examples of companies
106 supporting the open source projects they depend on.
107
108
109 Voluntary Community Support
110 ---------------------------
111
112 Please search through already-asked questions and answers
113 in `GitHub Discussions <https://github.com/jab/bidict/discussions>`__
114 and the `issue tracker <https://github.com/jab/bidict/issues?q=is%3Aissue>`__
115 in case your question has already been addressed.
116
117 Otherwise, please feel free to
118 `start a new discussion <https://github.com/jab/bidict/discussions>`__
119 or `create a new issue <https://github.com/jab/bidict/issues/new>`__ on GitHub
120 for voluntary community support.
121
122
123 Notice of Usage
124 ---------------
125
126 If you use bidict,
127 and especially if your usage or your organization is significant in some way,
128 please let me know in any of the following ways:
129
130 - `star bidict on GitHub <https://github.com/jab/bidict>`__
131 - post in `GitHub Discussions <https://github.com/jab/bidict/discussions>`__
132 - `email me <mailto:[email protected]>`__
133
134
135 Changelog
136 ---------
137
138 For bidict release notes, see the :doc:`changelog`. [#fn-changelog]_
139
140
141 Release Notifications
142 ---------------------
143
144 .. duplicated in CHANGELOG.rst:
145 (Would use `.. include::` but GitHub's renderer doesn't support it.)
146
147 Watch `bidict releases on GitHub <https://github.com/jab/bidict/releases>`__
148 to be notified when new versions of bidict are published.
149 Click the "Watch" dropdown, choose "Custom", and then choose "Releases".
150
151
152 Learning from bidict
153 --------------------
154
155 One of the best things about bidict
156 is that it touches a surprising number of
157 interesting Python corners,
158 especially given its small size and scope.
159
160 Check out :doc:`learning-from-bidict` [#fn-learning]_
161 if you're interested in learning more.
162
163
164 Contributing
165 ------------
166
167 I have been bidict's sole maintainer
168 and `active contributor <https://github.com/jab/bidict/graphs/contributors>`__
169 since I started the project ~15 years ago.
170
171 Your help would be most welcome!
172 See the :doc:`contributors-guide` [#fn-contributing]_
173 for more information.
174
175
176 Sponsoring
177 ----------
178
179 .. duplicated in CONTRIBUTING.rst
180 (Would use `.. include::` but GitHub's renderer doesn't support it.)
181
182 .. image:: https://img.shields.io/badge/GitHub-sponsor-ff69b4
183 :target: https://github.com/sponsors/jab
184 :alt: Sponsor through GitHub
185
186 Bidict is the product of thousands of hours of my unpaid work
187 over the 15+ years that I've been the sole maintainer.
188
189 If bidict has helped you or your company accomplish your work,
190 please sponsor my work through one of the following,
191 and/or ask your company to do the same:
192
193 - `GitHub <https://github.com/sponsors/jab>`__
194 - `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=jabronson%40gmail%2ecom&lc=US&item_name=Sponsor%20bidict>`__
195 - `Tidelift <https://tidelift.com>`__
196 - `thanks.dev <https://thanks.dev>`__
197 - `Gumroad <https://gumroad.com/l/bidict>`__
198 - `a support engagement with my LLC <#enterprise-support>`__
199
200 If you're not sure which to use, GitHub is an easy option,
201 especially if you already have a GitHub account.
202 Just choose a monthly or one-time amount, and GitHub handles everything else.
203 Your bidict sponsorship on GitHub will automatically go
204 on the same regular bill as any other GitHub charges you pay for.
205 PayPal is another easy option for one-time contributions.
206
207 See the following for rationale and examples of companies
208 supporting the open source projects they depend on
209 in this manner:
210
211 - `<https://engineering.atspotify.com/2022/04/announcing-the-spotify-foss-fund/>`__
212 - `<https://blog.sentry.io/2021/10/21/we-just-gave-154-999-dollars-and-89-cents-to-open-source-maintainers>`__
213 - `<https://engineering.indeedblog.com/blog/2019/07/foss-fund-six-months-in/>`__
214
215 .. - `<https://sethmlarson.dev/blog/people-in-your-software-supply-chain>`__
216 .. - `<https://www.cognitect.com/blog/supporting-open-source-developers>`__
217 .. - `<https://vorpus.org/blog/the-unreasonable-effectiveness-of-investment-in-open-source-infrastructure/>`__
218
219
220 Finding Documentation
221 ---------------------
222
223 If you're viewing this on `<https://bidict.readthedocs.io>`__,
224 note that multiple versions of the documentation are available,
225 and you can choose a different version using the popup menu at the bottom-right.
226 Please make sure you're viewing the version of the documentation
227 that corresponds to the version of bidict you'd like to use.
228
229 If you're viewing this on GitHub, PyPI, or some other place
230 that can't render and link this documentation properly
231 and are seeing broken links,
232 try these alternate links instead:
233
234 .. [#fn-intro] `<https://bidict.readthedocs.io/intro.html>`__ | `<docs/intro.rst>`__
235
236 .. [#fn-changelog] `<https://bidict.readthedocs.io/changelog.html>`__ | `<CHANGELOG.rst>`__
237
238 .. [#fn-learning] `<https://bidict.readthedocs.io/learning-from-bidict.html>`__ | `<docs/learning-from-bidict.rst>`__
239
240 .. [#fn-contributing] `<https://bidict.readthedocs.io/contributors-guide.html>`__ | `<CONTRIBUTING.rst>`__