An unofficial gutefrage.net API made for Python.
Features
- get question by name/url/id
- get newest questions
- like questions
- reply to questions
- TODO: post questions
- TODO: reply replies
Get started
An short explenation of the basic features. You can find the full documentation here
Installation
Gutefrage API can be installed like every other python package: pip install gutefrage
Basic usage
In this example we are going to mark a question from gutefrage.net as liked. First we have to create a new client with username and password:
import gutefrage as gf
gfclient = gf.gutefrage("username", "password")
To interact with an specific question we need its id. To get the id we need its stripped_title. The stripped_title can be found in the last part of its url called like this:
The Url: https://www.gutefrage.net/frage/wie-berechnet-man-die-quadratwurzel-aus-625
stripped_title: wie-berechnet-man-die-quadratwurzel-aus-625
To get the questions id we can use .convert_to_id(string):
title = "wie-berechnet-man-die-quadratwurzel-aus-625"
id = gfclient.convert_to_id(title)
print(id)
What now is printed in the console is the question's id! For this question it's 57753709.
Now we have the id we can get the question by id:
id = 57753709
question = gf.question(id)
Now we've got the question, we can get lot of information about it:
information = question.info()
And we can finally give it a like!
question.like
Documentation
You can find the full documentation here
Release files for gutefrage 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gutefrage-0.6.1.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gutefrage-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.0 kB
Release files / gutefrage-0.6.1.tar.gz
| Download URL | gutefrage-0.6.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cbb02a463dc298cfbb8d38334791421fa7f51cff6f084d13bfeb1874631f607
|
|
BLAKE2b-256 checksum How to use checksums |
168d86a82d16ded2054a2b5cbadd2328ee9a406b526cbee7c3ce7a53097c0088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / gutefrage-0.6.1-py3-none-any.whl
| Download URL | gutefrage-0.6.1-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2b4d41f7856a74581b2104de173755a6b6991ee4b6a504d81ad870c67eac533
|
|
BLAKE2b-256 checksum How to use checksums |
7ba964e42e94fe7cc274519cb3f329c324a7368028c9c24999cb33d926291e31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|