You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

netcord

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netcord

Asynchronous Discord OAuth2 library for FastAPI (identify, email, guilds scopes support)

2.2.5
pipPyPI
Maintainers
1

📦 Netcord 2.0.0 — The Async Discord OAuth2 Toolkit for FastAPI

A complete rewrite. Cleaner. Smarter. Async-native.

✨ What's New

  • Full Asynchronous Support: Built entirely on httpx.AsyncClient for non-blocking HTTP interactions.
  • Pydantic Models: Structured responses using pydantic for type safety and validation.
  • OAuth2 Flow Simplified: Easily exchange codes for tokens and retrieve user data.
  • Scope Management: Support for identify, email, and guilds scopes.
  • CDN Helpers: Generate direct URLs for avatars and icons with format detection (.gif/.png).
  • Custom Exceptions: Clear and informative error handling built upon fastapi.HTTPException.

🔧 Configuration

Set up your credentials once:

from netcord import Netcord

client = Netcord(
    client_id='your_client_id',
    client_secret='your_client_secret',
    redirect_uri='https://yourapp.com/callback',
    bot_token='your_bot_token'
)

Then, use the client to interact with Discord's API seamlessly.

🧩 Integration with FastAPI

Designed to work harmoniously with FastAPI:

  • Use dependencies to inject authenticated users into your routes.
  • Leverage custom exceptions for consistent error responses.

Note: While direct FastAPI integrations are planned, the current version focuses on providing the core functionality. Future updates will enhance this integration further.

🚀 Why Upgrade?

  • Modern Architecture: Leveraging the latest Python features and libraries.
  • Improved Developer Experience: Cleaner codebase and better documentation.
  • Enhanced Performance: Asynchronous operations lead to better scalability.

Keywords

api

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.