Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

py-pane

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

py-pane

A modern dataclass & data conversion library, focused on speed and expressiveness.

  • 0.8.2
  • PyPI
  • Socket score

Maintainers
1

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:

FeatureState
Basic type conversionsDone
Numeric array types (numpy)Done
Sum & product type supportDone
Tagged unionsPartial
'Flattened' fieldsPlanned
Basic dataclassesDone
Dataclass helpersPartial
Generic & inherited dataclassesDone
Parameter aliases & renamingDone
Arbitrary validation logicDone
Schema import/exportNot planned

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc