You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

551 lines
11 KiB

4 years ago
  1. Metadata-Version: 2.1
  2. Name: yarl
  3. Version: 1.3.0
  4. Summary: Yet another URL library
  5. Home-page: https://github.com/aio-libs/yarl/
  6. Author: Andrew Svetlov
  7. Author-email: andrew.svetlov@gmail.com
  8. License: Apache 2
  9. Platform: UNKNOWN
  10. Classifier: License :: OSI Approved :: Apache Software License
  11. Classifier: Intended Audience :: Developers
  12. Classifier: Programming Language :: Python
  13. Classifier: Programming Language :: Python :: 3
  14. Classifier: Programming Language :: Python :: 3.5
  15. Classifier: Programming Language :: Python :: 3.6
  16. Classifier: Topic :: Internet :: WWW/HTTP
  17. Requires-Python: >=3.5.3
  18. Requires-Dist: multidict (>=4.0)
  19. Requires-Dist: idna (>=2.0)
  20. yarl
  21. ====
  22. .. image:: https://travis-ci.com/aio-libs/yarl.svg?branch=master
  23. :target: https://travis-ci.com/aio-libs/yarl
  24. :align: right
  25. .. image:: https://codecov.io/gh/aio-libs/yarl/branch/master/graph/badge.svg
  26. :target: https://codecov.io/gh/aio-libs/yarl
  27. .. image:: https://badge.fury.io/py/yarl.svg
  28. :target: https://badge.fury.io/py/yarl
  29. .. image:: https://readthedocs.org/projects/yarl/badge/?version=latest
  30. :target: https://yarl.readthedocs.io
  31. .. image:: https://img.shields.io/pypi/pyversions/yarl.svg
  32. :target: https://pypi.python.org/pypi/yarl
  33. .. image:: https://badges.gitter.im/Join%20Chat.svg
  34. :target: https://gitter.im/aio-libs/Lobby
  35. :alt: Chat on Gitter
  36. Introduction
  37. ------------
  38. Url is constructed from ``str``::
  39. >>> from yarl import URL
  40. >>> url = URL('https://www.python.org/~guido?arg=1#frag')
  41. >>> url
  42. URL('https://www.python.org/~guido?arg=1#frag')
  43. All url parts: *scheme*, *user*, *password*, *host*, *port*, *path*,
  44. *query* and *fragment* are accessible by properties::
  45. >>> url.scheme
  46. 'https'
  47. >>> url.host
  48. 'www.python.org'
  49. >>> url.path
  50. '/~guido'
  51. >>> url.query_string
  52. 'arg=1'
  53. >>> url.query
  54. <MultiDictProxy('arg': '1')>
  55. >>> url.fragment
  56. 'frag'
  57. All url manipulations produce a new url object::
  58. >>> url.parent / 'downloads/source'
  59. URL('https://www.python.org/downloads/source')
  60. Strings passed to constructor and modification methods are
  61. automatically encoded giving canonical representation as result::
  62. >>> url = URL('https://www.python.org/путь')
  63. >>> url
  64. URL('https://www.python.org/%D0%BF%D1%83%D1%82%D1%8C')
  65. Regular properties are *percent-decoded*, use ``raw_`` versions for
  66. getting *encoded* strings::
  67. >>> url.path
  68. '/путь'
  69. >>> url.raw_path
  70. '/%D0%BF%D1%83%D1%82%D1%8C'
  71. Human readable representation of URL is available as ``.human_repr()``::
  72. >>> url.human_repr()
  73. 'https://www.python.org/путь'
  74. For full documentation please read https://yarl.readthedocs.org.
  75. Installation
  76. ------------
  77. ::
  78. $ pip install yarl
  79. The library is Python 3 only!
  80. Dependencies
  81. ------------
  82. YARL requires multidict_ library.
  83. API documentation
  84. ------------------
  85. The documentation is located at https://yarl.readthedocs.org
  86. Comparison with other URL libraries
  87. ------------------------------------
  88. * furl (https://pypi.python.org/pypi/furl)
  89. The library has rich functionality but the ``furl`` object is mutable.
  90. I'm afraid to pass this object into foreign code: who knows if the
  91. code will modify my url in a terrible way while I just want to send URL
  92. with handy helpers for accessing URL properties.
  93. ``furl`` has other non-obvious tricky things but the main objection
  94. is mutability.
  95. * URLObject (https://pypi.python.org/pypi/URLObject)
  96. URLObject is immutable, that's pretty good.
  97. Every URL change generates a new URL object.
  98. But the library doesn't do any decode/encode transformations leaving the
  99. end user to cope with these gory details.
  100. Source code
  101. -----------
  102. The project is hosted on GitHub_
  103. Please file an issue on the `bug tracker
  104. <https://github.com/aio-libs/yarl/issues>`_ if you have found a bug
  105. or have some suggestion in order to improve the library.
  106. The library uses `Travis <https://travis-ci.org/aio-libs/yarl>`_ for
  107. Continuous Integration.
  108. Discussion list
  109. ---------------
  110. *aio-libs* google group: https://groups.google.com/forum/#!forum/aio-libs
  111. Feel free to post your questions and ideas here.
  112. Authors and License
  113. -------------------
  114. The ``yarl`` package is written by Andrew Svetlov.
  115. It's *Apache 2* licensed and freely available.
  116. .. _GitHub: https://github.com/aio-libs/yarl
  117. .. _multidict: https://github.com/aio-libs/multidict
  118. CHANGES
  119. =======
  120. 1.3.0 (2018-12-11)
  121. ------------------
  122. * Fix annotations for ``query`` parameter (#207)
  123. * An incoming query sequence can have int variables (the same as for
  124. Mapping type) (#208)
  125. * Add ``URL.explicit_port`` property (#218)
  126. * Give a friendlier error when port cant be converted to int (#168)
  127. * ``bool(URL())`` now returns ``False`` (#272)
  128. 1.2.6 (2018-06-14)
  129. ------------------
  130. * Drop Python 3.4 trove classifier (#205)
  131. 1.2.5 (2018-05-23)
  132. ------------------
  133. * Fix annotations for ``build`` (#199)
  134. 1.2.4 (2018-05-08)
  135. ------------------
  136. * Fix annotations for ``cached_property`` (#195)
  137. 1.2.3 (2018-05-03)
  138. ------------------
  139. * Accept ``str`` subclasses in ``URL`` constructor (#190)
  140. 1.2.2 (2018-05-01)
  141. ------------------
  142. * Fix build
  143. 1.2.1 (2018-04-30)
  144. ------------------
  145. * Pin minimal required Python to 3.5.3 (#189)
  146. 1.2.0 (2018-04-30)
  147. ------------------
  148. * Forbid inheritance, replace ``__init__`` with ``__new__`` (#171)
  149. * Support PEP-561 (provide type hinting marker) (#182)
  150. 1.1.1 (2018-02-17)
  151. ------------------
  152. * Fix performance regression: don't encode enmpty netloc (#170)
  153. 1.1.0 (2018-01-21)
  154. ------------------
  155. * Make pure Python quoter consistent with Cython version (#162)
  156. 1.0.0 (2018-01-15)
  157. ------------------
  158. * Use fast path if quoted string does not need requoting (#154)
  159. * Speed up quoting/unquoting by ``_Quoter`` and ``_Unquoter`` classes (#155)
  160. * Drop ``yarl.quote`` and ``yarl.unquote`` public functions (#155)
  161. * Add custom string writer, reuse static buffer if available (#157)
  162. Code is 50-80 times faster than Pure Python version (was 4-5 times faster)
  163. * Don't recode IP zone (#144)
  164. * Support ``encoded=True`` in ``yarl.URL.build()`` (#158)
  165. * Fix updating query with multiple keys (#160)
  166. 0.18.0 (2018-01-10)
  167. -------------------
  168. * Fallback to IDNA 2003 if domain name is not IDNA 2008 compatible (#152)
  169. 0.17.0 (2017-12-30)
  170. -------------------
  171. * Use IDNA 2008 for domain name processing (#149)
  172. 0.16.0 (2017-12-07)
  173. -------------------
  174. * Fix raising ``TypeError`` by ``url.query_string()`` after
  175. ``url.with_query({})`` (empty mapping) (#141)
  176. 0.15.0 (2017-11-23)
  177. -------------------
  178. * Add ``raw_path_qs`` attribute (#137)
  179. 0.14.2 (2017-11-14)
  180. -------------------
  181. * Restore ``strict`` parameter as no-op in ``quote`` / ``unquote``
  182. 0.14.1 (2017-11-13)
  183. -------------------
  184. * Restore ``strict`` parameter as no-op for sake of compatibility with
  185. aiohttp 2.2
  186. 0.14.0 (2017-11-11)
  187. -------------------
  188. * Drop strict mode (#123)
  189. * Fix ``"ValueError: Unallowed PCT %"`` when there's a ``"%"`` in the url (#124)
  190. 0.13.0 (2017-10-01)
  191. -------------------
  192. * Document ``encoded`` parameter (#102)
  193. * Support relative urls like ``'?key=value'`` (#100)
  194. * Unsafe encoding for QS fixed. Encode ``;`` char in value param (#104)
  195. * Process passwords without user names (#95)
  196. 0.12.0 (2017-06-26)
  197. -------------------
  198. * Properly support paths without leading slash in ``URL.with_path()`` (#90)
  199. * Enable type annotation checks
  200. 0.11.0 (2017-06-26)
  201. -------------------
  202. * Normalize path (#86)
  203. * Clear query and fragment parts in ``.with_path()`` (#85)
  204. 0.10.3 (2017-06-13)
  205. -------------------
  206. * Prevent double URL args unquoting (#83)
  207. 0.10.2 (2017-05-05)
  208. -------------------
  209. * Unexpected hash behaviour (#75)
  210. 0.10.1 (2017-05-03)
  211. -------------------
  212. * Unexpected compare behaviour (#73)
  213. * Do not quote or unquote + if not a query string. (#74)
  214. 0.10.0 (2017-03-14)
  215. -------------------
  216. * Added ``URL.build`` class method (#58)
  217. * Added ``path_qs`` attribute (#42)
  218. 0.9.8 (2017-02-16)
  219. ------------------
  220. * Do not quote ``:`` in path
  221. 0.9.7 (2017-02-16)
  222. ------------------
  223. * Load from pickle without _cache (#56)
  224. * Percent-encoded pluses in path variables become spaces (#59)
  225. 0.9.6 (2017-02-15)
  226. ------------------
  227. * Revert backward incompatible change (BaseURL)
  228. 0.9.5 (2017-02-14)
  229. ------------------
  230. * Fix BaseURL rich comparison support
  231. 0.9.4 (2017-02-14)
  232. ------------------
  233. * Use BaseURL
  234. 0.9.3 (2017-02-14)
  235. ------------------
  236. * Added BaseURL
  237. 0.9.2 (2017-02-08)
  238. ------------------
  239. * Remove debug print
  240. 0.9.1 (2017-02-07)
  241. ------------------
  242. * Do not lose tail chars (#45)
  243. 0.9.0 (2017-02-07)
  244. ------------------
  245. * Allow to quote ``%`` in non strict mode (#21)
  246. * Incorrect parsing of query parameters with %3B (;) inside (#34)
  247. * Fix core dumps (#41)
  248. * tmpbuf - compiling error (#43)
  249. * Added ``URL.update_path()`` method
  250. * Added ``URL.update_query()`` method (#47)
  251. 0.8.1 (2016-12-03)
  252. ------------------
  253. * Fix broken aiohttp: revert back ``quote`` / ``unquote``.
  254. 0.8.0 (2016-12-03)
  255. ------------------
  256. * Support more verbose error messages in ``.with_query()`` (#24)
  257. * Don't percent-encode ``@`` and ``:`` in path (#32)
  258. * Don't expose ``yarl.quote`` and ``yarl.unquote``, these functions are
  259. part of private API
  260. 0.7.1 (2016-11-18)
  261. ------------------
  262. * Accept not only ``str`` but all classes inherited from ``str`` also (#25)
  263. 0.7.0 (2016-11-07)
  264. ------------------
  265. * Accept ``int`` as value for ``.with_query()``
  266. 0.6.0 (2016-11-07)
  267. ------------------
  268. * Explicitly use UTF8 encoding in setup.py (#20)
  269. * Properly unquote non-UTF8 strings (#19)
  270. 0.5.3 (2016-11-02)
  271. ------------------
  272. * Don't use namedtuple fields but indexes on URL construction
  273. 0.5.2 (2016-11-02)
  274. ------------------
  275. * Inline ``_encode`` class method
  276. 0.5.1 (2016-11-02)
  277. ------------------
  278. * Make URL construction faster by removing extra classmethod calls
  279. 0.5.0 (2016-11-02)
  280. ------------------
  281. * Add cython optimization for quoting/unquoting
  282. * Provide binary wheels
  283. 0.4.3 (2016-09-29)
  284. ------------------
  285. * Fix typing stubs
  286. 0.4.2 (2016-09-29)
  287. ------------------
  288. * Expose ``quote()`` and ``unquote()`` as public API
  289. 0.4.1 (2016-09-28)
  290. ------------------
  291. * Support empty values in query (``'/path?arg'``)
  292. 0.4.0 (2016-09-27)
  293. ------------------
  294. * Introduce ``relative()`` (#16)
  295. 0.3.2 (2016-09-27)
  296. ------------------
  297. * Typo fixes #15
  298. 0.3.1 (2016-09-26)
  299. ------------------
  300. * Support sequence of pairs as ``with_query()`` parameter
  301. 0.3.0 (2016-09-26)
  302. ------------------
  303. * Introduce ``is_default_port()``
  304. 0.2.1 (2016-09-26)
  305. ------------------
  306. * Raise ValueError for URLs like 'http://:8080/'
  307. 0.2.0 (2016-09-18)
  308. ------------------
  309. * Avoid doubling slashes when joining paths (#13)
  310. * Appending path starting from slash is forbidden (#12)
  311. 0.1.4 (2016-09-09)
  312. ------------------
  313. * Add kwargs support for ``with_query()`` (#10)
  314. 0.1.3 (2016-09-07)
  315. ------------------
  316. * Document ``with_query()``, ``with_fragment()`` and ``origin()``
  317. * Allow ``None`` for ``with_query()`` and ``with_fragment()``
  318. 0.1.2 (2016-09-07)
  319. ------------------
  320. * Fix links, tune docs theme.
  321. 0.1.1 (2016-09-06)
  322. ------------------
  323. * Update README, old version used obsolete API
  324. 0.1.0 (2016-09-06)
  325. ------------------
  326. * The library was deeply refactored, bytes are gone away but all
  327. accepted strings are encoded if needed.
  328. 0.0.1 (2016-08-30)
  329. ------------------
  330. * The first release.