Tumblr API wrapper with support for Polls
Project description
Tumblr-Dot-Com
An unofficial Tumblr API client. Includes support for creating polls and retrieving poll results.
Install
pip install tumblrdotcom
Docs
https://tumblr-dot-com.rtfd.io
Usage
Example
import os
from datetime import timedelta
from pprint import pprint
from tumblr import *
tumblr = Tumblr(
blog="pizza", # or 'pizza.tumblr.com'
client_key=os.getenv("CONSUMER_KEY"),
client_secret=os.getenv("CONSUMER_SECRET"),
oauth_key=os.getenv("OAUTH_TOKEN"),
oauth_secret=os.getenv("OAUTH_SECRET"),
)
response = tumblr.post(
content=(
Heading("Hello, World!"),
Text("Oh boy! Isn't it great to have a tumblr!"),
Row(
Image(
"clown_left.jpg",
"image/jpeg",
"A photo clown holding their right thumb up towards the camera"
),
Image(
"clown_right.jpg",
"image/jpeg",
"A photo clown holding their left thumb up towards the camera"
),
),
Poll(
"Don't you think so?",
["Yes", "No"],
expire_after=timedelta(days=1),
),
),
tags=["pizza", "I can't even remember why they were deleted"],
)
pprint(response)
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
tumblrdotcom-0.3.0.tar.gz
(12.9 kB
view hashes)
Built Distribution
Close
Hashes for tumblrdotcom-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad7bc9d395ae03eb73f497435610244a0e13fdaa8369ddd42b12e1788439d438 |
|
MD5 | 48837b129c4a36d364b0e84ae08fdf35 |
|
BLAKE2b-256 | 7024d02867d784988971abfab87cb45602c25ade63472cca9bddc7bb2f8dc9f8 |