Skip to main content

pane

pane is a modern Python library for dataclasses and data conversion, aiming for speed and expressiveness.

pane draws heavy inspiration from Pydantic (among others), but its goals are quite different. For example, pane has first-class conversion to and from all JSON datatypes, not just mappings (and no 'root' hacks necessary). In this sense pane is a library for general data conversion & validation, while Pydantic is a dataclass-first library. In addition, pane is stricter than Pydantic in several cases. For instance, pane will not attempt to coerce 3.14 or "3" to an integer.

pane is designed to be used to create complex declarative configuration languages in formats like JSON, TOML, and YAML. This requires full support for complex, nested types like t.Union[int, t.Tuple[int, str], list[int]]. It also requires useful error messages:

>>> pane.convert('fail', t.Union[int, t.Tuple[int, str], list[int]])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pane/convert.py", line 489, in convert
    return from_data(data, ty)
           ^^^^^^^^^^^^^^^^^^^
  File "pane/convert.py", line 484, in from_data
    return converter.convert(val)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "pane/convert.py", line 128, in convert
    raise ConvertError(node)
pane.convert.ConvertError: Expected one of:
- an int
- tuple of length 2
- sequence
Instead got `fail` of type `str`

Features

pane is a work in progress. The following is a roadmap of features:

Feature State
Basic type conversions Done
Numeric array types (numpy) Done
Sum & product type support Done
Tagged unions Partial
'Flattened' fields Planned
Basic dataclasses Done
Dataclass helpers Partial
Generic & inherited dataclasses Done
Parameter aliases & renaming Done
Arbitrary validation logic Done
Schema import/export Not planned

Release files for py-pane 0.11.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-pane 0.11.6
File Size Uploaded
py_pane-0.11.6.tar.gz 48.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-pane 0.11.6
File Interpreter ABI Platform
py_pane-0.11.6-py3-none-any.whl Python 3 none any Details

Total release size:90.3 kB

Release files / py_pane-0.11.6.tar.gz

Download URL py_pane-0.11.6.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c75eeb2ff1901b65fb59212e11b174ec3e421495e95aeebe5e7dd83d5893ddd9
BLAKE2b-256 checksum
How to use checksums
9ccc00b5a950dfe6d44ec7eba9bdfb3b1cfbdb34341b2b13685e66aa5545d1fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / py_pane-0.11.6-py3-none-any.whl

Download URL py_pane-0.11.6-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d507cefd83612d81c895c2ef5c6db7237282152609c62d46042d30705b748879
BLAKE2b-256 checksum
How to use checksums
6dd66699734153dc05b5044813094aa0ee3af6d58c115d6fee381e9996bcd4ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

0.11.7

2 release files

This release

0.11.6 This release

2 release files

0.11.5

2 release files

0.11.4

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page