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.7

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.7
File Size Uploaded
py_pane-0.11.7.tar.gz 48.9 kB Details

Built distribution (wheel)

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

Total release size:90.7 kB

Release files / py_pane-0.11.7.tar.gz

Download URL py_pane-0.11.7.tar.gz
Size 48.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dd5f7ab796814860cce53573ffe4da99b8195c6d4120c1ba2bd76b8bed00a75d
BLAKE2b-256 checksum
How to use checksums
fe210bc98d7a3fa81a3c7b193b3682362299303b49d3af5907db538f2d937ce5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL py_pane-0.11.7-py3-none-any.whl
Size 41.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34f47c73236de601ed11362869d41644332231c31cc6b10cf62fba36a67bb184
BLAKE2b-256 checksum
How to use checksums
baf99dd1b0158cc17abdb3c363f795ab1cfcde943c155289682a37eaa81b440f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.11.7 This release

2 release files

0.11.6

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