{"id":19012201,"url":"https://github.com/mirukana/lunafind","last_synced_at":"2025-09-07T02:05:00.579Z","repository":{"id":62577134,"uuid":"155480175","full_name":"mirukana/lunafind","owner":"mirukana","description":"Search, filter, inspect, download posts from Danbooru/Safebooru and find them back from the command line without setting up any service or database.","archived":false,"fork":false,"pushed_at":"2021-10-17T01:15:31.000Z","size":320,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T16:03:48.763Z","etag":null,"topics":["anime","api","booru","cli","client","danbooru","download","filter","image","lunakit","lunasync","order","safebooru","scrap","search","tag","terminal","ugoira"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirukana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-31T01:30:33.000Z","updated_at":"2024-12-31T15:51:05.000Z","dependencies_parsed_at":"2022-11-03T19:06:31.173Z","dependency_job_id":null,"html_url":"https://github.com/mirukana/lunafind","commit_stats":null,"previous_names":["mirukan/lunafind"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirukana%2Flunafind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirukana%2Flunafind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirukana%2Flunafind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirukana%2Flunafind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirukana","download_url":"https://codeload.github.com/mirukana/lunafind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250316029,"owners_count":21410475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anime","api","booru","cli","client","danbooru","download","filter","image","lunakit","lunasync","order","safebooru","scrap","search","tag","terminal","ugoira"],"created_at":"2024-11-08T19:17:08.578Z","updated_at":"2025-04-22T23:40:42.011Z","avatar_url":"https://github.com/mirukana.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lunafind\n\n[![PyPI downloads](http://pepy.tech/badge/lunafind)](\n    http://pepy.tech/project/lunafind)\n[![PyPI version](https://img.shields.io/pypi/v/lunafind.svg)](\n    https://pypi.org/projects/lunafind)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/lunafind.svg)](\n    https://pypi.python.org/pypi/lunafind)\n\nSearch, filter, inspect, download posts from Danbooru/Safebooru and find them\nback from the command line without setting up any service or database.\n\nSuitable for daily terminal usage, usable for scripts and as a library\nfor Python 3.6+.\n\nSee also [lunasync](https://github.com/mirukan/lunasync) to automatically\ndownload and keep in sync particular tags using **lunafind**,\nsimilar to Danbooru tag subscriptions or saved searches.\n\n## Features\n\n- Operate on tag searches, URLs or file paths\n- Combine results from multiple searches\n- Specify custom page ranges, or just get everything\n- Filter and order booru results to work around the two tags search limit\n- Optional partial/fuzzy tag matching for filter and local searches\n- Search downloaded posts by tags as if they were on a booru, without the\n  hassle of setting up one\n- Instant results from local searches in most cases after indexing\n- Fast multithreaded downloads; 8 downloads in parallel by default\n- Supports operating on post media (image, ugoira WebM, etc), info, notes,\n  artist commentaries:\n  - Getting the URLs or file/folder paths\n  - Printing on standard output\n  - Downloading\n\n## Local searches performance\n\nThe first time a local post search is done, an index file to speed up future\nsearches will be automatically created and updated when new post directories\nexist or are removed.\n\nTest with ~165 000 posts  \nAMD FX-8300 (8 cores, 3.3GHz), TOSHIBA DT01ACA2 7200 RPM HDD,\nBTRFS file system, Void Linux 4.18.14 x86\\_64:  \n- It takes about 2m30s - 3m to index everything from scratch\n- After this, search results start coming instantly unless `--random` or\n  `--order` is used.  \n- Searches finish completely in 8-20s\n\nTest with ~60 000 posts  \nCeleron B815 (2 cores, 1.60GHz), 5400 RPM HDD, BTRFS file system,\nVoid Linux 4.18.20 x86\\_64:\n- About 4mn to index everything from scratch\n- Results come instantly\n- Searches finishes in ~20s\n\n## Command line usage\n\nDownloading to the current folder every post tagged *blonde* and *2girls*\n(default booru is \u003chttps://danbooru.donmai.us\u003e):\n\n```sh\n    lunafind \"blonde 2girls\" --limit 200 --pages all --download .\n```\n\nSearching through the posts we just downloaded,\nprinting image paths for the results:\n\n```sh\n    lunafind \"blonde blue_eyes rating:s score:\u003e5\" --source . --show-location media\n```\n\nSee `lunafind --help` for all options and examples.\n\n## Python usage\n\nNo real documentation yet. Three main classes are provided:\n\n- `Post`: represents a local or remote single post, with its info, media, notes\n          and artcom (artist commentary).\n\n- `Album`: works like a dictionary of `Post`, where keys are the post IDs.\n           Has magic methods and operators to facilitate working with them.\n           Can be filtered, ordered, downloaded, and more.\n\n- `Stream`: an efficiant lazy iterator yielding posts.\n            Can be filtered and multithread-downloaded.\n\nReproducing the command line examples in the section above:\n\n```python3\n    from lunafind import Stream\n\n    Stream(\"blonde 2girls\", limit=200, pages=\"all\").download()\n\n    for post in Stream(\"blonde blue_eyes rating:s score:\u003e5\", client=\".\"):\n        print(post.get_location(\"media\"))\n```\n\n## Installation\n\nRequires Python 3.6+ and pip (for automatic easy install).  \nTested on GNU/Linux and Windows 7, probably works on OSX and other POSIX\nsystems.  \nAs root:\n\n```sh\n    pip3 install -U lunafind\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirukana%2Flunafind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirukana%2Flunafind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirukana%2Flunafind/lists"}