semvec/pypi-packages huggingface dataset:
pydantic-asyncapi 0.3.0
Pydantic models of AsyncAPI schema
Requires Python: >=3.9
Keywords: asyncapi, pydantic, schema

![Tests](https://github.com/asynq-io/pydantic-asyncapi/workflows/Tests/badge.svg)
![Build](https://github.com/asynq-io/pydantic-asyncapi/workflows/Publish/badge.svg)
![License](https://img.shields.io/github/license/asynq-io/pydantic-asyncapi)
![Mypy](https://img.shields.io/badge/mypy-checked-blue)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://docs.pydantic.dev/latest/contributing/#badges)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
![Python](https://img.shields.io/pypi/pyversions/pydantic-asyncapi)
![Format](https://img.shields.io/pypi/format/pydantic-asyncapi)
![PyPi](https://img.shields.io/pypi/v/pydantic-asyncapi)

# Pydantic AsyncAPI

Pydantic models for AsyncAPI

## Installation

```shell
pip install pydantic-asyncapi
```

## About

This package provides Pydantic models for [AsyncAPI](https://www.asyncapi.com/).
Currently versions `2.6.0` and `3.0.0` are supported.

The package can be used to:

1. Validate AsyncAPI documents
2. Generate AsyncAPI documents from code
3. Create Python frameworks/applications based on AsyncAPI specification

## Usage

```python
from pydantic_asyncapi import AsyncAPI

# v2 or v3 based on on 'asyncapi' version field
model = AsyncAPI.model_validate(...)

```
dotenvy-py 0.1.0
A Python port of Rust's dotenvy with first-occurrence-wins behavior
Requires Python: >=3.7
Keywords: dotenv, environment, config, env, dotenvy, rust

# dotenvy-py

[![PyPI version](https://badge.fury.io/py/dotenvy-py.svg)](https://badge.fury.io/py/dotenvy-py)
[![Python Versions](https://img.shields.io/pypi/pyversions/dotenvy-py.svg)](https://pypi.org/project/dotenvy-py/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Python port of Rust's dotenvy with first-occurrence-wins behavior.

## Features

- Loads environment variables from `.env` files
- Implements "first occurrence wins" behavior, matching Rust's dotenvy
- Searches for env files in parent directories
- Allows prioritized loading of multiple env files
- Fully typed with PEP 484 annotations
- 100% compatible API with Rust's dotenvy

## Installation

```bash
pip install dotenvy-py
```

## Usage

### Basic Usage

```python
import dotenvy_py

# Load .env file from current directory
env_path = dotenvy_py.dotenv()
if env_path:
    print(f"Loaded environment from: {env_path}")
else:
    print("No .env file found")
```

### Loading Specific File

```python
import dotenvy_py

# Load specific .env file
env_path = dotenvy_py.from_filename(".env.development")
if env_path:
    print(f"Loaded environment from: {env_path}")
```

### Search in Parent Directories

```python
import dotenvy_py

# Find an env file in the current or parent directories
env_path = dotenvy_py.find_upwards(".env.production")
if env_path:
    print(f"Found environment file at: {env_path}")
    # Load it
    dotenvy_py.from_filename(env_path)
```

### Priority Loading (like .env.game_client then .env)

```python
import dotenvy_py

# Load files in priority order (first file has highest priority)
loaded_files = dotenvy_py.load_with_priority([".env.game_client", ".env"])
if loaded_files:
    print(f"Loaded environment files: {', '.join(str(p) for p in loaded_files)}")
else:
    print("No environment files found")
```

## First Occurrence Wins Behavior

Unlike the standard Python `python-dotenv` library where later definitions override earlier ones, `dotenvy-py` implements the "first occurrence wins" behavior:

1. Environment variables that already exist in the process environment take precedence over variables in `.env` files
2. The first definition of a variable in a file (or across multiple files) is used, later definitions are ignored
3. This matches the behavior of Rust's `dotenvy` crate

## License

MIT