{"id":20035808,"url":"https://github.com/officialpycasbin/async-sqlalchemy-adapter","last_synced_at":"2025-04-13T15:41:22.628Z","repository":{"id":262364715,"uuid":"887012608","full_name":"officialpycasbin/async-sqlalchemy-adapter","owner":"officialpycasbin","description":"Async SQLAlchemy Adapter for PyCasbin","archived":false,"fork":false,"pushed_at":"2024-12-18T03:07:07.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T06:34:44.976Z","etag":null,"topics":["abac","acl","adapter","async","auth","authorization","authz","casbin","database","db","py","pycasbin","python","rbac","sqlalchemy"],"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:34:02.000Z","updated_at":"2024-12-18T03:07:09.000Z","dependencies_parsed_at":"2024-11-12T03:27:35.222Z","dependency_job_id":"8cd32439-95e7-4e6d-b0ee-388e32dea5ba","html_url":"https://github.com/officialpycasbin/async-sqlalchemy-adapter","commit_stats":null,"previous_names":["officialpycasbin/async-sqlalchemy-adapter"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fasync-sqlalchemy-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fasync-sqlalchemy-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fasync-sqlalchemy-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/officialpycasbin%2Fasync-sqlalchemy-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/officialpycasbin","download_url":"https://codeload.github.com/officialpycasbin/async-sqlalchemy-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248739881,"owners_count":21154247,"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","adapter","async","auth","authorization","authz","casbin","database","db","py","pycasbin","python","rbac","sqlalchemy"],"created_at":"2024-11-13T10:09:21.032Z","updated_at":"2025-04-13T15:41:22.607Z","avatar_url":"https://github.com/officialpycasbin.png","language":"Python","readme":"async-sqlalchemy-adapter\n====\n\n[![GitHub Actions](https://github.com/officialpycasbin/async-sqlalchemy-adapter/workflows/build/badge.svg?branch=master)](https://github.com/officialpycasbin/async-sqlalchemy-adapter/actions)\n[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/async-sqlalchemy-adapter/badge.svg)](https://coveralls.io/github/officialpycasbin/async-sqlalchemy-adapter)\n[![Version](https://img.shields.io/pypi/v/casbin_async_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_async_sqlalchemy_adapter/)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin_async_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_async_sqlalchemy_adapter/)\n[![Pyversions](https://img.shields.io/pypi/pyversions/casbin_async_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_async_sqlalchemy_adapter/)\n[![Download](https://img.shields.io/pypi/dm/casbin_async_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_async_sqlalchemy_adapter/)\n[![License](https://img.shields.io/pypi/l/casbin_async_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_async_sqlalchemy_adapter/)\n\nAsynchronous SQLAlchemy Adapter is the [SQLAlchemy](https://www.sqlalchemy.org) adapter for [PyCasbin](https://github.com/casbin/pycasbin). With this library, Casbin can load policy from SQLAlchemy supported database or save policy to it.\n\nBased on [Officially Supported Databases](http://www.sqlalchemy.org/), The current supported databases are:\n\n- PostgreSQL\n- MySQL\n- MariaDB\n- SQLite\n- Oracle\n- Microsoft SQL Server\n- Firebird\n\n## Installation\n\n```\npip install casbin_async_sqlalchemy_adapter\n```\n\n## Simple Example\n\n```python\nimport casbin_async_sqlalchemy_adapter\nimport casbin\n\nadapter = casbin_async_sqlalchemy_adapter.Adapter('sqlite+aiosqlite:///test.db')\n\n# or mysql example \n# adapter = casbin_async_sqlalchemy_adapter.Adapter('mysql+aiomysql://user:pwd@127.0.0.1:3306/exampledb')\n\ne = casbin.AsyncEnforcer('path/to/model.conf', adapter)\n\nsub = \"alice\"  # the user that wants to access a resource.\nobj = \"data1\"  # the resource that is going to be accessed.\nact = \"read\"  # the operation that the user performs on the resource.\n\nif e.enforce(sub, obj, act):\n    # permit alice to read data1\n    pass\nelse:\n    # deny the request, show an error\n    pass\n```\n\n\u003e Note that AsyncAdaper must be used for AynscEnforcer.\n\n### Getting Help\n\n- [PyCasbin](https://github.com/casbin/pycasbin)\n\n### License\n\nThis project is licensed under the [Apache 2.0 license](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficialpycasbin%2Fasync-sqlalchemy-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofficialpycasbin%2Fasync-sqlalchemy-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficialpycasbin%2Fasync-sqlalchemy-adapter/lists"}