PyTumblr supports multiple post types. Most creation methods accept these default parameters:
state: String. Post state: published, draft, queue, or private.tags: A list of strings (e.g., ['tag1', 'tag2']). Note: Do not use a comma-separated string.tweet: String. Custom tweet text.date: String. Customized GMT date.format: String. Post format: html or markdown.slug: String. URL slug for the post.
Photo Posts
Supports caption (string), link (click-through URL), source (URL for photo), and data (filepath or list of filepaths for multipart upload).
# Using a source URL
client.create_photo(blogName, state="published", tags=["testing"], source="https://example.com/image.jpg")
# Using local filepaths (Photoset)
client.create_photo(blogName, state="draft", data=["/path/to/img1.jpg", "/path/to/img2.jpg"], caption="## Title")
Text Posts
Supports title (string) and body (string).
client.create_text(blogName, state="published", title="My Title", body="My content")
Quote Posts
Supports quote (string) and source (string).
client.create_quote(blogName, quote="I am the Walrus", source="Ringo")
Link Posts
Supports title (string), url (string), and description (string).
client.create_link(blogName, title="Title", url="https://example.com", description="Desc")
Chat Posts
Supports title (string) and conversation (string with dialogue labels, no HTML).
chat = "\nJohn: Hello!\nJane: Hi!\n"
client.create_chat(blogName, title="Chat Title", conversation=chat)
Audio Posts
Supports caption (string). Use either external_url (string) or data (filepath), but not both.
# From URL
client.create_audio(blogName, caption="Music", external_url="https://soundcloud.com/...")
# From local file
client.create_audio(blogName, caption="Music", data="/path/to/audio.mp3")
Video Posts
Supports caption (string). Use either embed (HTML embed code) or data (filepath), but not both.
# From YouTube
client.create_video(blogName, caption="Video", embed="http://www.youtube.com/watch?v=...")
# From local file
client.create_video(blogName, caption="Video", data="/path/to/video.mov")
# Example: Creating a photo post using a source URL
client.create_photo(blogName, state="published", tags=["testing", "ok"],
source="https://68.media.tumblr.com/b965fbb2e501610a29d80ffb6fb3e1ad/tumblr_n55vdeTse11rn1906o1_500.jpg")