Skip to main content

Habraloader
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

  1. Article Metadata Parsing: Extract article ID, title, author username, and ISO publication timestamp.
  2. Dual Content Extraction: Retrieve full article content in HTML string format or clean plain text.
  3. Image URL Extraction: Automatically discover unique image URLs from <img> and <source> tags.
  4. Batch Image Downloader: Download all images associated with an article into organized output directories.
  5. Session Management: Built-in connection management using requests.Session with 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)

Source distribution for habraloader 1.0.3
File Size Uploaded
habraloader-1.0.3.tar.gz 39.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for habraloader 1.0.3
File Interpreter ABI Platform
habraloader-1.0.3-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page