Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Purpose

Other public Python implementations of the HackForums API have shown to be immature or varying levels of incomplete. The goal of this project is to provide a fully usable Python API for Hackforums available through pip. hfapi features include: - Read/Write profile user profile information - Easy and intuitive integration with Python network applications - Synchronous (requests) and Asynchronous (aiohttp) implementations - All API objects are defined with Pydantic

How-To: Install

Installation is easy!

python3 -m pip install -U hfapi

How-To Use

The synchronous and asynchronous API implementations are identical in functionality and usage with the addition of await syntax in the asynchronous version.

# use "HFApp" and "HFClient" for synchronous
from hfapi import HFAppAsync, HFClientAsync

app = """ EXAMPLE WEB SERVER HERE """

hf = HFAppAsync(
    client_id="[CLIENT_ID]",
    secret_key="[SECRET_KEY]",
    redirect_uri="https://example.com/authorize",
)

# Hackforums will submit a GET request with "code" as a parameter
@app.get("/authorize")
async def authorize(code: str):
    # use the `hf.authorize` method to create a client session
    client = await hf.authorize(code)
    me = await client.me(all=True)  # collect all (possible) data from current user
    return me.dict()

Metadata

Release files for hfapi 0.1b0

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

Source distribution (sdist)

Source distribution for hfapi 0.1b0
File Size Uploaded
hfapi-0.1b0.tar.gz 1.9 kB Details

Built distribution (wheel)

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

Total release size: 16.1 kB

Release files / hfapi-0.1b0.tar.gz

Download URL hfapi-0.1b0.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b175c4bc74a9f5fd75da1764380a3c80aff14ed1633ea04c9104c67399298cb7
BLAKE2b-256 checksum
How to use checksums
8094942025e2890cbb1d06751da75fd00382127cc26dd5065f484ff2f4456fb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

Release files / hfapi-0.1b0-py3-none-any.whl

Download URL hfapi-0.1b0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aba2eb5f9ee25be4c66f78f4ba15f60ba8533acb60bece0777baecf030a4dba9
BLAKE2b-256 checksum
How to use checksums
ade1905b45b22c8bc095f0722463aceea9e7c12d7695e0a1b4c7611ed4c09ff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1b0 This release

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