{"id":22559619,"url":"https://github.com/xefi/python-entitled","last_synced_at":"2025-04-06T12:11:58.322Z","repository":{"id":231688875,"uuid":"771439484","full_name":"xefi/python-entitled","owner":"xefi","description":"A Simple Python Library for Authorizations","archived":false,"fork":false,"pushed_at":"2025-03-03T23:49:17.000Z","size":128,"stargazers_count":117,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T11:09:29.721Z","etag":null,"topics":["authorization","permissions","python"],"latest_commit_sha":null,"homepage":"https://python-entitled.xefi.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xefi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-03-13T09:55:31.000Z","updated_at":"2025-03-11T08:58:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"50dab93a-b026-4c07-85d2-7cd032a42e97","html_url":"https://github.com/xefi/python-entitled","commit_stats":null,"previous_names":["xefi/python-entitled"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xefi%2Fpython-entitled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xefi%2Fpython-entitled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xefi%2Fpython-entitled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xefi%2Fpython-entitled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xefi","download_url":"https://codeload.github.com/xefi/python-entitled/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"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":["authorization","permissions","python"],"created_at":"2024-12-07T21:07:42.375Z","updated_at":"2025-04-06T12:11:58.301Z","avatar_url":"https://github.com/xefi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![versions](https://img.shields.io/badge/python-3.12-blue.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nAn authorization library for Python.\n\nAims to provide the tools to organize, enforce and audit your authorization layer as easily as possible, letting you focus on the essential part: the actual rules.\n\n## Documentation\n\nFor the full documentation, go [here](https://python-entitled.xefi.com/)\n\n## A sneak peek...\n\n```py\nfrom entitled import Policy, Client\n\n# Some actors and resources of your application...\nclass User:\n    def __init__(self, id: int, role: str):\n        self.id: str = id\n        self.role: str = role\n\nclass Resource:\n    def __init__(self, id: int, user: User):\n        self.id: str = id\n        self.owner: User = user\n\nmy_policy = Policy[Resource](\"resource\") # Defining a policy for your resource\n\n@my_policy.rule(\"edit\")# Declaring a rule on the resource\ndef can_edit(\n    actor: User, resource: Resource, context = None\n        ) -\u003e bool:\n    return actor == resource.owner or actor.role == \"admin\"\n\nclient = Client()\nclient.register(my_policy) # Registering a policy\n\nuser1 = User(1, \"user\")\nresource1 = Resource(1, user1)\nif client.allows(\"edit\", user1, resource1): # Using the client to make auth decisions\n    ...\n```\n## Support us\n\n\u003cp\u003e\u003ca href=\"https://www.xefi.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/xefi/art/main/support-landscape.svg\" width=\"400\"\u003e\u003c/a\u003e\u003c/p\u003e\n\nSince 1997, XEFI is a leader in IT performance support for small and medium-sized businesses through its nearly 200 local agencies based in France, Belgium, Switzerland and Spain.\nA one-stop shop for IT, office automation, software, [digitalization](https://www.xefi.com/solutions-software/), print and cloud needs.\n[Want to work with us ?](https://carriere.xefi.fr/metiers-software)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxefi%2Fpython-entitled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxefi%2Fpython-entitled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxefi%2Fpython-entitled/lists"}