Giter VIP home page Giter VIP logo

pythorhead's Introduction

Pythörhead

A python library for interacting with Lemmy

pythorhead logo

Examples

See working examples in examples/

Exceptions

If you want to raise exceptions on failures instead of returning null, pass raise_exceptions=True to the Lemmy() constructor.

The normal request timeout is 3 seconds. If you want to change this number, you can set it on the constructor uising request_timeout=

Sample Post Usage

from pythorhead import Lemmy

lemmy = Lemmy("https://lemmy.dbzer0.com",request_timeout=2)
lemmy.log_in("username", "password")
community_id = lemmy.discover_community("botart")
lemmy.post.create(community_id, "Hello Lemmy World")

Sample Comment Usage

from pythorhead import Lemmy

lemmy = Lemmy("https://lemmy.dbzer0.com")
lemmy.log_in("username", "password")

# getting the first post id
post_id = lemmy.post.list()[0]["post"]["id"]

# leave a comment
lemmy.comment.create(post_id, "Hello Lemmy World")

pythorhead's People

Contributors

ashtontx avatar carlesmu avatar chris-y avatar coder0422 avatar dakkaron avatar db0 avatar demigodrick avatar fixmycode avatar hjalp avatar i-be-snek avatar jodanjodan avatar lemist24 avatar nickoehler avatar pnewstein avatar retiolus avatar sab666 avatar someonestolemynickname avatar tanitna avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.