Skip to main content

six21

A python api wrapper for e621.net

Features

  • Getting Recent Posts From e6
  • Searching For Posts
  • Getting Random Posts
  • Getting An Post By Its Id

Usage

To use you need to have requests and json packages installed

First, import into your project

from six21 import e621

If needed set User to the name of your project

e621.Set_User("NAME_OF_PROJECT")

Searching will return a list of posts that fit the criteria that the tags provide
Usage:

e621.search(tags, page, limit)
  • tags Is what keywords you want to search for are and should be given in a list
  • page is what page you want to go to during the search and should be given in a int
  • limit is the limit to how many posts you want to retrieve

Getting recent posts will return a list of posts that have been most recently posted to e6
Usage:

e621.recent(limit)
  • limit is the limit to how many posts you want to retrieve

Returns one random post from e6
Usage

e621.random()

Returns the post from the given Id
Usage:

e621.get_post(Id)
  • Id is the Id of the post you want it to return

Post Object

id: The ID number of the post.
created_at: The time the post was created in the format of YYYY-MM-DDTHH:MM:SS.MS+00:00.
updated_at: The time the post was last updated in the format of YYYY-MM-DDTHH:MM:SS.MS+00:00.

file (subclass)

width: The width of the post.
height: The height of the post.
ext: The file’s extension.
size: The size of the file in bytes.
md5: The md5 of the file.
url: The URL where the file is hosted on E6

preview (subclass)

width: The width of the post preview.
height: The height of the post preview.
url: The URL where the preview file is hosted on E6

sample (subclass)

has: If the post has a sample/thumbnail or not. (True/False)
width: The width of the post sample.
height: The height of the post sample.
url: The URL where the sample file is hosted on E6.

score (subclass)

up: The number of times voted up.
down: A negative number representing the number of times voted down.
total: The total score (up + down).

tags (subclass)

general: A list of all the general tags on the post.
species: A list of all the species tags on the post.
character: A list of all the character tags on the post.
artist: A list of all the artist tags on the post.
invalid: A list of all the invalid tags on the post.
lore: A list of all the lore tags on the post.
meta: A list of all the meta tags on the post.

locked_tags: A JSON array of tags that are locked on the post.
change_seq: An ID that increases for every post alteration on E6 (explained below)
flags (subclass)

pending: If the post is pending approval. (True/False)
flagged: If the post is flagged for deletion. (True/False)
note_locked: If the post has it’s notes locked. (True/False)
status_locked: If the post’s status has been locked. (True/False)
rating_locked: If the post’s rating has been locked. (True/False)
deleted: If the post has been deleted. (True/False)

rating: The post’s rating. Either s, q or e.
fav_count: How many people have favorited the post.
sources: The source field of the post.
pools: An array of Pool IDs that the post is a part of.
relationships (subclass)

parent_id: The ID of the post’s parent, if it has one.
has_children: If the post has child posts (True/False)
has_active_children: children A list of child post IDs that are linked to the post, if it has any.

approver_id: The ID of the user that approved the post, if available.
uploader_id: The ID of the user that uploaded the post.
description: The post’s description.
comment_count: The count of comments on the post.

Usage Example

Below is a script that will grab a random post then print the post id, allong with the raw file url:

from six21 import e621 #Import Package

random_post = e621.random() #Get a random post

post_id = random_post.id #From the post get its Id

post_file_url = random_post.file.url #From the post get its Url

print("Post Id: {Id} \nFile Url: {Url}".format(Id = post_id,Url = post_file_url )) #Print Id and Url

Metadata

Release files for six21 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for six21 0.1.3
File Size Uploaded
six21-0.1.3.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for six21 0.1.3
File Interpreter ABI Platform
six21-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / six21-0.1.3.tar.gz

Download URL six21-0.1.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
23c9c357ad87ec8714da4d24631529b85145ab06e33cd1da9eb17c1cff99135d
BLAKE2b-256 checksum
How to use checksums
8c735db486acfa08c63b86fa5a277c7fee833d15c3bb702b76c8a02915471d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.11

Release files / six21-0.1.3-py3-none-any.whl

Download URL six21-0.1.3-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6498163ab98dee81cb7ce60273e4db15ba707e1c915d3eb7d4e3c269fb8d41e6
BLAKE2b-256 checksum
How to use checksums
15e3859f2cb832d4ea4fe74fe159dac6afcb67db885ac9521189c7601f13ec2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.11

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page