Questions tagged [voluptuous]

voluptuous is a data validation library for Python

From the github project page:

Voluptuous, despite the name, is a Python data validation library. It is primarily intended for validating data coming into Python as JSON, YAML, etc.

It has three goals:

  • Simplicity.
  • Support for complex data structures.
  • Provide useful error messages.
20 questions
0
votes
1 answer

Voluptuous: Validate dicts within dicts

I'd like to validate the following YAML file defines a defaultdict that contains two dicts named dev and sha. !!python/object/apply:collections.defaultdict args: - !!python/name:builtins.dict '' dictitems: dev: sha: 5b7 url:…
Ray Salemi
  • 5,247
  • 4
  • 30
  • 63
0
votes
1 answer

Voluptuous 2 out of 3 class

I have been trying to use the python library voluptuous for a few hours but I cannot make what I want. Here is what is working right now : PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_ENTITY_ID): cv.entity_id, …
Boris K
  • 1,469
  • 9
  • 29
0
votes
1 answer

Is this a valid structure for voluptuous or am I missing something

I've this YAML file. I've Required and Optional keys and also I've optional blocks, like 'linux', 'http' and so on. --- project: name: lolproj url: http://wiki.tld/lolproj contact: name: FooBar email: foobar@gmail.com plugins: …
include
  • 2,108
  • 16
  • 13
0
votes
1 answer

Create (instantiate?) a reference to a built in type from its string name

I'd like to be able to define a schema in yaml, read it in using pyyaml and then validate with voluptuous (or other schema validator!). However, as stated in the question title, I run into the need to have the builtin class str instantiated for…
Justin
  • 42,475
  • 9
  • 93
  • 111
-1
votes
1 answer

Is there any data validation nuget library like python's voluptuous in C#?

For data validation, Python coders frequently will use this library called Voluptuous. Is a great library to validate data before processing it further in the code. Is there any equivalent NuGet library we can use in C#? Below is a python snippet on…
Dennis
  • 3,528
  • 4
  • 28
  • 40
1
2