A package for communicating with TIgol.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tigol-1.0.1.tar.gz.
File metadata
- Download URL: tigol-1.0.1.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84effeed8208dbf2e45d3a8de14828fe16f855cbffbdfb3ef194244b9390f4e8
|
|
| MD5 |
b73c80da30510788ddb8320e1fc2e72c
|
|
| BLAKE2b-256 |
eea3bc7c367e9b73b7a02411d8b3e7c17d2f4196f69375e461d4ab8507235d97
|
Provenance
The following attestation bundles were made for tigol-1.0.1.tar.gz:
Publisher:
python-publish.yml on alessiodam/TIgol-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tigol-1.0.1.tar.gz -
Subject digest:
84effeed8208dbf2e45d3a8de14828fe16f855cbffbdfb3ef194244b9390f4e8 - Sigstore transparency entry: 169344135
- Sigstore integration time:
-
Permalink:
alessiodam/TIgol-python@6039fef70db7528540e9c808530c6829494e35fa -
Branch / Tag:
refs/tags/1.0.1 - Owner: https://github.com/alessiodam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6039fef70db7528540e9c808530c6829494e35fa -
Trigger Event:
release
-
Statement type:
File details
Details for the file tigol-1.0.1-py3-none-any.whl.
File metadata
- Download URL: tigol-1.0.1-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
562ee912e7789bbd38c43e605345f7802bfd020a78172298dba8768d7b0dec76
|
|
| MD5 |
e0bd78f9a28061a35a7946291785233b
|
|
| BLAKE2b-256 |
b912519d46981241e2aaa30aec6e544469f5f2f59d9695c73d7d4aeb989351f2
|
Provenance
The following attestation bundles were made for tigol-1.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on alessiodam/TIgol-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tigol-1.0.1-py3-none-any.whl -
Subject digest:
562ee912e7789bbd38c43e605345f7802bfd020a78172298dba8768d7b0dec76 - Sigstore transparency entry: 169344138
- Sigstore integration time:
-
Permalink:
alessiodam/TIgol-python@6039fef70db7528540e9c808530c6829494e35fa -
Branch / Tag:
refs/tags/1.0.1 - Owner: https://github.com/alessiodam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6039fef70db7528540e9c808530c6829494e35fa -
Trigger Event:
release
-
Statement type: