{"id":16959495,"url":"https://github.com/crdoconnor/patrol","last_synced_at":"2025-04-11T22:10:31.351Z","repository":{"id":31670758,"uuid":"35236234","full_name":"crdoconnor/patrol","owner":"crdoconnor","description":"Trigger custom commands from filesystem events.","archived":false,"fork":false,"pushed_at":"2015-07-26T03:51:13.000Z","size":164,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T14:04:54.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crdoconnor.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-07T18:21:57.000Z","updated_at":"2023-08-04T11:58:07.000Z","dependencies_parsed_at":"2022-08-29T09:01:39.298Z","dependency_job_id":null,"html_url":"https://github.com/crdoconnor/patrol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crdoconnor%2Fpatrol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crdoconnor%2Fpatrol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crdoconnor%2Fpatrol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crdoconnor%2Fpatrol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crdoconnor","download_url":"https://codeload.github.com/crdoconnor/patrol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487696,"owners_count":21112191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T22:45:07.391Z","updated_at":"2025-04-11T22:10:31.308Z","avatar_url":"https://github.com/crdoconnor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Patrol\n======\n\nTrigger methods from changed files - e.g. selectively rebuild your project or\nrun tests as soon as you hit the save button on your text editor or IDE.\n\nPatrol works well with ProjectKey_.\n\n\nUse\n===\n\nTo install::\n\n    pip install patrol\n\nExample code:\n\n.. code-block:: python\n\n    import patrol\n\n    def build(filenames):\n        touch(\"output/build_started\")\n        time.sleep(2)\n        touch(\"output/build_finished\")\n\n    def run_test(filenames):\n        touch(\"output/test_started\")\n        time.sleep(30)\n        touch(\"output/test_finished\")\n\n    patrol.watch([\n            patrol.Trigger(\n                build,\n                includes=[\"data/*\", ],\n                excludes=['data/exclude/*', 'output/*', ],\n            ),\n            patrol.Trigger(\n                run_test,\n                includes=[\"data/*\", ],\n                excludes=['data/exclude/*', 'output/*', ],\n                reaper=patrol.Reaper(),         # If triggered while method is in progress, this will stop it and start it again.\n                fire_on_initialization=True,    # When the watch is initiated, this trigger will also fire.\n            ),\n        ],\n        directory=os.getcwd(),            # By default it patrols the present working directory.\n        lockfiles=[\".git/index.lock\", ],  # This will wait until git has finished its operations before firing any triggers\n    )\n\n\n\nFeatures\n========\n\n* Patrol does not use polling to detect file changes. It uses libuv_, which creates event driven hooks to filesystem events using epoll, kqueue or IOCP.\n* You can queue up triggers when a specified lockfile is present - e.g. you can use to prevent triggers from firing until git operations are done.\n* Patrol comes with a customized Reaper class that can be used to specify how a process is stopped.\n\n.. _ProjectKey: https://github.com/crdoconnor/projectkey\n\n.. _libuv: https://github.com/libuv/libuv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrdoconnor%2Fpatrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrdoconnor%2Fpatrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrdoconnor%2Fpatrol/lists"}