Skip to main content

Unofficial GuteFrage api. Check https://github.com/DAMcraft/gutefrage/wiki on how to use it

Project description

Logo

PyPI PyPI - License Replit

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gutefrage-0.6.1.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

gutefrage-0.6.1-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page