Skip to main content

TIgol API Wrapper (Python)

This repository provides a Python wrapper for the TIgol API.

Example

You can find an example usage here.

# Description: Example script to demonstrate how to use the TIgol API Client to get user information
# This expects a valid client ID and a valid client secret to be used for the API client
# When creating the application on TIgol, please ensure that the redirect URI is set to `https://example.com/authorized`
import sys
from tigol import TIgolApiClient, User

# Initialize the TIgol API Client
tigol_client = TIgolApiClient(
  client_id="client_id",
  client_secret="client_secret",
)

# Get authorization code from user
auth_url = tigol_client.get_authorization_url(redirect_uri="https://example.com/authorized", scopes=["user:read"])
auth_code_input = input(f"""
Please go to the following URL to authorize the application:

{auth_url}

After authorization, you will be redirected to a URL. 
Please copy the code from the redirected URL (for example, copy `abc` from ?token=abc) and paste it here: 
""")
auth_code = auth_code_input.strip()

token_obj = tigol_client.exchange_code_for_token(code=auth_code)
if "user:read" not in token_obj.scopes:
  print("user:read scope wasn't accepted, can't continue.")
  sys.exit(1)

user_obj: User = tigol_client.get_user(token_obj)
print(f"User Information: {user_obj}")

License

This project is licensed under the GNU AGPLv3 License. See the LICENSE file for details.

Metadata

Release files for tigol 1.0.1

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

Source distribution (sdist)

Source distribution for tigol 1.0.1
File Size Uploaded Provenance
tigol-1.0.1.tar.gz 29.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 59.5 kB

Release files / tigol-1.0.1.tar.gz

Download URL tigol-1.0.1.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
84effeed8208dbf2e45d3a8de14828fe16f855cbffbdfb3ef194244b9390f4e8
BLAKE2b-256 checksum
How to use checksums
eea3bc7c367e9b73b7a02411d8b3e7c17d2f4196f69375e461d4ab8507235d97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Feb 6, 2025.

Transparency log

Release files / tigol-1.0.1-py3-none-any.whl

Download URL tigol-1.0.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
562ee912e7789bbd38c43e605345f7802bfd020a78172298dba8768d7b0dec76
BLAKE2b-256 checksum
How to use checksums
b912519d46981241e2aaa30aec6e544469f5f2f59d9695c73d7d4aeb989351f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Feb 6, 2025.

Transparency log

Security for tigol 1.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tigol-1.0.1.tar.gz

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 Feb 6, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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