derp – Top-level API

class derp.DerpClient[source]

Bases: object

Derp client for interacting with database, file storage, and more.

__init__(config)[source]
Parameters:

config (DerpConfig)

async connect()[source]

Start a session.

Return type:

None

async disconnect()[source]

End a session.

Return type:

None

property db: DatabaseEngine

Get the database engine.

property email: EmailClient

Get the email client.

property storage: StorageClient

Get the storage client.

property auth: BaseAuthClient

Get the auth service.

property kv: KVClient

Get the KV client.

property payments: PaymentsClient

Get the payments client.

property queue: QueueClient

Get the queue client.

property ai: AIClient

Get the AI client.

property config: DerpConfig

Get the Derp configuration.

class derp.DerpConfig[source]

Bases: _StrictModel

Derp configuration.

database: DatabaseConfig
email: EmailConfig | None
storage: StorageConfig | None
auth: AuthConfig | None
kv: KVConfig | None
payments: PaymentsConfig | None
queue: QueueConfig | None
ai: AIConfig | None
classmethod load(path='derp.toml')[source]
Parameters:

path (str | Path)

Return type:

DerpConfig

redacted_dump()[source]

Return config as a dict with environment variable values redacted.

Return type:

dict

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None