sqlobject-adapter


Namesqlobject-adapter JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummarySQLObject Adapter for PyCasbin
upload_time2025-08-21 01:25:00
maintainerNone
docs_urlNone
authorNone
requires_python>=3.4
licenseApache 2.0
keywords casbin sqlobject casbin-adapter rbac access control abac acl permission
VCS
bugtrack_url
requirements pycasbin SQLObject
Travis-CI No Travis.
coveralls test coverage No coveralls.
            SQLObject Adapter for PyCasbin
====

[![GitHub Action](https://github.com/officialpycasbin/sqlobject-adapter/workflows/build/badge.svg)](https://github.com/officialpycasbin/sqlobject-adapter/actions)
[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/sqlobject-adapter/badge.svg)](https://coveralls.io/github/officialpycasbin/sqlobject-adapter)
[![Version](https://img.shields.io/pypi/v/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)
[![Pyversions](https://img.shields.io/pypi/pyversions/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)
[![Download](https://static.pepy.tech/badge/sqlobject_adapter)](https://pypi.org/project/sqlobject_adapter/)
[![License](https://img.shields.io/pypi/l/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)

SQLObject Adapter is the [SQLObject](http://www.sqlobject.org/index.html) adapter for [PyCasbin](https://github.com/casbin/pycasbin). With this library, Casbin can load policy from SQLObject supported database or save policy to it.

The current supported databases are:

- PostgreSQL
- MySQL
- SQLite
- Microsoft SQL Server
- Firebird
- Sybase
- MAX DB
- pyfirebirdsql

## Installation

```
pip install sqlobject_adapter
```

## Simple Example

```python
import sqlobject_adapter
import casbin

adapter = sqlobject_adapter.Adapter('sqlite:///test.db')

e = casbin.Enforcer('path/to/model.conf', adapter, True)

sub = "alice"  # the user that wants to access a resource.
obj = "data1"  # the resource that is going to be accessed.
act = "read"  # the operation that the user performs on the resource.

if e.enforce(sub, obj, act):
    # permit alice to read data1casbin_sqlalchemy_adapter
    pass
else:
    # deny the request, show an error
    pass
```


### Getting Help

- [PyCasbin](https://github.com/casbin/pycasbin)

### License

This project is licensed under the [Apache 2.0 license](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sqlobject-adapter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.4",
    "maintainer_email": null,
    "keywords": "casbin, SQLObject, casbin-adapter, rbac, access control, abac, acl, permission",
    "author": null,
    "author_email": "Casbin <admin@casbin.org>",
    "download_url": "https://files.pythonhosted.org/packages/a7/62/bc0d156ffb87dc8a187c311ac2c84b5449d62ab2fdce9b971c38002b7334/sqlobject_adapter-0.5.0.tar.gz",
    "platform": null,
    "description": "SQLObject Adapter for PyCasbin\n====\n\n[![GitHub Action](https://github.com/officialpycasbin/sqlobject-adapter/workflows/build/badge.svg)](https://github.com/officialpycasbin/sqlobject-adapter/actions)\n[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/sqlobject-adapter/badge.svg)](https://coveralls.io/github/officialpycasbin/sqlobject-adapter)\n[![Version](https://img.shields.io/pypi/v/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)\n[![Pyversions](https://img.shields.io/pypi/pyversions/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)\n[![Download](https://static.pepy.tech/badge/sqlobject_adapter)](https://pypi.org/project/sqlobject_adapter/)\n[![License](https://img.shields.io/pypi/l/sqlobject_adapter.svg)](https://pypi.org/project/sqlobject_adapter/)\n\nSQLObject Adapter is the [SQLObject](http://www.sqlobject.org/index.html) adapter for [PyCasbin](https://github.com/casbin/pycasbin). With this library, Casbin can load policy from SQLObject supported database or save policy to it.\n\nThe current supported databases are:\n\n- PostgreSQL\n- MySQL\n- SQLite\n- Microsoft SQL Server\n- Firebird\n- Sybase\n- MAX DB\n- pyfirebirdsql\n\n## Installation\n\n```\npip install sqlobject_adapter\n```\n\n## Simple Example\n\n```python\nimport sqlobject_adapter\nimport casbin\n\nadapter = sqlobject_adapter.Adapter('sqlite:///test.db')\n\ne = casbin.Enforcer('path/to/model.conf', adapter, True)\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 data1casbin_sqlalchemy_adapter\n    pass\nelse:\n    # deny the request, show an error\n    pass\n```\n\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",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "SQLObject Adapter for PyCasbin",
    "version": "0.5.0",
    "project_urls": {
        "Home-page": "https://github.com/officialpycasbin/sqlobject-adapter"
    },
    "split_keywords": [
        "casbin",
        " sqlobject",
        " casbin-adapter",
        " rbac",
        " access control",
        " abac",
        " acl",
        " permission"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7be02550a4c5609fb839ed739df3c95f9e6042f2cea8a684081f7d678b75b6f3",
                "md5": "de1c54bd275faad1e72a981033d159a2",
                "sha256": "87c339595dfd0124ba15a13364564ec0b20e8db78cb73e0227eb1da225c1e775"
            },
            "downloads": -1,
            "filename": "sqlobject_adapter-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "de1c54bd275faad1e72a981033d159a2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.4",
            "size": 7476,
            "upload_time": "2025-08-21T01:24:59",
            "upload_time_iso_8601": "2025-08-21T01:24:59.067973Z",
            "url": "https://files.pythonhosted.org/packages/7b/e0/2550a4c5609fb839ed739df3c95f9e6042f2cea8a684081f7d678b75b6f3/sqlobject_adapter-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a762bc0d156ffb87dc8a187c311ac2c84b5449d62ab2fdce9b971c38002b7334",
                "md5": "882553b1b6a782349c7ebc6f5054e511",
                "sha256": "a2f067d728e882d598825d0608a617f1c169a7b1e16175659b686b1eeb2c8777"
            },
            "downloads": -1,
            "filename": "sqlobject_adapter-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "882553b1b6a782349c7ebc6f5054e511",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.4",
            "size": 7860,
            "upload_time": "2025-08-21T01:25:00",
            "upload_time_iso_8601": "2025-08-21T01:25:00.221686Z",
            "url": "https://files.pythonhosted.org/packages/a7/62/bc0d156ffb87dc8a187c311ac2c84b5449d62ab2fdce9b971c38002b7334/sqlobject_adapter-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 01:25:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "officialpycasbin",
    "github_project": "sqlobject-adapter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pycasbin",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "SQLObject",
            "specs": [
                [
                    ">=",
                    "3.8.0"
                ]
            ]
        }
    ],
    "lcname": "sqlobject-adapter"
}
        
Elapsed time: 1.58616s