Welcome to Pykemo’s documentation!
Pykemo is a Python library that effectively functions as a binding to the Kemono API.
Examples
Retrieving a creator
You can create a Creator instance like so:
import asyncio
from pykemo import KemoSession, get_creator, ServiceType
async def main():
async with KemoSession() as s:
creator_id = "2658856"
creator = get_creator(ServiceType.FANBOX, creator_id, s)
print(creator)
asyncio.run(main())
import asyncio
from pykemo import KemoSession, get_creator
async def main():
async with KemoSession() as s:
creator_id = "2658856"
creator = get_creator("fanbox", creator_id, s)
print(creator)
asyncio.run(main())
And it will print:
Creator(id='2658856', name='fumihiko', service=<ServiceType.FANBOX: 'fanbox'>)
Fetching posts
From there you can check its posts:
# Fetching last 5 posts
last_posts = await creator.posts(max_posts=5)
for post in last_posts:
print(post)
from datetime import datetime
# Every post from March 1st to 4rd
before = datetime(year=2025, month=3, day=4)
since = datetime(year=2025, month=3, day=1)
specific_posts = await creator.posts(before=before, since=since)
for post in specific_posts:
print(post)
And it will show:
Post(id='9484523', creator_id='2658856', service=<ServiceType.FANBOX: 'fanbox'>, title='白●ノ●ル(リクエストNTR)(と●の●ら撮影会修正)')
Post(id='9482064', creator_id='2658856', service=<ServiceType.FANBOX: 'fanbox'>, title='と●の●ら(そ●友さん達と撮影会Vtuber)')
Post(id='9481266', creator_id='2658856', service=<ServiceType.FANBOX: 'fanbox'>, title='ボテ注意常●ト●Vtuber')
Post(id='9479140', creator_id='2658856', service=<ServiceType.FANBOX: 'fanbox'>, title='白●フ●キ(●やんけ①②)')
...
Alternatively, you can also use the helper function get_posts(), which has the same parameters,
for a search of all the recent posts of every creator.
from pykemo import get_posts()
async with KemoSession() as s:
any_posts = await get_posts(max_posts=15, kemo_session=s)
Downloading files
Finally, you can downloads the files of any post, if there is any:
chosen_one = specific_posts[0]
for file in chosen_one.attachments:
await file.save("./download/", verbose=False)
chosen_one = specific_posts[0]
await chosen_one.save("/download/*", verbose=True)
Note
Use verbose=True to see the fancy progress bars.
Ussing Accounts
Pykemo supports an interface that allows you to login into your account. It automatically uses a dedicated session inside to persist your session key.
A normal user’s account.
import asyncio
import os
from pykemo.general import login
async def main():
async with await login(os.environ["username"], os.environ["password"]) as acc:
creator = await acc.get_creator("fanbox", "2658856")
post = await creator.get_post("9441683")
await post.save("./path/to/download/*")
asyncio.run(main())
Table of Contents