{"id":22959849,"url":"https://github.com/pycasbin/redis-watcher","last_synced_at":"2025-08-25T05:21:36.322Z","repository":{"id":38021068,"uuid":"358541520","full_name":"pycasbin/redis-watcher","owner":"pycasbin","description":"Redis watcher for PyCasbin","archived":false,"fork":false,"pushed_at":"2024-03-29T11:14:32.000Z","size":30,"stargazers_count":10,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-30T04:35:18.250Z","etag":null,"topics":["abac","acl","auth","authorization","authz","casbin","permission","pycasbin","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/pycasbin.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,"zenodo":null}},"created_at":"2021-04-16T09:12:19.000Z","updated_at":"2024-04-25T04:46:32.000Z","dependencies_parsed_at":"2022-07-12T17:04:49.556Z","dependency_job_id":"45414ac2-da16-4790-b37c-ab4071ba2d52","html_url":"https://github.com/pycasbin/redis-watcher","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.4444444444444444,"last_synced_commit":"b5b723896309688d3e8b8b01a222984ad0b33ec5"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/pycasbin/redis-watcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycasbin%2Fredis-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycasbin%2Fredis-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycasbin%2Fredis-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycasbin%2Fredis-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pycasbin","download_url":"https://codeload.github.com/pycasbin/redis-watcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycasbin%2Fredis-watcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271382425,"owners_count":24750002,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","permission","pycasbin","python","rbac","redis","watcher"],"created_at":"2024-12-14T18:29:00.548Z","updated_at":"2025-08-25T05:21:36.303Z","avatar_url":"https://github.com/pycasbin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis-watcher\n\n[![GitHub Action](https://github.com/pycasbin/redis-watcher/workflows/build/badge.svg?branch=master)](https://github.com/pycasbin/redis-watcher/actions)\n[![Coverage Status](https://coveralls.io/repos/github/pycasbin/redis-watcher/badge.svg)](https://coveralls.io/github/pycasbin/redis-watcher)\n[![Version](https://img.shields.io/pypi/v/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/)\n[![Pyversions](https://img.shields.io/pypi/pyversions/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/)\n[![Download](https://img.shields.io/pypi/dm/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-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 casbin-redis-watcher\n\n## Simple Example\n\n```python\nimport os\nimport casbin\nfrom casbin_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%2Fpycasbin%2Fredis-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycasbin%2Fredis-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycasbin%2Fredis-watcher/lists"}