A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

70 Zeilen
2.3 KiB

  1. MWParserFromHell v\ |version| Documentation
  2. ===========================================
  3. :mod:`mwparserfromhell` (the *MediaWiki Parser from Hell*) is a Python package
  4. that provides an easy-to-use and outrageously powerful parser for MediaWiki_
  5. wikicode. It supports Python 3.9+.
  6. Developed by Earwig_ with contributions from `Σ`_, Legoktm_, and others.
  7. Development occurs on GitHub_.
  8. .. _MediaWiki: https://www.mediawiki.org
  9. .. _Earwig: https://en.wikipedia.org/wiki/User:The_Earwig
  10. .. _Σ: https://en.wikipedia.org/wiki/User:%CE%A3
  11. .. _Legoktm: https://en.wikipedia.org/wiki/User:Legoktm
  12. .. _GitHub: https://github.com/earwig/mwparserfromhell
  13. Installation
  14. ------------
  15. The easiest way to install the parser is from `PyPI`_; you can install the
  16. latest release with ``pip install mwparserfromhell``.
  17. Prebuilt wheels are available on PyPI with a fast, compiled C tokenizer
  18. extension for most environments (Linux x86_64 and arm64, macOS x86_64 and
  19. arm64, Windows x86 and x86_64). If building from source and the C tokenizer
  20. cannot be built, you can fall back to the slower pure-Python implementation by
  21. setting the environment variable ``WITH_EXTENSION=0`` when installing.
  22. To get the latest development version (with `uv`_)::
  23. git clone https://github.com/earwig/mwparserfromhell.git
  24. cd mwparserfromhell
  25. uv sync
  26. uv run python -c 'import mwparserfromhell; print(mwparserfromhell.__version__)'
  27. The comprehensive test suite can be run with ``pytest``. If using ``uv``, pass
  28. ``--reinstall-package`` so updates to the extension module are properly tested::
  29. uv run --reinstall-package mwparserfromhell pytest
  30. .. note::
  31. To see if the fast C tokenizer is being used, check the value of
  32. ``mwparserfromhell.parser.use_c``. If ``True``, it's being used; if
  33. ``False``, the Python fallback is being used.
  34. .. _PyPI: https://pypi.org/project/mwparserfromhell/
  35. .. _uv: https://docs.astral.sh/uv/
  36. .. _pytest: https://docs.pytest.org/
  37. Contents
  38. --------
  39. .. toctree::
  40. :maxdepth: 2
  41. usage
  42. limitations
  43. integration
  44. changelog
  45. API Reference <api/modules>
  46. Indices and tables
  47. ------------------
  48. * :ref:`genindex`
  49. * :ref:`modindex`
  50. * :ref:`search`