-
Notifications
You must be signed in to change notification settings - Fork 5
Getting Started
-
Python 3.10+.
-
At least one supported sink. All nine are first-class destinations:
Sink Needs postgresa PostgreSQL 13+ server mysql/mariadba MySQL 8+ or MariaDB 10.5+ server sqlitenothing (stdlib) — a file or :memory:mongodba MongoDB 6+ server neo4ja Neo4j 5 server clickhousea ClickHouse 24+ server duckdbnothing (in-process) — a file or :memory:surrealdba SurrealDB server -
A
.envfile in the current working directory (the scraper loadsPath.cwd()/.env, not the repo root).
See Sinks for the support matrix, licenses, and capability differences.
See Sinks for the support matrix, licenses, and capability differences.
pip install hkex-filing-scraper # core; SQLite works out of the box
pip install "hkex-filing-scraper[all]" # Excel + dotenv + every database driver + the MCP serverMinimal and per-sink installs:
pip install "hkex-filing-scraper[postgres]" # add one driver at a time
pip install "hkex-filing-scraper[duckdb]" # or: mysql, mongodb, clickhouse, neo4jTo run the latest unreleased code:
pip install "git+https://github.com/simonmak-ascent/hkex-filing-scraper.git"The
.[all]. See Legal#third-party-licenses before installing it.
cp .env.example .envSet DATABASE_TARGET to an ordered, comma-separated list of sink ids, then add that sink's
connection settings. Order matters: reads come from the first read-capable sink in the list.
# PostgreSQL
DATABASE_TARGET=postgres
POSTGRES_DSN=postgresql://user:password@localhost:5432/hkex
# or: POSTGRES_HOST / POSTGRES_PORT / POSTGRES_DATABASE / POSTGRES_USER / POSTGRES_PASSWORD
# MySQL / MariaDB
DATABASE_TARGET=mysql # or mariadb
MYSQL_HOST=localhost MYSQL_DATABASE=hkex MYSQL_USER=hkex MYSQL_PASSWORD=secret
# SQLite (no server)
DATABASE_TARGET=sqlite
SQLITE_PATH=hkex.db
# MongoDB
DATABASE_TARGET=mongodb
MONGODB_URI=mongodb://localhost:27017 MONGODB_DATABASE=hkex
# Neo4j
DATABASE_TARGET=neo4j
NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=secret
# ClickHouse
DATABASE_TARGET=clickhouse
CLICKHOUSE_HOST=localhost CLICKHOUSE_DATABASE=hkex CLICKHOUSE_USER=default
# DuckDB (no server)
DATABASE_TARGET=duckdb
DUCKDB_PATH=hkex.duckdb
# SurrealDB
DATABASE_TARGET=surrealdb
SURREAL_ENDPOINT=http://localhost:8000
SURREAL_NAMESPACE=default SURREAL_DATABASE=default
SURREAL_USERNAME=root SURREAL_PASSWORD=your_password# Order matters: reads come from the first read-capable sink.
DATABASE_TARGET=postgres,sqlite
POSTGRES_DSN=postgresql://user:password@localhost:5432/hkex
SQLITE_PATH=hkex.db# MySQL / MariaDB
DATABASE_TARGET=mysql
MYSQL_HOST=localhost MYSQL_DATABASE=hkex MYSQL_USER=hkex MYSQL_PASSWORD=secret
# DuckDB (no server)
DATABASE_TARGET=duckdb
DUCKDB_PATH=hkex.duckdb
# MongoDB
DATABASE_TARGET=mongodb
MONGODB_URI=mongodb://localhost:27017 MONGODB_DATABASE=hkex
# ClickHouse
DATABASE_TARGET=clickhouse
CLICKHOUSE_HOST=localhost CLICKHOUSE_DATABASE=hkex CLICKHOUSE_USER=default
# Neo4j
DATABASE_TARGET=neo4j
NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=secretDATABASE_TARGET is required — there is no implicit default. See
Sinks for the full support matrix.
# Metadata only — fastest way to validate configuration
hkex-scraper --metadata-only --limit 100
# Full history (metadata + documents + graph)
hkex-scraper --full-historyThe schema for every configured sink is created automatically on startup using idempotent DDL.
hkex-scraper --coverage-report # chunk-level coverage
hkex-scraper --database-target postgres,sqlite --parity-report # per-sink filing countsExit code is non-zero if any configured sink recorded write failures.
Generated from the simonmak-ascent/hkex-filing-scraper docs by scripts/mirror_wiki.py. Do not edit wiki pages by hand — edit docs/ in the repository and the mirror will refresh.