Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,24 @@ APP_DATABASE__HOST=localhost
APP_DATABASE__PORT=5432
```

### Standalone `load_dotenv`

```python
from msgspec_ext import load_dotenv

# Load .env file into os.environ (does not override existing vars)
load_dotenv()

# Load from a custom path
load_dotenv("config/.env")

# Override existing environment variables
load_dotenv(".env", override=True)

# Custom encoding
load_dotenv(".env", encoding="latin-1")
```

### Nested Configuration

```python
Expand Down
2 changes: 2 additions & 0 deletions src/msgspec_ext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import msgspec

from .fast_dotenv import load_dotenv
from .settings import BaseSettings, SettingsConfigDict, _dec_hook, _enc_hook
from .types import (
AnyUrl,
Expand Down Expand Up @@ -69,4 +70,5 @@
"SettingsConfigDict",
"dec_hook",
"enc_hook",
"load_dotenv",
]
Loading