{"id":17144047,"url":"https://github.com/razerm/pg_grant","last_synced_at":"2025-04-13T11:12:03.506Z","repository":{"id":57452122,"uuid":"106060717","full_name":"RazerM/pg_grant","owner":"RazerM","description":"Python library to parse PostgreSQL privileges","archived":false,"fork":false,"pushed_at":"2024-01-07T00:22:41.000Z","size":162,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T11:11:59.663Z","etag":null,"topics":["postgresql","postgresql-database","privileges","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RazerM.png","metadata":{"files":{"readme":"README.rst","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":"2017-10-07T00:21:33.000Z","updated_at":"2023-11-10T11:53:43.000Z","dependencies_parsed_at":"2024-10-14T20:43:05.517Z","dependency_job_id":"4581c47c-348f-4fca-b5b1-aa387ffab591","html_url":"https://github.com/RazerM/pg_grant","commit_stats":{"total_commits":151,"total_committers":1,"mean_commits":151.0,"dds":0.0,"last_synced_commit":"efde25eccbc5fee99a995f2ea42ef42e82b947e5"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RazerM%2Fpg_grant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RazerM%2Fpg_grant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RazerM%2Fpg_grant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RazerM%2Fpg_grant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RazerM","download_url":"https://codeload.github.com/RazerM/pg_grant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703199,"owners_count":21148118,"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":["postgresql","postgresql-database","privileges","python"],"created_at":"2024-10-14T20:42:57.684Z","updated_at":"2025-04-13T11:12:03.485Z","avatar_url":"https://github.com/RazerM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pg_grant\n-------------\n\n|PyPI Version| |Documentation| |Coverage| |Python Version| |PostgreSQL Version| |License|\n\n``pg_grant`` is a Python module for parsing, querying, and updating PostgreSQL\nprivileges.\n\nInstallation\n~~~~~~~~~~~~\n\n.. code:: bash\n\n    $ pip install pg_grant[sqlalchemy]\n\nWithout the SQLAlchemy extra, ``pg_grant`` can only parse access privileges.\n\nExample\n~~~~~~~\n\n.. code:: pycon\n\n    \u003e\u003e\u003e from pg_grant import parse_acl_item\n    \u003e\u003e\u003e parse_acl_item(\"bob=arw*/alice\")\n    Privileges(grantee='bob', grantor='alice', privs=['SELECT', 'INSERT'], privswgo=['UPDATE'])\n\n    \u003e\u003e\u003e from sqlalchemy import create_engine\n    \u003e\u003e\u003e from pg_grant.query import get_table_acl\n    \u003e\u003e\u003e engine = create_engine(\"postgresql://...\")\n    \u003e\u003e\u003e with engine.connect() as conn:\n    ...     get_table_acl(conn, \"table2\")\n    ...\n    SchemaRelationInfo(oid=138067, name='table2', owner='alice', acl=['alice=arwdDxt/alice', 'bob=arwdDxt/alice'], schema='public')\n\n    \u003e\u003e\u003e from pg_grant import PgObjectType\n    \u003e\u003e\u003e from pg_grant.sql import revoke\n    \u003e\u003e\u003e stmt = revoke([\"SELECT\"], PgObjectType.TABLE, \"table2\", \"bob\")\n    \u003e\u003e\u003e str(stmt)\n    'REVOKE SELECT ON TABLE table2 FROM bob'\n    \u003e\u003e\u003e engine.execute(stmt)\n\nAuthors\n~~~~~~~\n- Frazer McLean \u003cfrazer@frazermclean.co.uk\u003e\n\nDocumentation\n~~~~~~~~~~~~~\n\nFor in-depth information, `visit the\ndocumentation \u003chttps://pg-grant.readthedocs.org/en/latest/\u003e`__!\n\nDevelopment\n~~~~~~~~~~~\n\npg_grant uses `semantic versioning \u003chttp://semver.org\u003e`__\n\n.. |PyPI Version| image:: http://img.shields.io/pypi/v/pg_grant.svg?style=flat-square\u0026label=PyPI\n    :target: https://pypi.python.org/pypi/pg_grant/\n.. |Python Version| image:: https://img.shields.io/badge/Python-3-brightgreen.svg?style=flat-square\n    :target: https://www.python.org/downloads/\n.. |PostgreSQL Version| image:: https://img.shields.io/badge/PostgreSQL-9.5--12-blue.svg?style=flat-square\n    :target: https://www.postgresql.org/\n.. |License| image:: https://img.shields.io/github/license/RazerM/pg_grant.svg?style=flat-square\n    :target: https://raw.githubusercontent.com/RazerM/pg_grant/master/LICENSE.txt\n.. |Coverage| image:: https://img.shields.io/codecov/c/github/RazerM/pg_grant/master.svg?style=flat-square\n    :target: https://codecov.io/github/RazerM/pg_grant?branch=master\n.. |Documentation| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat-square\n    :target: https://pg-grant.readthedocs.org/en/latest/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazerm%2Fpg_grant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazerm%2Fpg_grant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazerm%2Fpg_grant/lists"}