HackForums API v2 Integration
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
Installation is easy!
python3 -m pip install -U hfapi
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()
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size hfapi-0.1b0-py3-none-any.whl (14.2 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size hfapi-0.1b0.tar.gz (1.9 kB)||File type Source||Python version None||Upload date||Hashes View|