Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Discord OAuth2

Documentation Status Pypi version PyPi downloads Code style: Black

A modern, easy to use discord OAuth2 API wrapper written in Python.

Installing

Python >3.8 is required.

You can run the following command to install the library:

$ pip install disco.oauth2

To install the development version (lastest), do the following:

$ pip install git+https://github.com/InviteManagerBot/disco.oauth2.git

Getting started

Quick Example

from disco_oauth2 import Client

client = Client(
    client_id=client_id_here,
    client_secret="client_secret_here",
    redirect_uri="redirect_uri_here",
    scopes=["identify", "guilds", "email", "connections"],
)


async def main():
    # Exchange a code received from the callback from the redirect url.
    access_token = await client.exchange_code("my_code")

    # Fetch user's information with access token.
    user = await client.fetch_user(access_token)

    # Fetch user's connections.
    connections = await user.fetch_connections()

    # Fetch guilds that the user is member of.
    guilds = await user.fetch_guilds()

    print(f"{user!r} | {connections!r}")

    for guild in guilds:
        print(f"`{user.name}` member of {guild!r}")

Requirements

  • aiohttp > = 3.7.4, < 4

Optionally you may install the orjson libraries (highly recommended for sake of speed).

License

discord_oauth2 was written by martimartins martim13artins13@gmail.com, licensed under the MIT license.

Contributing

All contributions are welcome ;)

Metadata

Release files for disco.oauth2 1.3b0

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

Source distribution (sdist)

Source distribution for disco.oauth2 1.3b0
File Size Uploaded Provenance Actions
disco.oauth2-1.3b0.tar.gz 18.5 kB Without provenance Details for disco.oauth2-1.3b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for disco.oauth2 1.3b0
File Interpreter ABI Platform Actions
disco.oauth2-1.3b0-py3-none-any.whl Python 3 none any Details for disco.oauth2-1.3b0-py3-none-any.whl

Total release size: 43.9 kB

Release files / disco.oauth2-1.3b0.tar.gz

Download URL disco.oauth2-1.3b0.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
95787ee12a5a7103a531c623ae94528583125d3d59040fae739db3f66583cfd1
BLAKE2b-256 checksum
How to use checksums
022d19dc25e8a61f22e738681a4f6d33757d168d574d7ef4d6e148c1e86db3fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / disco.oauth2-1.3b0-py3-none-any.whl

Download URL disco.oauth2-1.3b0-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1d64169c649a46fcb3445585238b03d6c4551b3a53827bbfa8c637385311b99
BLAKE2b-256 checksum
How to use checksums
0721492304d67a835fac0a0eec94679cfeb77006b92809b15834acb9968a6bd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Security for disco.oauth2 1.3b0

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.

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