{"id":20035815,"url":"https://github.com/officialpycasbin/redis-watcher","last_synced_at":"2025-09-19T11:17:27.823Z","repository":{"id":262362383,"uuid":"887004843","full_name":"officialpycasbin/redis-watcher","owner":"officialpycasbin","description":"Redis watcher for PyCasbin","archived":false,"fork":false,"pushed_at":"2024-11-12T02:16:11.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T20:54:04.903Z","etag":null,"topics":["abac","acl","auth","authorization","authz","casbin","middleware","py","pycasbin","pyredis","python","rbac","redis","watcher"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/pycasbin","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/officialpycasbin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-12T02:07:28.000Z","updated_at":"2024-11-12T02:16:13.000Z","dependencies_parsed_at":"2024-11-12T03:19:36.547Z","dependency_job_id":"dc3621de-6084-44bb-9772-c543fe9532c4","html_url":"https://github.com/officialpycasbin/redis-watcher","commit_stats":null,"previous_names":["officialpycasbin/redis-watcher"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fredis-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fredis-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fredis-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fredis-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/officialpycasbin","download_url":"https://codeload.github.com/officialpycasbin/redis-watcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235497424,"owners_count":18999659,"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":["abac","acl","auth","authorization","authz","casbin","middleware","py","pycasbin","pyredis","python","rbac","redis","watcher"],"created_at":"2024-11-13T10:09:22.143Z","updated_at":"2025-09-19T11:17:27.806Z","avatar_url":"https://github.com/officialpycasbin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis-watcher\n\n[![build](https://github.com/officialpycasbin/redis-watcher/actions/workflows/release.yml/badge.svg)](https://github.com/officialpycasbin/redis-watcher/actions/workflows/release.yml)\n[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/redis-watcher/badge.svg)](https://coveralls.io/github/officialpycasbin/redis-watcher)\n[![Version](https://img.shields.io/pypi/v/redis-watcher.svg)](https://pypi.org/project/redis-watcher/)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/redis-watcher.svg)](https://pypi.org/project/redis-watcher/)\n[![Pyversions](https://img.shields.io/pypi/pyversions/redis-watcher.svg)](https://pypi.org/project/redis-watcher/)\n[![Download](https://static.pepy.tech/badge/redis-watcher)](https://pypi.org/project/redis-watcher/)\n[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord\u0026label=discord\u0026color=5865F2)](https://discord.gg/S5UjpzGZjN)\n\nredis-watcher is the [Redis](https://github.com/redis/redis) watcher for [pycasbin](https://github.com/casbin/pycasbin). With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.\n\n## Installation\n\n    pip install redis-watcher\n\n## Simple Example\n\n```python\nimport os\nimport casbin\nfrom redis_watcher import new_watcher, WatcherOptions\n\ndef callback_function(event):\n    print(\"update for remove filtered policy callback, event: {}\".format(event))\n\ndef get_examples(path):\n    examples_path = os.path.split(os.path.realpath(__file__))[0] + \"/../examples/\"\n    return os.path.abspath(examples_path + path)\n\nif __name__ == \"main\":\n    test_option = WatcherOptions()\n    test_option.host = \"localhost\"\n    test_option.port = \"6379\"\n    test_option.channel = \"test\"\n    test_option.ssl = False\n    test_option.optional_update_callback = callback_function\n    w = new_watcher(test_option)\n    \n    e = casbin.Enforcer(\n        get_examples(\"rbac_model.conf\"), get_examples(\"rbac_policy.csv\")\n    )\n    e.set_watcher(w)\n    # then the callback function will be called when the policy is updated.\n    e.save_policy()\n   \n```\n\n## Getting Help\n\n- [pycasbin](https://github.com/casbin/pycasbin)\n\n## License\n\nThis project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficialpycasbin%2Fredis-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofficialpycasbin%2Fredis-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficialpycasbin%2Fredis-watcher/lists"}