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.2

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.2
File Size Uploaded
habraloader-1.0.2.tar.gz 39.2 kB Details

Built distribution (wheel)

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

Total release size: 43.4 kB

Release files / habraloader-1.0.2.tar.gz

Download URL habraloader-1.0.2.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
94830f0101fce4f8e1c311bb2a08225574129c32f9c128dbd47890469880dca7
BLAKE2b-256 checksum
How to use checksums
fa4c2e2ba4e08ec0c275710098a0718da42bf5fbb097c892b6d890510a209d9e
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.2-py3-none-any.whl

Download URL habraloader-1.0.2-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c337bb97211bcb94471f44d1bea4729bbf1f1728f17350b64f83c1862706e9e
BLAKE2b-256 checksum
How to use checksums
526bbcd8e25487e134cecb1f5300a9d0644cb52a4727fc5604020b730da58aa2
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

1.0.3

2 release files

This release

1.0.2 This release

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