• Stars
    star
    855
  • Rank 52,898 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python wrapper for the Mastodon ( https://github.com/mastodon/mastodon/ ) API.

Mastodon.py

Python wrapper for the Mastodon ( https://github.com/mastodon/mastodon/ ) API. Feature complete for public API as of Mastodon version 3.5.5 and easy to get started with:

from mastodon import Mastodon

# Register your app! This only needs to be done once (per server, or when
# distributing rather than hosting an application, most likely per device and server).
# Uncomment the code and substitute in your information:
'''
Mastodon.create_app(
    'pytooterapp',
    api_base_url = 'https://mastodon.social',
    to_file = 'pytooter_clientcred.secret'
)
'''

# Then, log in. This can be done every time your application starts (e.g. when writing a
# simple bot), or you can use the persisted information:
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',)
mastodon.log_in(
    '[email protected]',
    'incrediblygoodpassword',
    to_file = 'pytooter_usercred.secret'
)

# Note that this won't work when using 2FA - you'll have to use OAuth, in that case.
# To post, create an actual API instance:
mastodon = Mastodon(access_token = 'pytooter_usercred.secret')
mastodon.toot('Tooting from Python using #mastodonpy !')

You can install Mastodon.py via pypi:

# Python 3
pip3 install Mastodon.py

We currently try to support Python 3.7 and above, and try to at least not break Python 3 versions below that. Python 2 support is no longer a goal.

Full documentation and basic usage examples can be found at https://mastodonpy.readthedocs.io/en/stable/ . Some more extensive examples can be found at https://github.com/halcy/MastodonpyExamples

Acknowledgements

Mastodon.py contains work by a large amount of contributors, many of which have put significant work into making it a better library. You can find some information about who helped with which particular feature or fix in the changelog.

https://circleci.com/gh/halcy/Mastodon.py.svg?style=svg

More Repositories

1

AnimeFaceNotebooks

notebooks and some data for playing with animeface stylegan2 and deepdanbooru
Jupyter Notebook
118
star
2

blurhash-python

Implementation of the blurhash ( https://github.com/woltapp/blurhash ) algorithm in pure python
Python
84
star
3

DeepDanbooruActivationMaps

Scripts to calculate interest regions for tags for the DeepDanbooru tagger model
Jupyter Notebook
34
star
4

makeansi

Turns images into ansi colour codes + utf-8
Perl
27
star
5

nordlicht19

3ds demo for nordlicht 2019
C
25
star
6

simpleflow

A simple OpenCL / OpenGL fluid simulation and renderer
C
24
star
7

Mastodon-LaTeXclient

Mastodon LaTeX Client
TeX
23
star
8

tpuddim

Jupyter Notebook
22
star
9

tootmage

multicolumn terminal mastodon client for shitty nerds
Python
17
star
10

openclpt

A simple OpenCL path tracer with spheres and mixed glossy/specular + diffuse + emission material
C
12
star
11

MastodonpyExamples

Some examples for Mastodon.py
Python
11
star
12

hanse

Halcys Ansi Editor
Python
10
star
13

pixivrss.pl

pixivrss.pl - a Pixiv "bookmarks" RSS feed generator.
Perl
9
star
14

hellomotoot

PSTN Mastodon Client using Mastodon.py and the Twilio API
Python
9
star
15

coffeedate

Simple client-side only single page timezone aware schedule
CSS
8
star
16

Hiveway.py

whoops
Python
8
star
17

nordlicht18

secret don't look (edit: not secret anymore)
C
7
star
18

mastodon_mod_tools

A maybe future set of tools to help with mastodon moderation
Python
7
star
19

hopfield

Simple Hopfield networks for pattern recognition.
C
7
star
20

rasterizer2

fixed-point math based software rasterizer
C
5
star
21

quasi_crystals_bot

Bot that posts quasicrystal-like gif animations to Twitter and Mastodon
C
5
star
22

clirc

thecolorless.net chat to IRC gateway
Perl
5
star
23

Stallman-Box

It's like a Buddha Box, except with Saint Ignucius.
C
4
star
24

pucmcawesome

A pacmanish game for the NDS.
C
4
star
25

Drawthing

Small, simple drawing application for university SWT class
Java
4
star
26

rasterizer

A very very simple software rasterizer.
C
4
star
27

quota

A script mashing up graph data from google trends and yahoo finance.
Perl
4
star
28

rev2017

extremely secret
C
3
star
29

ShowF0

records audio and shows f0 in a window
Python
3
star
30

LearningJAX

Jupyter Notebook
2
star
31

NGram-LM-Playground

Jupyter Notebook
2
star
32

3ds-demobase

3ds demo basecode don't steal
C
2
star
33

cyberdefense2200

A video game made during AGDG 2016
C
2
star
34

ledstrip

things I use for my LED strip
Python
2
star
35

newsdaqlog

A fancy graphing script for the NEWSDAQ.
Ruby
2
star
36

notificat

Prints Mastodon WebPush notifications to your terminal
Python
2
star
37

AoC2017

Advent of Code 2017
Jupyter Notebook
1
star
38

CentralLimitTheorem

Visualization of the Central Limit Theorem
Jupyter Notebook
1
star
39

Trefoil-Knot-Image-Displayer

C++
1
star
40

mootykins3

Extendable IRC bot written in perl.
Perl
1
star
41

tumblrrss

A tumblr rss feed generator
Perl
1
star
42

gpn12

Lighting talk for GPN12
Shell
1
star
43

brutalist-mage

A Pelican theme that likes 90 degree angles, blocks, and the colour purple.
CSS
1
star
44

learning_rust

hi i am learning to write rust
Rust
1
star
45

halcy-de-blog

Pelican setup and content for http://halcy.de/blog
Python
1
star