Small scraping utilities for CLI and Python workflows.
Project description
scrape-smith
No-dependency Python utilities for scraping workflows.
The package currently provides a scrape command with a table extraction tool.
It can read HTML from a local file or HTTP(S) URL, extract tables, and write CSV
or JSON output to a file.
Installation
scrape-smith requires Python 3.10 or newer.
python -m pip install scrape-smith
Quickstart
scrape tables <html-file-or-url>
scrape tables page.html
scrape tables https://example.com/page.html -o result.csv
scrape tables page.html --format json -o tables.json
Without -o, output is written to a safe source-based filename:
page.html -> page-tables.csv
https://yeiichi.github.io/claim-class-model -> claim-class-model-tables.csv
If the default filename already exists, scrape avoids overwriting it by adding
a numeric suffix, such as page-tables-2.csv.
On success, scrape reports the written file to stdout:
Wrote 1 table to page-tables.csv
Use --quiet to suppress the success report.
Command Line
The command-line entry point is scrape.
scrape tables <html-file-or-url> [--format csv|json] [-o OUTPUT] [--index N] [--quiet]
Options:
--format: output format, eithercsvorjson; defaults tocsv-o,--output: output file path; defaults to a safe source-based filename--index: write one table by zero-based index-q,--quiet: suppress success reports on stdout
Errors and validation messages are written to stderr. If --index is out of
range, the command exits with status code 2.
Python API
Python APIs live under scrape_smith.tools.
from scrape_smith.tools.tables import extract_tables
tables = extract_tables("page.html")
Each extracted table has caption, headers, and rows fields. JSON output
uses the same shape.
Documentation
Full documentation is available at https://scrape-smith.readthedocs.io/.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrape_smith-0.1.1.tar.gz.
File metadata
- Download URL: scrape_smith-0.1.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ac775e08eabfe296f12ce3fdcc4237739dd9c5fd9d05dd8706ec7438f6699a8
|
|
| MD5 |
2e145472a7273110d83205f269ba6082
|
|
| BLAKE2b-256 |
4bcbf101a0798f960f29b8f2f08758f70e554250105241f80f1846dea1ce795b
|
Provenance
The following attestation bundles were made for scrape_smith-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on yeiichi/scrape-smith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrape_smith-0.1.1.tar.gz -
Subject digest:
3ac775e08eabfe296f12ce3fdcc4237739dd9c5fd9d05dd8706ec7438f6699a8 - Sigstore transparency entry: 2123620092
- Sigstore integration time:
-
Permalink:
yeiichi/scrape-smith@553c54f3477b23d5692660cbb9956755059f9aa4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yeiichi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@553c54f3477b23d5692660cbb9956755059f9aa4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scrape_smith-0.1.1-py3-none-any.whl.
File metadata
- Download URL: scrape_smith-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0663b47794a3d8f5962126d689431ae49bcb3ffe2dbabade943cb3863a8cf14a
|
|
| MD5 |
c0aa857b7ed13433578c52c9d38d83c8
|
|
| BLAKE2b-256 |
db3d7051db0c1599960826106281a070c56dec0239dd15a6fbf3e6ea0cff0488
|
Provenance
The following attestation bundles were made for scrape_smith-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on yeiichi/scrape-smith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrape_smith-0.1.1-py3-none-any.whl -
Subject digest:
0663b47794a3d8f5962126d689431ae49bcb3ffe2dbabade943cb3863a8cf14a - Sigstore transparency entry: 2123620097
- Sigstore integration time:
-
Permalink:
yeiichi/scrape-smith@553c54f3477b23d5692660cbb9956755059f9aa4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yeiichi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@553c54f3477b23d5692660cbb9956755059f9aa4 -
Trigger Event:
workflow_dispatch
-
Statement type: