Skip to main content

pydecensooru

PyPI downloads PyPI version PyPI pyversions

A Python module using Decensooru data to automatically fill any Danbooru post's missing info keys.

The Decensooru id:md5.ext batches will be silently fetched 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

Release files for pydecensooru 0.2.0

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

Source distribution (sdist)

Source distribution for pydecensooru 0.2.0
File Size Uploaded
pydecensooru-0.2.0.tar.gz 4.0 kB Details

Built distribution (wheel)

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

Total release size:8.5 kB

Release files / pydecensooru-0.2.0.tar.gz

Download URL pydecensooru-0.2.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3097bb47dc0880e5710f67a062b696abfbcd77feb1854b67defd737563ae2591
BLAKE2b-256 checksum
How to use checksums
654d2ba6420202979966fe20974cb30f5ad5d05ec9c7f0d86de75a3db5ddc4a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release files / pydecensooru-0.2.0-py3-none-any.whl

Download URL pydecensooru-0.2.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d69a5ba6cb96b6f4a6fc43ea33ca084ae68a3e3426a669b5e3b0a9e6b61c165
BLAKE2b-256 checksum
How to use checksums
755ab0b51ac430d47ec52ea177e592a9e3ebfd6a7f038400f2b59c1a828c02e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

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