aionotify


Nameaionotify JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/rbarrois/aionotify
SummaryAsyncio-powered inotify library
upload_time2024-02-02 13:24:30
maintainer
docs_urlNone
authorRaphaël Barrois
requires_python>=3.8
licenseBSD
keywords asyncio inotify
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            aionotify
=========

.. image:: https://img.shields.io/pypi/v/aionotify.svg
    :target: https://pypi.python.org/pypi/aionotify/
    :alt: Latest Version

.. image:: https://img.shields.io/pypi/pyversions/aionotify.svg
    :target: https://pypi.python.org/pypi/aionotify/
    :alt: Supported Python versions

.. image:: https://img.shields.io/pypi/wheel/aionotify.svg
    :target: https://pypi.python.org/pypi/aionotify/
    :alt: Wheel status

.. image:: https://img.shields.io/pypi/l/aionotify.svg
    :target: https://pypi.python.org/pypi/aionotify/
    :alt: License


``aionotify`` is a simple, asyncio-based inotify library.


Its use is quite simple:

.. code-block:: python

    import asyncio
    import aionotify

    # Setup the watcher
    watcher = aionotify.Watcher()
    watcher.watch(alias='logs', path='/var/log', flags=aionotify.Flags.MODIFY)

    async def work():
        await watcher.setup()
        for _i in range(10):
            # Pick the 10 first events
            event = await watcher.get_event()
            print(event)
        watcher.close()

    asyncio.run(work())


Links
-----

* Code at https://github.com/rbarrois/aionotify
* Package at https://pypi.python.org/pypi/aionotify/
* Continuous integration at https://travis-ci.org/rbarrois/aionotify/


Events
------

An event is a simple object with a few attributes:

* ``name``: the path of the modified file
* ``flags``: the modification flag; use ``aionotify.Flags.parse()`` to retrieve a list of individual values.
* ``alias``: the alias of the watch triggering the event
* ``cookie``: for renames, this integer value links the "renamed from" and "renamed to" events.


Watches
-------

``aionotify`` uses a system of "watches", similar to inotify.

A watch may have an alias; by default, it uses the path name:

.. code-block:: python

    watcher = aionotify.Watcher()
    watcher.watch('/var/log', flags=aionotify.Flags.MODIFY)

    # Similar to:
    watcher.watch('/var/log', flags=aionotify.Flags.MODIFY, alias='/var/log')


A watch can be removed by using its alias:

.. code-block:: python

    watcher = aionotify.Watcher()
    watcher.watch('/var/log', flags=aionotify.Flags.MODIFY)

    watcher.unwatch('/var/log')

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rbarrois/aionotify",
    "name": "aionotify",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "asyncio,inotify",
    "author": "Rapha\u00ebl Barrois",
    "author_email": "raphael.barrois+aionotify@polytechnique.org",
    "download_url": "https://files.pythonhosted.org/packages/0d/13/ce14b7c30633f479af58ff2b22d8fd88d923f58436319e7ec0633f9e638b/aionotify-0.3.0.tar.gz",
    "platform": null,
    "description": "aionotify\n=========\n\n.. image:: https://img.shields.io/pypi/v/aionotify.svg\n    :target: https://pypi.python.org/pypi/aionotify/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/pyversions/aionotify.svg\n    :target: https://pypi.python.org/pypi/aionotify/\n    :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/wheel/aionotify.svg\n    :target: https://pypi.python.org/pypi/aionotify/\n    :alt: Wheel status\n\n.. image:: https://img.shields.io/pypi/l/aionotify.svg\n    :target: https://pypi.python.org/pypi/aionotify/\n    :alt: License\n\n\n``aionotify`` is a simple, asyncio-based inotify library.\n\n\nIts use is quite simple:\n\n.. code-block:: python\n\n    import asyncio\n    import aionotify\n\n    # Setup the watcher\n    watcher = aionotify.Watcher()\n    watcher.watch(alias='logs', path='/var/log', flags=aionotify.Flags.MODIFY)\n\n    async def work():\n        await watcher.setup()\n        for _i in range(10):\n            # Pick the 10 first events\n            event = await watcher.get_event()\n            print(event)\n        watcher.close()\n\n    asyncio.run(work())\n\n\nLinks\n-----\n\n* Code at https://github.com/rbarrois/aionotify\n* Package at https://pypi.python.org/pypi/aionotify/\n* Continuous integration at https://travis-ci.org/rbarrois/aionotify/\n\n\nEvents\n------\n\nAn event is a simple object with a few attributes:\n\n* ``name``: the path of the modified file\n* ``flags``: the modification flag; use ``aionotify.Flags.parse()`` to retrieve a list of individual values.\n* ``alias``: the alias of the watch triggering the event\n* ``cookie``: for renames, this integer value links the \"renamed from\" and \"renamed to\" events.\n\n\nWatches\n-------\n\n``aionotify`` uses a system of \"watches\", similar to inotify.\n\nA watch may have an alias; by default, it uses the path name:\n\n.. code-block:: python\n\n    watcher = aionotify.Watcher()\n    watcher.watch('/var/log', flags=aionotify.Flags.MODIFY)\n\n    # Similar to:\n    watcher.watch('/var/log', flags=aionotify.Flags.MODIFY, alias='/var/log')\n\n\nA watch can be removed by using its alias:\n\n.. code-block:: python\n\n    watcher = aionotify.Watcher()\n    watcher.watch('/var/log', flags=aionotify.Flags.MODIFY)\n\n    watcher.unwatch('/var/log')\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Asyncio-powered inotify library",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/rbarrois/aionotify"
    },
    "split_keywords": [
        "asyncio",
        "inotify"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87a01ec32fb3285e4c1fe81d9d028dc38646b4e1b7221aba445299e2e15bd404",
                "md5": "dc6090a531726039b86cbc520802805f",
                "sha256": "dbf16208c958263db24596d12798dc743a99650514d9e79d1d533045104810db"
            },
            "downloads": -1,
            "filename": "aionotify-0.3.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc6090a531726039b86cbc520802805f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 7432,
            "upload_time": "2024-02-02T13:24:28",
            "upload_time_iso_8601": "2024-02-02T13:24:28.359284Z",
            "url": "https://files.pythonhosted.org/packages/87/a0/1ec32fb3285e4c1fe81d9d028dc38646b4e1b7221aba445299e2e15bd404/aionotify-0.3.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d13ce14b7c30633f479af58ff2b22d8fd88d923f58436319e7ec0633f9e638b",
                "md5": "1c1e9be5973dedeee3c514e17286ed1f",
                "sha256": "e4e5286a9c84a0b4b9e7f7a382589be196878382d6a3d34b3fcaa062cf4d428e"
            },
            "downloads": -1,
            "filename": "aionotify-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1c1e9be5973dedeee3c514e17286ed1f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11250,
            "upload_time": "2024-02-02T13:24:30",
            "upload_time_iso_8601": "2024-02-02T13:24:30.207480Z",
            "url": "https://files.pythonhosted.org/packages/0d/13/ce14b7c30633f479af58ff2b22d8fd88d923f58436319e7ec0633f9e638b/aionotify-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 13:24:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rbarrois",
    "github_project": "aionotify",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "aionotify"
}
        
Elapsed time: 0.20320s