pydantic
The default data validation library for Python
from datetime import datetime
from typing import Tuple
from pydantic import BaseModel
class Delivery(BaseModel):
timestamp: datetime
dimensions: Tuple[int, int]
m = Delivery(timestamp='2020-01-02T03:04:05Z', dimensions=['10', '20'])
print(repr(m.timestamp))
#> datetime.datetime(2020, 1, 2, 3, 4, 5, tzinfo=TzInfo(UTC))
print(m.dimensions)
#> (10, 20)
Pydantic is the most widely used data validation library, downloaded millions of times a day by thousands of developers all over the world.
Pydantic's success stems from its great developer experience.It's simple to use, even when doing complex things.
PydanticAI
Agent Framework / shim to use Pydantic with LLMs
- PydanticAI is a Python agent framework designed to make it less painful to build production grade applications with Generative AI.
- Model-agnostic: PydanticAI supports OpenAI, Anthropic, Gemini, Deepseek, Ollama, Groq, Cohere, and Mistral.
from pydantic_ai import Agent
agent = Agent(
'openai:gpt-4o',
system_prompt='Be concise, reply with one sentence.',
)
result = agent.run_sync('Where does `hello world` come from?')
print(result.data)
#> The first known use of "hello, world" was
#> in a 1974 textbook about the C language.
arq
Fast job queuing and RPC in Python with asyncio and redis.
- Enjoy non-blocking job enqueuing and execution. Multiple jobs can run simultaneously.
- Move fast — asyncio and no forking make Arq around 7x faster than other tools.
import asyncio
from arq import create_pool
from arq.connections import RedisSettings
from httpx import AsyncClient
async def main():
redis = await create_pool(RedisSettings())
for url in ('https://facebook.com', 'https://microsoft.com', 'https://github.com'):
await redis.enqueue_job('download_content', url)
async def download_content(ctx, url):
response = await ctx['session'].get(url)
print(f'{url}: {response.text:.80}...')
return len(response.text)
async def startup(ctx):
ctx['session'] = AsyncClient()
speedate
Fast and simple datetime, date, time and duration parsing for Rust.
- Build with total flexibility. Speedate supports multiple formats.
- Enjoy peace of mind — all relaxations from RFC 3339 are compliant with ISO 8601.
use speedate::{DateTime, Date, Time};
fn main() {
let dt = DateTime::parse_str("2022-01-01T12:13:14Z").unwrap();
assert_eq!(
dt,
DateTime {
date: Date {
year: 2022,
month: 1,
day: 1,
},
time: Time {
hour: 12,
minute: 13,
second: 14,
microsecond: 0,
tz_offset: Some(0),
},
}
);
println!("{}", dt.to_string()); // "2022-01-01T12:13:14Z"
}
jiter
The fast, iterable JSON parser with multiple interfaces.
- Stable and battle tested, jiter is the most downloaded third party JSON parser for Python
- Significantly faster than serde-json in most scenarios
- Supports partial/incomplete JSON parsing, especially useful for LLM output
use jiter::JsonValue;
fn main() {
let json_data = r#"
{
\"name\": \"John Doe\",
\"age\": 43,
\"phones\": [
\"+44 1234567\",
\"+44 2345678\"
]
}"#;
let json_value = JsonValue::parse(json_data.as_bytes(), true).unwrap();
println!("{:#?}", json_value);
}
The Pydantic Open Source Fund
For too long the open source ecosystem has been taken for granted. We're proud to be part of the movement to change that. More about the Pydantic Open Source fund initiative.
Pydantic is proud to be a member of the open source pledge