Team plugin for Belgie
Project description
Belgie Team: Team Management on Top of Organizations
[!WARNING]
belgie-teamrequires the organization plugin to be registered first, and both plugins must share a team-capable adapter. The package does not ship built-in HTTP routes.
Belgie Team adds request-scoped team workflows to Belgie without taking over your route design. You register the
plugin, inject TeamClient into your own FastAPI endpoints, and keep control of team creation, membership, and
administrative actions inside app-owned routes.
The package is built for apps that already use Belgie Organization and want organization-scoped teams with explicit adapter wiring and predictable permissions.
Installation
uv add belgie-team belgie-organization
[!NOTE] In the umbrella package, the equivalent install is
uv add belgie[team,organization]. In most real applications you will also wantbelgie[alchemy]or another concrete adapter implementation.
What It Provides
Teamsettings for team-specific configuration.TeamPluginfor FastAPI dependency injection.TeamClientfor app-owned team workflows.TeamViewandTeamMemberViewresponse models.
Quick Start
from typing import Annotated
from fastapi import Depends, FastAPI
from belgie import Belgie, BelgieSettings
from belgie_organization import Organization as OrganizationSettings
from belgie_team import Team as TeamSettings, TeamClient
settings = BelgieSettings(secret="your-secret-key", base_url="http://localhost:8000")
auth = Belgie(settings=settings, adapter=core_adapter, database=...)
organization_plugin = auth.add_plugin(
OrganizationSettings(adapter=team_adapter),
)
team_plugin = auth.add_plugin(
TeamSettings(adapter=team_adapter),
)
app = FastAPI()
app.include_router(auth.router)
@app.post("/teams")
async def create_team(
team: Annotated[TeamClient, Depends(team_plugin)],
) -> dict[str, str]:
created = await team.create(
name="platform",
organization_id=organization_id,
)
return {"team_id": str(created.id)}
@app.get("/teams")
async def list_my_teams(
team: Annotated[TeamClient, Depends(team_plugin)],
) -> dict[str, int]:
teams = await team.for_individual()
return {"count": len(teams)}
Register the organization plugin first. During router initialization, TeamPlugin verifies that the organization
plugin exists and that its adapter implements the team-aware protocol.
Core API
TeamClient exposes the main team workflows:
create,teams,update, anddeletefor_individualmembers,add_member, andremove_member
Behavior
- Creating a team automatically adds the current user as a member if they are not already on the team.
- Team creation and membership management require organization admin or owner permissions.
- Listing members requires both organization membership and team membership.
- Team-scoped operations resolve the owning organization internally from the team record.
Configuration
Team is a Pydantic settings model with the BELGIE_TEAM_ prefix.
adapteris required.maximum_teams_per_organizationoptionally limits team creation.maximum_members_per_teamoptionally limits team membership.
Example
examples/organization_teamshows the full organization + team setup.
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 belgie_team-0.19.0.tar.gz.
File metadata
- Download URL: belgie_team-0.19.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07810416a769316a81ba3bf8c4c563990d2796d991cd8bbf21f03b1c29b2d0b5
|
|
| MD5 |
373579f8521e21a89f5577be244b62db
|
|
| BLAKE2b-256 |
db66415b8459576291bd9931b98d9df12efae9b8cf3063c3150bffb67327bd46
|
File details
Details for the file belgie_team-0.19.0-py3-none-any.whl.
File metadata
- Download URL: belgie_team-0.19.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1ee005ae3e30a764100ab00e0622d5c2802621086948abbd164fd7612d144b8
|
|
| MD5 |
6c44eb69aeaa5bd55d4628fdd7f7aaf4
|
|
| BLAKE2b-256 |
ec93d323b33db32d687fe4fb1f46fce71278e85f283bc2e2b1fda451d65edc22
|