An asynchronous wrapper for the Pretend API.
Project description
# PretendAPI
PretendAPI is an asynchronous wrapper for the Pretend API, designed to simplify
the process of fetching user information from the official Pretend API.
## Features
- Asynchronous requests using `aiohttp`
- Dot notation access to JSON responses
- Rate limiting support
- Handles exceptions gracefully
## Installation
You can install the package via pip:
```bash
pip install pretend-api
Methods
get_userinfo(user_id: int)
Fetches user information about a Discord user.
- Parameters:
user_id(int): The user ID of the user.
- Returns: User information with dot notation access.
get_tiktok_user(username: str)
Fetches information about a TikTok user.
- Parameters:
username(str): The TikTok username.
- Returns: TikTok user information with dot notation access.
get_instagram_user(username: str)
Fetches information about an Instagram user.
- Parameters:
username(str): The Instagram username.
- Returns: Instagram user information with dot notation access.
get_twitter_user(username: str)
Fetches information about a Twitter user.
- Parameters:
username(str): The Twitter username.
- Returns: Twitter user information with dot notation access.
get_roblox_user(username: str)
Fetches information about a Roblox user.
- Parameters:
username(str): The Roblox username.
- Returns: Roblox user information with dot notation access.
get_signed_biolink(username: str)
Fetches information about a signed.bio user.
- Parameters:
username(str): The signed.bio username.
- Returns: signed.bio user information with dot notation access.
Usage
Here's a basic example of how to use the PretendAPI:
import asyncio
from pretend_api import PretendAPI
async def main():
api_wrapper = PretendAPI(api_key="YOUR_API_KEY")
user_info = await api_wrapper.get_userinfo(user_id=123456789)
print(user_info.username)
asyncio.run(main())
License
This project is licensed under the MIT License. See the LICENSE file for details.
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
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 pretendapi-0.1.1.tar.gz.
File metadata
- Download URL: pretendapi-0.1.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cc84f5a7997e1b76f4d1e86723eed94f1c00b73dfcda4446f4b821bfcb51ae9
|
|
| MD5 |
720106084d1d7d585a3e66429eb66b3c
|
|
| BLAKE2b-256 |
9ea6bd8cb79bba7d0f7a4b24043ec5d63467f0842ffc52a40292f2e6527b32b7
|
File details
Details for the file pretendapi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pretendapi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911b492ffb467e3adff37c91e186b71e42863bdd34410b99644822ae4b55b30f
|
|
| MD5 |
61bf9d23353f370d7a163922d9729ad8
|
|
| BLAKE2b-256 |
2913b2698140eccebf56f75a75e24da26ece4e310ad687e9a3306d0779882b4d
|