Skip to main content

HFR API

A Python library to interface with forum.hardware.fr.

Installation

You can install the package using pip:

pip install hfr-api

Usage

Browsing a Category

You can browse topics in a specific category.

from hfr import Category

# Initialize a category (e.g., category 13 for "Discussions")
# See hfr/category.py for a mapping of category IDs
category = Category(13)

# Load the first page of topics
category.load_page(1)

# Iterate through the topics found on that page
for topic in category.topics:
    print(f"Topic ID: {topic.post}, Sticky: {topic.sticky}")
    # Note: Topic title is not available until the topic itself is loaded

Reading a Topic

You can access messages within a topic.

from hfr import Topic

# Initialize a topic with: Category ID, Subcategory ID, Post ID
topic = Topic(cat=13, subcat=432, post=73768)

# Load the first page of the topic
topic.load_page(1)

print(f"Title: {topic.title}")

# Iterate through messages
# Messages are grouped by date (YYYY-MM-DD)
for date_str, messages_dict in topic.messages.items():
    print(f"--- Date: {date_str} ---")
    for msg_id, message in messages_dict.items():
        print(f"[{message.posted_at}] {message.author}:")
        print(message.text)
        print("-" * 20)

CLI

The package includes a command-line interface to interact with the forum.

Installation

You can install the CLI tool using uv or pipx:

uv tool install hfr-api
# or
pipx install hfr-api

Once installed, the hfr command will be available in your path.

Get Topic Info

Retrieve metadata about a topic as JSON.

hfr info <cat> <subcat> <post>
# Example
hfr info 13 432 73768

Dump Topic Content

Dump all messages from a topic (or a specific page) to JSON.

hfr dump <cat> <subcat> <post> <output_file> [--page <page_number>]

# Example: Dump all pages to a file
hfr dump 13 432 73768 my_topic.json

# Example: Dump all pages to stdout
hfr dump 13 432 73768 - > my_topic.json

# Example: Dump only page 1 to a file
hfr dump 13 432 73768 page1.json --page 1

Features

  • Categories: List topics within a forum category.
  • Topics: Read messages, retrieve metadata (page count, dates).
  • Messages: Parse content including BBCode strings.
  • Parsers: Handles HTML parsing from the forum.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Release files for hfr-api 0.3.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hfr-api 0.3.12
File Size Uploaded
hfr_api-0.3.12.tar.gz 81.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hfr-api 0.3.12
File Interpreter ABI Platform
hfr_api-0.3.12-py3-none-any.whl Python 3 none any Details

Total release size: 104.0 kB

Release files / hfr_api-0.3.12.tar.gz

Download URL hfr_api-0.3.12.tar.gz
Size 81.9 kB
Tags Source
SHA-256 checksum
How to use checksums
968dbcd36f8bfc513e630c947edf93dddf85b4f0fa2d6deb4e2865fdf3d9e572
BLAKE2b-256 checksum
How to use checksums
68748f8cb3a4382777fe6b5b8454415d134188f20503e8809d241bd281bb19c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release files / hfr_api-0.3.12-py3-none-any.whl

Download URL hfr_api-0.3.12-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ed9df6cb099c3beb3b8d6aee5777b5f90d80a1be1384d10edc4740f04546d9b
BLAKE2b-256 checksum
How to use checksums
a6261995c93db8716da6fe033895cd78315a24458767e5c16a28ac45c512c0ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

This release

0.3.12 This release

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

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