Mercurial > repos > jpayne > bioproject_to_srr_2
comparison idna-3.7.dist-info/METADATA @ 7:5eb2d5e3bf22
planemo upload for repository https://toolrepo.galaxytrakr.org/view/jpayne/bioproject_to_srr_2/556cac4fb538
author | jpayne |
---|---|
date | Sun, 05 May 2024 23:32:17 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
6:b2745907b1eb | 7:5eb2d5e3bf22 |
---|---|
1 Metadata-Version: 2.1 | |
2 Name: idna | |
3 Version: 3.7 | |
4 Summary: Internationalized Domain Names in Applications (IDNA) | |
5 Author-email: Kim Davies <kim+pypi@gumleaf.org> | |
6 Requires-Python: >=3.5 | |
7 Description-Content-Type: text/x-rst | |
8 Classifier: Development Status :: 5 - Production/Stable | |
9 Classifier: Intended Audience :: Developers | |
10 Classifier: Intended Audience :: System Administrators | |
11 Classifier: License :: OSI Approved :: BSD License | |
12 Classifier: Operating System :: OS Independent | |
13 Classifier: Programming Language :: Python | |
14 Classifier: Programming Language :: Python :: 3 | |
15 Classifier: Programming Language :: Python :: 3 :: Only | |
16 Classifier: Programming Language :: Python :: 3.5 | |
17 Classifier: Programming Language :: Python :: 3.6 | |
18 Classifier: Programming Language :: Python :: 3.7 | |
19 Classifier: Programming Language :: Python :: 3.8 | |
20 Classifier: Programming Language :: Python :: 3.9 | |
21 Classifier: Programming Language :: Python :: 3.10 | |
22 Classifier: Programming Language :: Python :: 3.11 | |
23 Classifier: Programming Language :: Python :: 3.12 | |
24 Classifier: Programming Language :: Python :: Implementation :: CPython | |
25 Classifier: Programming Language :: Python :: Implementation :: PyPy | |
26 Classifier: Topic :: Internet :: Name Service (DNS) | |
27 Classifier: Topic :: Software Development :: Libraries :: Python Modules | |
28 Classifier: Topic :: Utilities | |
29 Project-URL: Changelog, https://github.com/kjd/idna/blob/master/HISTORY.rst | |
30 Project-URL: Issue tracker, https://github.com/kjd/idna/issues | |
31 Project-URL: Source, https://github.com/kjd/idna | |
32 | |
33 Internationalized Domain Names in Applications (IDNA) | |
34 ===================================================== | |
35 | |
36 Support for the Internationalized Domain Names in | |
37 Applications (IDNA) protocol as specified in `RFC 5891 | |
38 <https://tools.ietf.org/html/rfc5891>`_. This is the latest version of | |
39 the protocol and is sometimes referred to as “IDNA 2008”. | |
40 | |
41 This library also provides support for Unicode Technical | |
42 Standard 46, `Unicode IDNA Compatibility Processing | |
43 <https://unicode.org/reports/tr46/>`_. | |
44 | |
45 This acts as a suitable replacement for the “encodings.idna” | |
46 module that comes with the Python standard library, but which | |
47 only supports the older superseded IDNA specification (`RFC 3490 | |
48 <https://tools.ietf.org/html/rfc3490>`_). | |
49 | |
50 Basic functions are simply executed: | |
51 | |
52 .. code-block:: pycon | |
53 | |
54 >>> import idna | |
55 >>> idna.encode('ドメイン.テスト') | |
56 b'xn--eckwd4c7c.xn--zckzah' | |
57 >>> print(idna.decode('xn--eckwd4c7c.xn--zckzah')) | |
58 ドメイン.テスト | |
59 | |
60 | |
61 Installation | |
62 ------------ | |
63 | |
64 This package is available for installation from PyPI: | |
65 | |
66 .. code-block:: bash | |
67 | |
68 $ python3 -m pip install idna | |
69 | |
70 | |
71 Usage | |
72 ----- | |
73 | |
74 For typical usage, the ``encode`` and ``decode`` functions will take a | |
75 domain name argument and perform a conversion to A-labels or U-labels | |
76 respectively. | |
77 | |
78 .. code-block:: pycon | |
79 | |
80 >>> import idna | |
81 >>> idna.encode('ドメイン.テスト') | |
82 b'xn--eckwd4c7c.xn--zckzah' | |
83 >>> print(idna.decode('xn--eckwd4c7c.xn--zckzah')) | |
84 ドメイン.テスト | |
85 | |
86 You may use the codec encoding and decoding methods using the | |
87 ``idna.codec`` module: | |
88 | |
89 .. code-block:: pycon | |
90 | |
91 >>> import idna.codec | |
92 >>> print('домен.испытание'.encode('idna2008')) | |
93 b'xn--d1acufc.xn--80akhbyknj4f' | |
94 >>> print(b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna2008')) | |
95 домен.испытание | |
96 | |
97 Conversions can be applied at a per-label basis using the ``ulabel`` or | |
98 ``alabel`` functions if necessary: | |
99 | |
100 .. code-block:: pycon | |
101 | |
102 >>> idna.alabel('测试') | |
103 b'xn--0zwm56d' | |
104 | |
105 Compatibility Mapping (UTS #46) | |
106 +++++++++++++++++++++++++++++++ | |
107 | |
108 As described in `RFC 5895 <https://tools.ietf.org/html/rfc5895>`_, the | |
109 IDNA specification does not normalize input from different potential | |
110 ways a user may input a domain name. This functionality, known as | |
111 a “mapping”, is considered by the specification to be a local | |
112 user-interface issue distinct from IDNA conversion functionality. | |
113 | |
114 This library provides one such mapping that was developed by the | |
115 Unicode Consortium. Known as `Unicode IDNA Compatibility Processing | |
116 <https://unicode.org/reports/tr46/>`_, it provides for both a regular | |
117 mapping for typical applications, as well as a transitional mapping to | |
118 help migrate from older IDNA 2003 applications. | |
119 | |
120 For example, “Königsgäßchen” is not a permissible label as *LATIN | |
121 CAPITAL LETTER K* is not allowed (nor are capital letters in general). | |
122 UTS 46 will convert this into lower case prior to applying the IDNA | |
123 conversion. | |
124 | |
125 .. code-block:: pycon | |
126 | |
127 >>> import idna | |
128 >>> idna.encode('Königsgäßchen') | |
129 ... | |
130 idna.core.InvalidCodepoint: Codepoint U+004B at position 1 of 'Königsgäßchen' not allowed | |
131 >>> idna.encode('Königsgäßchen', uts46=True) | |
132 b'xn--knigsgchen-b4a3dun' | |
133 >>> print(idna.decode('xn--knigsgchen-b4a3dun')) | |
134 königsgäßchen | |
135 | |
136 Transitional processing provides conversions to help transition from | |
137 the older 2003 standard to the current standard. For example, in the | |
138 original IDNA specification, the *LATIN SMALL LETTER SHARP S* (ß) was | |
139 converted into two *LATIN SMALL LETTER S* (ss), whereas in the current | |
140 IDNA specification this conversion is not performed. | |
141 | |
142 .. code-block:: pycon | |
143 | |
144 >>> idna.encode('Königsgäßchen', uts46=True, transitional=True) | |
145 'xn--knigsgsschen-lcb0w' | |
146 | |
147 Implementers should use transitional processing with caution, only in | |
148 rare cases where conversion from legacy labels to current labels must be | |
149 performed (i.e. IDNA implementations that pre-date 2008). For typical | |
150 applications that just need to convert labels, transitional processing | |
151 is unlikely to be beneficial and could produce unexpected incompatible | |
152 results. | |
153 | |
154 ``encodings.idna`` Compatibility | |
155 ++++++++++++++++++++++++++++++++ | |
156 | |
157 Function calls from the Python built-in ``encodings.idna`` module are | |
158 mapped to their IDNA 2008 equivalents using the ``idna.compat`` module. | |
159 Simply substitute the ``import`` clause in your code to refer to the new | |
160 module name. | |
161 | |
162 Exceptions | |
163 ---------- | |
164 | |
165 All errors raised during the conversion following the specification | |
166 should raise an exception derived from the ``idna.IDNAError`` base | |
167 class. | |
168 | |
169 More specific exceptions that may be generated as ``idna.IDNABidiError`` | |
170 when the error reflects an illegal combination of left-to-right and | |
171 right-to-left characters in a label; ``idna.InvalidCodepoint`` when | |
172 a specific codepoint is an illegal character in an IDN label (i.e. | |
173 INVALID); and ``idna.InvalidCodepointContext`` when the codepoint is | |
174 illegal based on its positional context (i.e. it is CONTEXTO or CONTEXTJ | |
175 but the contextual requirements are not satisfied.) | |
176 | |
177 Building and Diagnostics | |
178 ------------------------ | |
179 | |
180 The IDNA and UTS 46 functionality relies upon pre-calculated lookup | |
181 tables for performance. These tables are derived from computing against | |
182 eligibility criteria in the respective standards. These tables are | |
183 computed using the command-line script ``tools/idna-data``. | |
184 | |
185 This tool will fetch relevant codepoint data from the Unicode repository | |
186 and perform the required calculations to identify eligibility. There are | |
187 three main modes: | |
188 | |
189 * ``idna-data make-libdata``. Generates ``idnadata.py`` and | |
190 ``uts46data.py``, the pre-calculated lookup tables used for IDNA and | |
191 UTS 46 conversions. Implementers who wish to track this library against | |
192 a different Unicode version may use this tool to manually generate a | |
193 different version of the ``idnadata.py`` and ``uts46data.py`` files. | |
194 | |
195 * ``idna-data make-table``. Generate a table of the IDNA disposition | |
196 (e.g. PVALID, CONTEXTJ, CONTEXTO) in the format found in Appendix | |
197 B.1 of RFC 5892 and the pre-computed tables published by `IANA | |
198 <https://www.iana.org/>`_. | |
199 | |
200 * ``idna-data U+0061``. Prints debugging output on the various | |
201 properties associated with an individual Unicode codepoint (in this | |
202 case, U+0061), that are used to assess the IDNA and UTS 46 status of a | |
203 codepoint. This is helpful in debugging or analysis. | |
204 | |
205 The tool accepts a number of arguments, described using ``idna-data | |
206 -h``. Most notably, the ``--version`` argument allows the specification | |
207 of the version of Unicode to be used in computing the table data. For | |
208 example, ``idna-data --version 9.0.0 make-libdata`` will generate | |
209 library data against Unicode 9.0.0. | |
210 | |
211 | |
212 Additional Notes | |
213 ---------------- | |
214 | |
215 * **Packages**. The latest tagged release version is published in the | |
216 `Python Package Index <https://pypi.org/project/idna/>`_. | |
217 | |
218 * **Version support**. This library supports Python 3.5 and higher. | |
219 As this library serves as a low-level toolkit for a variety of | |
220 applications, many of which strive for broad compatibility with older | |
221 Python versions, there is no rush to remove older interpreter support. | |
222 Removing support for older versions should be well justified in that the | |
223 maintenance burden has become too high. | |
224 | |
225 * **Python 2**. Python 2 is supported by version 2.x of this library. | |
226 While active development of the version 2.x series has ended, notable | |
227 issues being corrected may be backported to 2.x. Use "idna<3" in your | |
228 requirements file if you need this library for a Python 2 application. | |
229 | |
230 * **Testing**. The library has a test suite based on each rule of the | |
231 IDNA specification, as well as tests that are provided as part of the | |
232 Unicode Technical Standard 46, `Unicode IDNA Compatibility Processing | |
233 <https://unicode.org/reports/tr46/>`_. | |
234 | |
235 * **Emoji**. It is an occasional request to support emoji domains in | |
236 this library. Encoding of symbols like emoji is expressly prohibited by | |
237 the technical standard IDNA 2008 and emoji domains are broadly phased | |
238 out across the domain industry due to associated security risks. For | |
239 now, applications that need to support these non-compliant labels | |
240 may wish to consider trying the encode/decode operation in this library | |
241 first, and then falling back to using `encodings.idna`. See `the Github | |
242 project <https://github.com/kjd/idna/issues/18>`_ for more discussion. | |
243 |