Skip to main content

Analyst-friendly scrapers with TUI and uvx support

Project description

Inklog

Inklog is a collection of uvx-friendly scrapers for analysts. It provides a CLI for automation and a TUI (work in progress) for browsing available scrapers. The current focus is downloading files (PDF/EPUB). Webpage-to-markdown scraping is planned but not implemented yet.

All dates in this repository use the ISO8601 format: YYYY-MM-DD.

Quick start

Run a scraper (CLI)

uvx inklog run malaysia_parliament 2025-11-01 2025-11-30

List scrapers

uvx inklog list

Show example URLs

uvx inklog info malaysia_parliament

Run the TUI

uvx inklog

Run a single document type:

uvx inklog run malaysia_parliament:lower_house_hansard 2025-11-01 2025-11-30

TUI

The TUI is a work in progress. It shows the available scrapers, their descriptions, and lets you run a scraper with date ranges and options. Each Malaysia Parliament document type appears as its own row for quick runs.

Key bindings:

  • Enter or Run button: run the selected scraper
  • Example URLs can be opened from the details pane
  • Q: quit

Malaysia Parliament scraper

This scraper downloads PDFs from the Malaysia Parliament site for the following document types:

  • Dewan Rakyat - Jawapan Lisan (Oral Answers)
  • Dewan Rakyat - Jawapan Bukan Lisan (Non-Oral Answers)
  • Dewan Rakyat - Penyata Rasmi (Official Report)
  • Dewan Negara - Jawapan Bertulis (Written Answers)

Filename rules

Some sources change their filename patterns over the years. Inklog models this using date-bound filename rules, so each document type can define a list of templates tied to start/end dates. The Malaysia Parliament scraper ships with the current pattern and a rules table that can be extended when historical patterns are known.

CLI options

inklog run supports overriding boolean options with --set:

uvx inklog run malaysia_parliament 2025-11-01 2025-11-30 \
  --set jawapan_lisan_rakyat=true \
  --set jawapan_bukan_lisan_rakyat=true \
  --set penyata_rasmi_rakyat=true \
  --set jawapan_bertulis_negara=false

Adding a new scraper

  1. Copy src/inklog/scrapers/template.py and rename it.
  2. Update ScraperMeta and implement run().
  3. Ensure the module exports SCRAPER.

Scrapers are auto-discovered from the inklog.scrapers package.

Development

uv sync --extra dev
uv run ruff check --fix .
uv run ruff format .
uv run pytest

Roadmap

  • Add markdown scraping mode (TBD).
  • Expand filename rules for historical Malaysia Parliament patterns.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inklog-0.2.0.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inklog-0.2.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file inklog-0.2.0.tar.gz.

File metadata

  • Download URL: inklog-0.2.0.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for inklog-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5f41efbc65595a4cf2bc3658190ac2464d85f6f8b671b26e8a525c5463267cfd
MD5 69c4e4c0be608d78e0ebe7aaa2bb188d
BLAKE2b-256 5c9b78b84c2938644bacb2e5b5f39de748157f9d2b6e1cfbcc59911959c3e989

See more details on using hashes here.

File details

Details for the file inklog-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: inklog-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for inklog-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8161537e994022f25d9c34cee1223738c0b2e7f6539866cdad85c63aea5dd50
MD5 fe0e5c98f8f42c980f08d73cb2db974a
BLAKE2b-256 4d8b014c575c2bae889440c438dcc1a8ef77ffcd7284379fbc9143799c1394e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page