- Python 100%
| docs | ||
| lib | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| .python-version | ||
| enrich.py | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| scrape.py | ||
Chinese Art
Public-domain and freely-licensed Chinese graphic art (paintings, drawings, calligraphy, maps, woodblock prints, cave murals, etc.) sourced from Wikimedia Commons and curated Wikipedia article galleries, organized by historical period for printing.
Pipeline
Two stages, both runnable concurrently:
-
scrape.py— walks seed categories/articles, dedups by sha1, applies a mime/mediatype gate, downloads accepted files intopending/, and inserts one row per accepted file intostate/state.db(rowstable). Structural rejects go into thestructural_rejectstable. Per-seed continue-cursors live in thecursorstable. -
enrich.py— drains pending rows fromstate.dbvia a streaming feeder/worker pool sized to the total VLM concurrency (len(API_URLS) * VLM_CONCURRENCY). Each row is rasterized, sent to an OpenAI-compatible VLM endpoint, and updated in place instate.dbwith the VLM's verdict (period,english_title,english_description, …). Accepted binaries move todynasties/<period>/; VLM-rejected binaries move todynasties/<period>/rejected/. Use--watchto keep draining asscrape.pyadds new rows.
State
All persistent state is in two SQLite databases (WAL mode; one writer plus many readers without external locking):
state/state.db— pipeline state:rows(one row per file across pending + enriched + VLM-rejected),structural_rejects(Stage 1 tombstones),cursors(per-seed continue state).state/wp_cache.db— read-only Wikipedia article-extract cache populated byscrape.pyand consumed byenrich.py.