Package: six21
six21A python api wrapper for e621.netFeaturesGetting Recent Posts From e6Searching For PostsGetting Random PostsGetting An Post By Its IdUsageTo use you need to have requests and json packages installedFirst, import into your projectfromsix21importe621If needed set User to the name of your projecte621.Set_User("NAME_OF_PROJECT")Searching will return a list of posts that fit the criteria that the tags provideUsage:e621.search(tags,page,limit)tagsIs what keywords you want to search for are and should be given in a listpageis what page you want to go to during the search and should be given in a intlimitis the limit to how many posts you want to retrieveGetting recent posts will return a list of posts that have been most recently posted to e6Usage:e621.recent(limit)limitis the limit to how many posts you want to retrieveReturns one random post from e6Usagee621.random()Returns the post from the given IdUsage:e621.get_post(Id)Idis the Id of the post you want it to returnPost Objectid: 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 E6preview (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 E6sample (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 ExampleBelow is a script that will grab a random post then print the post id, allong with the raw file url:fromsix21importe621#Import Packagerandom_post=e621.random()#Get a random postpost_id=random_post.id#From the post get its Idpost_file_url=random_post.file.url#From the post get its Urlprint("Post Id:{Id}\nFile Url:{Url}".format(Id=post_id,Url=post_file_url))#Print Id and Url