Habraloader
Habraloader is a lightweight Python library for parsing articles and downloading embedded media from Habr. It extracts essential metadata (title, author, publication date), retrieves the main body content in both HTML and plain text formats, and provides built-in utilities to download all article images directly to your local filesystem.
Features
- Article Metadata Parsing: Extract article ID, title, author username, and ISO publication timestamp.
- Dual Content Extraction: Retrieve full article content in HTML string format or clean plain text.
- Image URL Extraction: Automatically discover unique image URLs from
<img>and<source>tags. - Batch Image Downloader: Download all images associated with an article into organized output directories.
- Session Management: Built-in connection management using
requests.Sessionwith realistic User-Agent headers.
Quickstart
Below is a complete example showing how to initialize the parser, fetch an article by its ID, save it as a Markdown file, and download its images:
from habraloader import HabrParser
parser = HabrParser()
article = parser.get_article(668378)
print(f"Title: {article.title}")
print(f"Author: {article.author}")
# Save article to a Markdown file
file_path = article.save_md()
print(f"Article successfully saved to: {file_path}")
# Download images (if any)
saved_files = article.save_images(target_dir="downloaded_images")
print(f"Successfully saved images: {len(saved_files)}")
Metadata
Release files for habraloader 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| habraloader-1.0.3.tar.gz | 39.3 kB | Without provenance | Details for habraloader-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| habraloader-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for habraloader-1.0.3-py3-none-any.whl |
Total release size: 43.7 kB
Release files / habraloader-1.0.3.tar.gz
| Download URL | habraloader-1.0.3.tar.gz |
|---|---|
| Size | 39.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6b841599f99935f799c18739c55139404e6388dbfa47a5b177e63426ba18539
|
|
BLAKE2b-256 checksum How to use checksums |
84406589fe78c04da41e16d5f79f4e6edb560b356f03b97b97900acb16ad2625
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.18.0 {"ci":null,"cpu":"AMD64","implementation":{"name":"CPython","version":"3.13.7"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.16 11 Feb 2025","python":"3.13.7","system":{"name":"Windows","release":"11"}} HTTPX2/2.10.0
|
Release files / habraloader-1.0.3-py3-none-any.whl
| Download URL | habraloader-1.0.3-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
158d1a72ca497ae03e52b8e604dfad47353e7c60f0936d17d99820775a43019e
|
|
BLAKE2b-256 checksum How to use checksums |
d986790fedb553c0fc1f2fb0904ad42a4040cb719f02221e0bf497b364717f55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.18.0 {"ci":null,"cpu":"AMD64","implementation":{"name":"CPython","version":"3.13.7"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.16 11 Feb 2025","python":"3.13.7","system":{"name":"Windows","release":"11"}} HTTPX2/2.10.0
|
Security for habraloader 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.