Danbooru post decensoring for Python
Project description
pydecensooru
A Python module using Decensooru data to automatically fill any Danbooru post's missing info keys.
The Decensooru repo will be silently cloned and kept up-to-date in your user
data directory,
e.g. ~/.local/share/pydecensooru on GNU/Linux by default.
Originally developed for transparent usage with lunafind.
Examples
>>> import requests
>>> from pydecensooru import decensor, decensor_iter
# Decensoring a single post if it needs to be:
>>> p2 = requests.get("https://danbooru.donmai.us/posts/2.json").json()
>>> "file_url" in p2
False
>>> p2d = decensor(p2)
>>> "file_url" in p2d
True
>>> p2["file_ext"]
'png'
# Transparently decensoring any post that needs it in a search:
>>> posts = requests.get("https://danbooru.donmai.us/posts.json?tags=id:1..10").json()
>>> print(type(posts), type(posts[0]))
<class 'list'> <class 'dict'>
>>> "file_url" in posts[-2]
False
>>> posts = list(decensor_iter(posts))
>>> "file_url" in posts[-2]
True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydecensooru-0.1.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for pydecensooru-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bebbe4afda254fb1c7555a141da1423b00d43f0f7a2fa4e404d25c006d01dd3f |
|
MD5 | 3784ddcc222f0873d516f62fb5f82e31 |
|
BLAKE2b-256 | 8898f2431f2e7f8f37f03be4d81e9793c9ceb3ef31469a8d625c3ed8636ebd6b |