METADATA 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. Metadata-Version: 2.1
  2. Name: soupsieve
  3. Version: 2.3.2.post1
  4. Summary: A modern CSS selector implementation for Beautiful Soup.
  5. Project-URL: Homepage, https://github.com/facelessuser/soupsieve
  6. Author-email: Isaac Muse <Isaac.Muse@gmail.com>
  7. Keywords: CSS,HTML,XML,filter,query,selector,soup
  8. Classifier: Development Status :: 5 - Production/Stable
  9. Classifier: Environment :: Console
  10. Classifier: Intended Audience :: Developers
  11. Classifier: License :: OSI Approved :: MIT License
  12. Classifier: Operating System :: OS Independent
  13. Classifier: Programming Language :: Python :: 3
  14. Classifier: Programming Language :: Python :: 3.10
  15. Classifier: Programming Language :: Python :: 3.7
  16. Classifier: Programming Language :: Python :: 3.8
  17. Classifier: Programming Language :: Python :: 3.9
  18. Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
  19. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  20. Classifier: Typing :: Typed
  21. Requires-Python: >=3.6
  22. Requires-Dist: backports-functools-lru-cache; python_version < '3'
  23. Description-Content-Type: text/markdown
  24. [![Donate via PayPal][donate-image]][donate-link]
  25. [![Discord][discord-image]][discord-link]
  26. [![Build][github-ci-image]][github-ci-link]
  27. [![Coverage Status][codecov-image]][codecov-link]
  28. [![PyPI Version][pypi-image]][pypi-link]
  29. [![PyPI - Python Version][python-image]][pypi-link]
  30. ![License][license-image-mit]
  31. # Soup Sieve
  32. ## Overview
  33. Soup Sieve is a CSS selector library designed to be used with [Beautiful Soup 4][bs4]. It aims to provide selecting,
  34. matching, and filtering using modern CSS selectors. Soup Sieve currently provides selectors from the CSS level 1
  35. specifications up through the latest CSS level 4 drafts and beyond (though some are not yet implemented).
  36. Soup Sieve was written with the intent to replace Beautiful Soup's builtin select feature, and as of Beautiful Soup
  37. version 4.7.0, it now is :confetti_ball:. Soup Sieve can also be imported in order to use its API directly for
  38. more controlled, specialized parsing.
  39. Soup Sieve has implemented most of the CSS selectors up through the latest CSS draft specifications, though there are a
  40. number that don't make sense in a non-browser environment. Selectors that cannot provide meaningful functionality simply
  41. do not match anything. Some of the supported selectors are:
  42. - `.classes`
  43. - `#ids`
  44. - `[attributes=value]`
  45. - `parent child`
  46. - `parent > child`
  47. - `sibling ~ sibling`
  48. - `sibling + sibling`
  49. - `:not(element.class, element2.class)`
  50. - `:is(element.class, element2.class)`
  51. - `parent:has(> child)`
  52. - and [many more](https://facelessuser.github.io/soupsieve/selectors/)
  53. ## Installation
  54. You must have Beautiful Soup already installed:
  55. ```
  56. pip install beautifulsoup4
  57. ```
  58. In most cases, assuming you've installed version 4.7.0, that should be all you need to do, but if you've installed via
  59. some alternative method, and Soup Sieve is not automatically installed, you can install it directly:
  60. ```
  61. pip install soupsieve
  62. ```
  63. If you want to manually install it from source, first ensure that [`build`](https://pypi.org/project/build/) is
  64. installed:
  65. ```
  66. pip install build
  67. ```
  68. Then navigate to the root of the project and build the wheel and install (replacing `<ver>` with the current version):
  69. ```
  70. python -m build -w
  71. pip install dist/soupsive-<ver>-py3-none-any.whl
  72. ```
  73. ## Documentation
  74. Documentation is found here: https://facelessuser.github.io/soupsieve/.
  75. ## License
  76. MIT License
  77. Copyright (c) 2018 - 2022 Isaac Muse <isaacmuse@gmail.com>
  78. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  79. documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
  80. rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
  81. persons to whom the Software is furnished to do so, subject to the following conditions:
  82. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
  83. Software.
  84. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  85. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  86. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  87. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  88. [bs4]: https://beautiful-soup-4.readthedocs.io/en/latest/#
  89. [github-ci-image]: https://github.com/facelessuser/soupsieve/workflows/build/badge.svg?branch=master&event=push
  90. [github-ci-link]: https://github.com/facelessuser/soupsieve/actions?query=workflow%3Abuild+branch%3Amaster
  91. [discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333
  92. [discord-link]:https://discord.gg/XBnPUZF
  93. [codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/soupsieve/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
  94. [codecov-link]: https://codecov.io/github/facelessuser/soupsieve
  95. [pypi-image]: https://img.shields.io/pypi/v/soupsieve.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
  96. [pypi-link]: https://pypi.python.org/pypi/soupsieve
  97. [python-image]: https://img.shields.io/pypi/pyversions/soupsieve?logo=python&logoColor=aaaaaa&labelColor=333333
  98. [license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333
  99. [donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal
  100. [donate-link]: https://www.paypal.me/facelessuser