{"id":13453007,"url":"https://github.com/Langenfeld/py-gitea","last_synced_at":"2025-03-24T00:32:47.199Z","repository":{"id":42664749,"uuid":"194881396","full_name":"Langenfeld/py-gitea","owner":"Langenfeld","description":"A Gitea-API wrapper in Python","archived":false,"fork":false,"pushed_at":"2024-01-18T09:18:47.000Z","size":168,"stargazers_count":46,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T12:12:34.176Z","etag":null,"topics":["api-client","gitea","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/Langenfeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-07-02T14:37:51.000Z","updated_at":"2024-06-27T00:03:31.319Z","dependencies_parsed_at":"2024-06-27T00:03:28.122Z","dependency_job_id":"2b5f000e-0d1b-4912-8bfb-11be1f28eff2","html_url":"https://github.com/Langenfeld/py-gitea","commit_stats":{"total_commits":227,"total_committers":15,"mean_commits":"15.133333333333333","dds":0.7048458149779735,"last_synced_commit":"3b8f04e31be7c2ded1e628aabc900aea01124ad5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Langenfeld%2Fpy-gitea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Langenfeld%2Fpy-gitea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Langenfeld%2Fpy-gitea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Langenfeld%2Fpy-gitea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Langenfeld","download_url":"https://codeload.github.com/Langenfeld/py-gitea/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191500,"owners_count":20575246,"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":["api-client","gitea","python"],"created_at":"2024-07-31T08:00:30.649Z","updated_at":"2025-03-24T00:32:46.934Z","avatar_url":"https://github.com/Langenfeld.png","language":"Python","funding_links":[],"categories":["SDK"],"sub_categories":["For internal use"],"readme":"# py-gitea\n\nA very simple API client for Gitea \u003e 1.16.1\n\nThis has been somewhat tested (and used), so most things should work as expected.\n\nNote that not the full Swagger-API is accessible. The whole implementation is focused\non making access and working with Organizations, Teams, Repositories and Users as pain\nfree as possible.\n\nOriginally forked from https://github.com/m301/py-gitea.\n\n## Usage\n\nFirst get a `gitea` object wrapping access and authentication (via an api token) for your gitea instance:\n\n```python\nfrom gitea import *\n\ngitea = Gitea(URL, TOKEN)\n```\n\nOperations like requesting the Gitea version or authentication user can be requested directly from the `gitea` object:\n\n```python\nprint(\"Gitea Version: \" + gitea.get_version())\nprint(\"API-Token belongs to user: \" + gitea.get_user().username)\n```\n\nAdding entities like Users, Organizations, ... also is done via the gitea object.\n\n```python\nuser = gitea.create_user(\"Test Testson\", \"test@test.test\", \"password\")\n```\n\nAll operations on entities in gitea are then accomplished via the according wrapper objects for those entities.\nEach of those objects has a `.request` method that creates an entity according to your gitea instance.\n\n```python\nother_user = User.request(gitea, \"OtherUserName\")\nprint(other_user.username)\n```\n\nNote that the fields of the User, Organization,... classes are dynamically created at runtime, and thus not visible\nduring divelopment. Refer to the Gitea-API documentation for the fields names.\n\nFields that can not be altered via gitea-api, are read only. After altering a field, the `.commit` method of the\naccording object must be called to synchronize the changed fields with your gitea instance.\n\n```python\norg = Organization.request(gitea, test_org)\norg.description = \"some new description\"\norg.location = \"some new location\"\norg.commit()\n```\n\nAn entity in gitea can be deleted by calling delete.\n\n```python\norg.delete()\n```\n\nAll entity objects do have methods to execute some of the requests possible though the gitea-api:\n\n```python\norg = Organization.request(gitea, ORGNAME)\nteams = org.get_teams()\nfor team in teams:\n    repos = team.get_repos()\n    for repo in repos:\n        print(repo.name)\n```\n\n## Installation\n\nUse ``pip install py-gitea`` to install.\n\n## Tests\n\nTests can be run with:\n\n```python3 -m pytest test_api.py```\n\nMake sure to have a gitea-instance running on `http://localhost:3000`, and an admin-user token at `.token`.\nThe admin user must be named ``test``, with email ``secondarytest@test.org``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLangenfeld%2Fpy-gitea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLangenfeld%2Fpy-gitea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLangenfeld%2Fpy-gitea/lists"}