{"id":15679339,"url":"https://github.com/knugihk/synapse-admin-api-python","last_synced_at":"2025-05-07T09:43:12.985Z","repository":{"id":57440123,"uuid":"303618506","full_name":"KnugiHK/synapse-admin-api-python","owner":"KnugiHK","description":"A Python wrapper for Matrix Synapse admin API","archived":false,"fork":false,"pushed_at":"2024-06-08T10:42:48.000Z","size":11701,"stargazers_count":13,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T20:17:22.927Z","etag":null,"topics":["admin","admin-api","administration","administration-tools","management","matrix","matrix-synapse","matrix-synapse-homeserver","matrix-synapse-server","python","python-wrapper","python3","synapse"],"latest_commit_sha":null,"homepage":"","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/KnugiHK.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}},"created_at":"2020-10-13T07:11:04.000Z","updated_at":"2024-11-27T04:06:56.000Z","dependencies_parsed_at":"2023-01-21T21:23:12.388Z","dependency_job_id":null,"html_url":"https://github.com/KnugiHK/synapse-admin-api-python","commit_stats":{"total_commits":365,"total_committers":3,"mean_commits":"121.66666666666667","dds":0.005479452054794498,"last_synced_commit":"94816befdec387b907476fbda30896d76720a26d"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2Fsynapse-admin-api-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2Fsynapse-admin-api-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2Fsynapse-admin-api-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2Fsynapse-admin-api-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnugiHK","download_url":"https://codeload.github.com/KnugiHK/synapse-admin-api-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252852654,"owners_count":21814392,"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":["admin","admin-api","administration","administration-tools","management","matrix","matrix-synapse","matrix-synapse-homeserver","matrix-synapse-server","python","python-wrapper","python3","synapse"],"created_at":"2024-10-03T16:29:12.370Z","updated_at":"2025-05-07T09:43:12.955Z","avatar_url":"https://github.com/KnugiHK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Synapse-admin-api-python\n[![Pypi](https://img.shields.io/pypi/v/matrix-synapse-admin?label=Pypi)](https://pypi.org/project/matrix-synapse-admin/)\n[![License MIT](https://img.shields.io/pypi/l/matrix-synapse-admin)](https://github.com/KnugiHK/synapse-admin-api-python/blob/main/LICENSE)\n[![Python](https://img.shields.io/pypi/pyversions/matrix-synapse-admin)](https://pypi.org/project/matrix-synapse-admin/)\n[![Synapse](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FKnugiHK%2Fsynapse-admin-api-python%2Fmain%2Fsupported_synapse.json)](https://github.com/KnugiHK/synapse-admin-api-python/blob/main/TODO.md)\n[![Tests](https://github.com/KnugiHK/synapse-admin-api-python/actions/workflows/tests.yml/badge.svg)](https://github.com/KnugiHK/synapse-admin-api-python/actions/workflows/tests.yml)\n\nA Python wrapper for [Matrix Synapse admin API](https://github.com/matrix-org/synapse).\n\n### Versioning\nThis library now supports up to Synapse 1.60.0, any Admin API introduced after 1.60.0 may not be included in this version. However, newer changes to Admin API are planned to be included in this library. For planned update, see [TODO.md](TODO.md). In the future, the version numbering convention will follow the version this library up to, for example, if this library supports up to 1.60.0, then the version number of this library will be 1.60.0. And the minor number will be reserved for bug fixes in this repo.\n\n**Releases older than 0.1.5 only work with HTTP/2**\n\n## Get Started\nInstall from PyPi\n```sh\npip install matrix-synapse-admin\n```\nProvide the connection information and access token in the first time of execution. You can either enter the information interactively or as arguments:  \n### Interactively\n```python\n\u003e\u003e\u003e from synapse_admin import User\n\u003e\u003e\u003e user = User()\n# The config creator is smart enough to determine the protocol and port by providing either one.\nEnter the homeserver URL with port(e.g. https://example.com:443): https://example.com # Only need to be entered in the first time\nEnter the access token (leave blank to get the access token by logging in): \u003caccess token or leave blank\u003e # Only need to be entered in the first time\n# If access token is left blank\nEnter a username: admin\nEnter a password:\nToken retrieved successfully\nSave to a config file? (Y/n)\n\u003e\u003e\u003e details_of_users = user.lists()\n\u003e\u003e\u003e print(details_of_users)\n[{'name': '@admin:example.com', 'user_type': None, 'is_guest': 0, 'admin': 1, 'deactivated': 0, 'shadow_banned': False, 'displayname': 'Admin', 'avatar_url': 'mxc://example.com/ABCDEFG'}]\n\u003e\u003e\u003e print(details_of_users.total)\n1\n```\n### As arguments\n```python\n\u003e\u003e\u003e from synapse_admin import User\n\u003e\u003e\u003e user = User(\"example.com\", 443, \"\u003caccess token\u003e\", \"https://\")\n\u003e\u003e\u003e details_of_users = user.lists()\n\u003e\u003e\u003e print(details_of_users)\n[{'name': '@admin:example.com', 'user_type': None, 'is_guest': 0, 'admin': 1, 'deactivated': 0, 'shadow_banned': False, 'displayname': 'Admin', 'avatar_url': 'mxc://example.com/ABCDEFG'}]\n\u003e\u003e\u003e print(details_of_users.total)\n1\n```\n### Unit Testing\nSimply run the testing script\n```shell\nchmod +x testing_env.sh\n./testing_env.sh\n```\n## Documentation\nDocstrings are present now in most methods and classes. If you see /equivalent to \".*\"/, it's mean that you may want to refer back to the Synapse Admin API documentation.\n\nMore documentation are coming...\n\n## Additional features\nIn addition to the wrapper that wraps the official admin APIs, this wrapper also provides serval unofficial helper methods or admin APIs, they include:\n* Reactivate an deactivated account (User.reactivate)\n* Create a room (Room.create)\n* Send an announcement to everyone (Management.announce_all)\n* Delete media by id or by condition (Media.delete_media)\n\n## Contribution\nIf you want to help me to improve the quality of this project, you can submit an issue.\n\nIf you want to collaborate with us, feel free to Fork this project and open a pull request.\n### What can you do?\n* For Issue\n  * Report any Error.\n  * Request new features based on the Synapse Admin API\n  * Ask questions if you do not understand something.\n  * More.\n\n* For Pull request\n  * Add comments to source code.\n  * Add new features based on the Synapse Admin API\n  * Correct any Error.\n  * More.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknugihk%2Fsynapse-admin-api-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknugihk%2Fsynapse-admin-api-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknugihk%2Fsynapse-admin-api-python/lists"}