discordbio
An asynchronous Python wrapper for the discord.bio API
Installing
pip install discordbio
Usage
- Setting up the client
This will be used to make requests to the API
from discordbio import DBioClient
client = DBioClient()
- Exceptions
| Error | Description |
|---|---|
| discordbio.errors.BaseDBioException | Exception others subclass from, can be used to catch any error thrown from the wrapper |
| discordbio.errors.DBioError | Raised when discord.bio doesn't return a successful response |
| discordbio.errors.HTTPException | Raised when the request to discord.bio itself fails |
- Getting a user's details, via username or Discord ID
All methods of DBioClient are typed meaning your IDE should auto complete the attributes If not, you can import the types (UserDetails and UserConnections) and manually set the type
details = await client.details("geek")
# With Type
from discordbio import UserDetails
details: UserDetails = await client.details("geek")
- Getting a specific value from a user's details, e.g. description or a users flags
description = (await client.details("geek")).settings.description
flags = (await client.details("geek")).discord.flags
# Flags can be used to determine a user's badges
- Getting a user's connections
connections = await client.connections("geek")
# With Discord connections
connections = await client.connections("geek", with_discord=True)
# With Type
from discordbio import UserConnections
connections: UserConnections = await client.connections("geek", with_discord=True)
- Miscellaneous Endpoints
users: int = await client.total_users() # Returns total user count
from discordbio import PartialUser
from typing import List
upvoted: List[PartialUser] = await client.top_upvoted()
Attributes
- UserDetails (from client.details)
settings: Settings
discord: Discord
- Settings
user_id: int
name: str
status: Optional[str]
description: Optional[str]
verified: bool
upvotes: int
premium: bool
location: Optional[str]
gender: Optional[str]
birthday: Optional[datetime]
email: Optional[str]
occupation: Optional[str]
created_at: datetime
banner: Optional[str]
- Discord
id: int
username: str
avatar: Optional[str]
avatar_url: str
is_avatar_animated: bool
discriminator: str
flags: int
- Partial User (from client.top_upvoted)
user_id: int
name: str
description: Optional[str]
verified: bool
upvotes: int
premium: bool
discord: Discord
- Connections (from client.connections)
github: Optional[str]
website: Optional[str]
instagram: Optional[str]
snapchat: Optional[str]
linkedin: Optional[str]
discord: List[DiscordConnection]
- Discord Connections
connection_type: str
name: str
url: str
Metadata
Release files for discordbio 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| discordbio-1.3.0.tar.gz | 6.0 kB | Without provenance | Details for discordbio-1.3.0.tar.gz |
Release files / discordbio-1.3.0.tar.gz
| Download URL | discordbio-1.3.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4513ad84728c6d16cc9ee0296519c6421dc44a2c45c1371d5b83909310371b42
|
|
BLAKE2b-256 checksum How to use checksums |
2fd499932ec4aa3a6661d8691c1ff2cc01fff0ac963461d76570b1c75530f0a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for discordbio 1.3.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.