Hi @WolfgangFahl,
Thanks for sharing this. The code you shared seems like a refactor of pydgraph simple.py example as a python class. It may be better in terms of programming style but the pydgraph example is not meant to be a production quality code. It’s a minimal example that someone can look at to see how to use the client. So, it avoids the boiler plate for creating a class and then creating a class object etc.
Please feel free to raise PR if you still want your suggested improvements. We are open to contributions from the community.