FastComments.com

FastComments Python SDK


Ovo je službeni Python SDK za FastComments.

Službeni Python SDK za FastComments API

Repozitorij

Pogledaj na GitHubu


Instalacija Internal Link

Install from GitHub

Install directly from a release tag (recommended, fully reproducible):

pip install git+https://github.com/fastcomments/fastcomments-python.git@v3.0.0

Pin the tag rather than a branch so builds are deterministic. The same form works in requirements.txt:

fastcomments @ git+https://github.com/fastcomments/fastcomments-python.git@v3.0.0

Each tagged GitHub Release also has a built wheel attached if you prefer to install a binary artifact directly.

Library Contents

This library contains two modules: the generated API client and the core Python library which contains hand-written utilities to make working with the API easier, including SSO support.

Public vs Secured APIs

For the API client, there are three classes, DefaultApi, PublicApi, and ModerationApi. The DefaultApi contains methods that require your API key, and PublicApi contains methods that can be made directly from a browser/mobile device/etc without authentication. The ModerationApi provides an extensive suite of live and fast moderation APIs. Every ModerationApi method accepts an sso parameter and can authenticate via SSO or a FastComments.com session cookie.

Napomene Internal Link

Broadcast ID-ovi

Vidjet ćete da trebate proslijediti broadcast_id u nekim API pozivima. Kada primite događaje, dobit ćete natrag ovaj ID, pa ćete znati zanemariti događaj ako planirate optimistično primijeniti promjene na klijentu (što ćete vjerojatno htjeti učiniti budući da nudi najbolje korisničko iskustvo). Ovdje proslijedite UUID. ID bi trebao biti dovoljno jedinstven da se ne pojavi dvaput u istoj sesiji preglednika.

Zahtjevi Internal Link

  • Python >= 3.8

Osnovna instalacija je čista standardna biblioteka i pruža SSO alate. Generirani API klijent (DefaultApi/PublicApi/ModerationApi) zahtijeva dodatak client, koji povlači urllib3 >= 1.25.3, python-dateutil >= 2.8.2, pydantic >= 2.0.0 i typing-extensions >= 4.0.0:

pip install "fastcomments[client] @ git+https://github.com/fastcomments/fastcomments-python.git@v3.0.0"

Trebate pomoć?

Ako naiđete na bilo kakve probleme ili imate pitanja u vezi s Python SDK, molimo:

Doprinosi

Doprinosi su dobrodošli! Posjetite GitHub repozitorij za smjernice za doprinos.