Skip to main content

HackForums API v2 Integration

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hfapi-0.1b0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

hfapi-0.1b0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file hfapi-0.1b0.tar.gz.

File metadata

  • Download URL: hfapi-0.1b0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for hfapi-0.1b0.tar.gz
Algorithm Hash digest
SHA256 b175c4bc74a9f5fd75da1764380a3c80aff14ed1633ea04c9104c67399298cb7
MD5 ec5d2629b022ae83cd0f07abfc7788c9
BLAKE2b-256 8094942025e2890cbb1d06751da75fd00382127cc26dd5065f484ff2f4456fb6

See more details on using hashes here.

File details

Details for the file hfapi-0.1b0-py3-none-any.whl.

File metadata

  • Download URL: hfapi-0.1b0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for hfapi-0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 aba2eb5f9ee25be4c66f78f4ba15f60ba8533acb60bece0777baecf030a4dba9
MD5 40d9eb16e3511eb12f6e17d51eb08f94
BLAKE2b-256 ade1905b45b22c8bc095f0722463aceea9e7c12d7695e0a1b4c7611ed4c09ff8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page