semvec/pypi-packages huggingface dataset:
koda-validate 5.1.0
Typesafe, composable validation
License: MIT
Requires Python: <4.0,>=3.9
Keywords: validation, type hints, asyncio, serialization, typesafe, validate, validators, predicate, processor

# Koda Validate

Koda Validate is a library and toolkit for building composable and typesafe validators. In many cases,
validators can be derived from typehints (e.g. TypedDicts, dataclasses, and NamedTuples). For everything else, you can 
combine existing validation logic, or write your own. At its heart, Koda Validate is just a few kinds of
callables that fit together, so the possibilities are endless. It is async-friendly and comparable in performance to Pydantic 2.

Koda Validate can be used in normal control flow or as a runtime type checker.

Docs: [https://koda-validate.readthedocs.io/en/stable/](https://koda-validate.readthedocs.io/en/stable/)

## At a Glance

```python
from koda_validate import StringValidator

my_string_validator = StringValidator()

my_string_validator("a string!")
#> Valid("a string!")

my_string_validator(5)
#> Invalid(...)
```

#### Additional Validation
```python
from koda_validate import MaxLength, MinLength

str_len_validator = StringValidator(MinLength(1), MaxLength(20))

str_len_validator("abc")
#> Valid("abc")

str_len_validator("")
#> Invalid(...)

str_len_validator("abcdefghijklmnopqrstuvwxyz")
#> Invalid(...)
```

#### Combining Validators

```python
from koda_validate import ListValidator, StringValidator

list_string_validator = ListValidator(StringValidator())

list_string_validator(["a", "b", "c"])
# > Valid(["a", "b", "c"])

list_string_validator([1, 2, 3])
# > Invalid(...)
```

#### Derived Validators

```python
from typing import TypedDict
from koda_validate import (TypedDictValidator, Valid, Invalid)
from koda_validate.serialization import to_serializable_errs

class Person(TypedDict):
    name: str
    hobbies: list[str]


person_validator = TypedDictValidator(Person)

match person_validator({"name": "Guido"}):
    case Valid(string_list):
        print(f"woohoo, valid!")
    case Invalid() as invalid:
        # readable errors
        print(to_serializable_errs(invalid))

#> {'hobbies': ['key missing']}
```

#### Runtime Type Checking

```python
from koda_validate.signature import validate_signature

@validate_signature
def add(a: int, b: int) -> int:
    return a + b


add(1, 2)  # returns 3

add(1, "2")  # raises `InvalidArgsError`
# koda_validate.signature.InvalidArgsError:
# Invalid Argument Values
# -----------------------
# b='2'
#     expected <class 'int'>
```

There's much, much more in the [Docs](https://koda-validate.readthedocs.io/en/stable/).


## Something's Missing or Wrong 
Open an [issue on GitHub](https://github.com/keithasaurus/koda-validate/issues) please!
batchcal 0.1.0
Tiny wrapper for batched multi-provider LLM calls
License: MIT
Requires Python: >=3.9

batchcal — a tiny wrapper for multi‑provider batch LLM calls

When you have jobs that don't require a real time responses and can use "save token mode" performance, this library can help with reducing token cost and bypass online rate limits and have separate quotas.
eg. nightly jobs, dataset annotation, evals etc.

Features
- Unified request/response dataclasses
- Providers: OpenAI
- Async single + batch with bounded concurrency
- Simple QPS rate limiting
- Retries with exponential backoff + jitter on transient errors
- Per‑request timeouts
- Optional response validation hook
- Pluggable transport (httpx by default)

Install
pip install batchcal
(or clone then: pip install .)

Env Vars
- OPENAI_API_KEY

Usage

Note: you must `pip install httpx` (installed automatically if using pyproject) and have valid API keys.

Example:
```python
from batchcal import BatchClient, OpenAIProvider, Msg

async def main():
    client = BatchClient(OpenAIProvider(), qps=2.0, max_concurrency=5)
    resp = await client.acomplete([Msg.user("Ping")], model="gpt-4.1-mini")
    print(resp.content)
```

With Validation:
```python
from batchcal import BatchClient, OpenAIProvider, Msg, require_json

client = BatchClient(OpenAIProvider(), validate=require_json)

# or custom:
def validate_nonempty(r):
    if not r.content.strip():
        raise ValueError("Empty output")
```

Batch:
```python
prompts = [[Msg.user(f"Item {i}")] for i in range(20)]
resps = await client.abatch(prompts, model="gpt-4.1-mini")
for r in resps:
    print(r.content)
```

Testing
Install dev deps: pip install .[dev]
Run: pytest -q
Tests mock the OpenAI API (no network, no real key needed).

Publishing
1. Update version in pyproject.toml
2. python -m build
3. twine upload dist/*
spinachlang 0.2.3
A quantum programming language and compiler.
License: MIT
Requires Python: >=3.10

# Spinach lang
![logo for Spinach](spinach.png "Spinach")
Spinach is a quantum programming language.
Its goal is to provide a dedicated language that can simulate and compile code for execution on quantum computers.

[documentation](https://spinachlang.github.io/spinachsite/)


[source](https://github.com/spinachlang/spinachlang)


[examples](https://github.com/spinachlang/spinachlang-algorithms)