Changelogs » Typesystem

PyUp Safety actively tracks 334,184 Python packages for vulnerabilities and notifies you when to upgrade.

Typesystem

0.3.0

Version `0.3.0` changes how `Schema` validators are created. In this release validators are created as instances of `Schema`.
  
  python
  import typesystem
  
  artist_schema = typesystem.Schema(
  fields={
  "name": typesystem.String(max_length=100)
  }
  )
  
  definitions = typesystem.Definitions()
  definitions["Artist"] = artist_schema
  
  album_schema = typesystem.Schema(
  fields={
  "title": typesystem.String(max_length=100),
  "release_date": typesystem.Date(),
  "artist": typesystem.Reference("Artist", definitions=definitions)
  }
  )
  
  
  The output of validation is also a `dict`, so there's no need to serialize validated data.
  
  python
  album, error = album_schema.validate_or_error(data)

0.3.0.dev2


        

0.3.0.dev1


        

0.2.5

Added
  
  * added `UUID` field