Skip to main content

Test package for e6

Project description

e621-wrapper

A python3 "library" for using the e621 api.

Dependencies:

pip3 install ratelimit
pip3 install requests

Tutorial

Here is a quick example showing some stuff you can do with this library.

Where it says YOUR-USER-AGENT you should replace with something descriptive as said in the e621 api something like "Api-wrapper-test/0.1 (by your-username)". The other 2 arguments describe themselves.

from yiff import yiff

e6 = yiff.api("YOUR-E6-USERNAME", "YOUR-E6-API-KEY", "YOUR-USER-AGENT")

Posts

Then you can do e6.getpost(POSTID) to get info about a post from its id and it will return an object with the "sub" python3 class. In this you can then do sub.id, sub.tags, sub.score etc etc.

Or if you want to search you can do e6.search(LIST_OF_TAGS, POSTS_PER_PAGE, PAGE) with list_of_tags being a list type and the other 2 being integers and it will return a list of sub class objects.

Users

e6.getuser(USER_ID) is used to get info about a user from their id. It returns an object with the user class. you can then list user.id, user.name user.forum_post_count etc.

e6.searchuser(USER_NAME) works very similary to getuser except instead of taking their id it takes their username and out puts the same object.

Extra

If you want all the values that can be returned from posts or user searches then just look at line 41 to line 91 for posts and line 95 to line 117 for users in this file.

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

yiffpy-0.2.1.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

yiffpy-0.2.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page