<commit_before>:py:mod:`pyudev` – pyudev API
=============================

.. automodule:: pyudev
   :platform: Linux
   :synopsis: libudev bindings


Module contents
---------------

.. toctree::

   context
   device
   monitor
   toolkit<commit_msg>Document __version__ as part of public API<commit_after>:py:mod:`pyudev` – pyudev API
=============================

.. automodule:: pyudev
   :platform: Linux
   :synopsis: libudev bindings


Module contents
---------------

.. toctree::

   context
   device
   monitor
   toolkit


Other attributes
----------------

.. data:: __version__

   The version of :mod:`pyudev` as string.  This string contains a major and a
   minor version number, and optionally a revision in the form
   ``major.minor.revision``.  As said, the ``revision`` part is optional and
   may not be present.

   This attribute is mainly intended for display purposes, but should you
   really need to check the version of :mod:`pyudev`, you can use something
   like this::

      version = tuple(map(int, pyudev.__version__.split('.')[:2]))
      assert version >= (0, 8)
{'fraction_non_alphanumeric': 0.17967332123411978, 'fraction_numerical': 0.0027223230490018148, 'mean_word_length': 2.996376811594203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3990056', 'n_tokens_mistral': 328, 'n_tokens_neox': 313, 'n_words': 113}