Skip to main content

A extended trait and type system for python using jsonschema.

wtypes is an extended type and trait system for python.

pip install wtypes
    from wtypes import *

wtypes provide:

  • Extended type system python validation that feature a jsonschema and symbollic type composition.

      Integer, Float, Dict, List, Email, Uri, Color, Datetime, Regex
    
  • Configurable dataclasses.

      class Thing(DataClass):
          name: String
          location: Uri|Jsonpointer
    
      class Thing(DataClass):
          name: String
          location: Uri|Jsonpointer
          
      Thing(name='wtypes', location='https://github.com/deathbeds/wtypes')
    
  • Typed evented objects.

      class Thing(evented.DataClass):
          name: String
          location: Uri|Jsonpointer
          
      Thing(name='wtypes', location='https://github.com/deathbeds/wtypes')
    
  • Generate examples of types with hypothesis_jsonschema and genson

      Uri.example(), Datetime.example(), Dict[{'a': Email}].example()
    
  • Mixed python and jsonschema types

      t = Instance[range] | Integer
      t(10), t(range(10))
    
  • future work will expand on semantic RDF type information.

Background

wtypes is inspired by traitlets - the core trait library used by IPython and jupyter - and pydantic - a jsonschema type system for python. Both pydantic and traitlets build type systems that can be validated. pydantic lacks interactive validate, a feature of traitlets. traitlets also provides an observable pattern for evented objects. Both pydantic and traitlets types are represented as python objects. wtypes includes features from these libraries in a composable type system.

Release files for wtypes 0.0.2

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

Source distribution (sdist)

Source distribution for wtypes 0.0.2
File Size Uploaded
wtypes-0.0.2.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wtypes 0.0.2
File Interpreter ABI Platform
wtypes-0.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 42.9 kB

Release files / wtypes-0.0.2.tar.gz

Download URL wtypes-0.0.2.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
23fe6d2fb6b5fedfdec9c90a073f910cf651b21c6cbd2294bd76b2b2b9108c13
BLAKE2b-256 checksum
How to use checksums
a09b69993a012ede817d936377ee7556bd50326a5d7116d12a1bc35743351e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release files / wtypes-0.0.2-py2.py3-none-any.whl

Download URL wtypes-0.0.2-py2.py3-none-any.whl
Size 23.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2ced8b42a9e916a92ab551d8adbebbdf7c6f08f6270c85eaea5a4433ca473e15
BLAKE2b-256 checksum
How to use checksums
8841cd720db5882fe94282726ef4ba1cdd90862255b92690535b8874b99f890a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

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