- (Mainly) Python
- JavaScript
- C#
You can find my PGP key in https://keyserver.pgp.com.
A Python wrapper for Matrix Synapse admin API
License: MIT License
You can find my PGP key in https://keyserver.pgp.com.
Hello,
I tried the example in your doc to get information of all users, but it didn't work. The errors are as follows:
Traceback (most recent call last):
File "/home/admin/trial2.py", line 62, in
client.lists()
File "/home/admin/.local/lib/python3.9/site-packages/synapse_admin/user.py", line 117, in lists
resp = self.connection.request(
File "/home/admin/.local/lib/python3.9/site-packages/synapse_admin/base.py", line 626, in request
return request(url, **kwargs)
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_client.py", line 1045, in get
return self.request(
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_client.py", line 821, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_client.py", line 908, in send
response = self._send_handling_auth(
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_client.py", line 936, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_client.py", line 973, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_client.py", line 1009, in _send_single_request
response = transport.handle_request(request)
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_transports/default.py", line 218, in handle_request
resp = self._pool.handle_request(req)
File "/usr/lib/python3.9/contextlib.py", line 135, in exit
self.gen.throw(type, value, traceback)
File "/home/admin/.local/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno -2] Name or service not known
I just started testing your wrapper.
So far I can connect to our matrix server, get information (e.g. version, user list).
As soon as I try to send a body to the server (i.e. to create a user, send an announcement, ...), I get an error:
"Iterable bodies must always iterate in bytestrings"
Maybe I am just doing something wrong - is there any documentation or could you provide an example of user creation?
Thanks and best regards
Thomas
When i was trying to run the tests to find if there were any flaky tests in the project I got the error saying that "no such file or directory: 'synapse_test/admin.token'". Just wondering where this file locates.
Hey, I've used your code and it worked very well, nice job !
In my opinion it would be useful to insert a command that avoids running into the antiflood of synapse
For example:
I wrote a script with which I generated about 60 rooms starting from a txt file that contained their names.
The server after the fifth / sixth room started giving some errors
To solve this, I inserted a 60-second sleep between the creation of one room and the next one
In my opinion it would be useful if this library will be able to disable the antiflood with a python command, or at least make it more flexible.
using Management.version()
, it should return a server_version and python_version.
But since synapse 1.94.0 it does not return a python_version
in the JSON.
So your code produces an error.
I would also remove the python_version from the code. This may be backwards incompatible. You could also remove the python
str from SynapseVersion
(even more incompatible then 😆 ).
Best way would be to check if the server_version is < 1.94.0, and if yes, include python_version. if higher, skip it.
.. just had a look at current status of synapse admin tools (~medium impressive xD) and found a few, amongst which I like yours and https://github.com/JOJ0/synadm which already seems to have quite the endpoint coverage (haven't tried either yet). So this issue is just to let you know synadm is out there, maybe there's some synergy potential 🤠
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.