Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

615
Visualizações
Python - Cerberus, jsonschema, voluptous - Which one will be appropriate?

I am developing a small RESTful web application in python and using JSON as interface. The application accepts JSON data and needs to validate them against a schema. The schema may be very strict or flexible depending on the request. Also, the application may need to validate user objects at a later improvement.

I have found some suggestions in stack overflow as well as at other websites. Those include

  • Cerberus
  • jsonschema
  • voluptuous

But could not find a proper comparison.

In terms of simplicity, flexibility and extend-ability, which one do you think should I choose?

Cerberus seems to be very flexible and extend-ability seems very good from their documentation and examples. But I don't know about the other libraries.

EDIT 1: For now the application's needs are pretty simple and a basic schema validation with scope for adding custom types and custom validation rules will suffice. So if all these libraries offer the basic requirements, I would go for the one that is simplest to use. Also I am open to other suggestions if any.

Hoping to find some help.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I would take Cerberus then if only for its wonderful documentation. It allows to set dependencies according to certain conditions (http://docs.python-cerberus.org/en/stable/validation-rules.html#dependencies) and is certainly as simple for the basic schema validation needs you're referring to as jsonschema, voluptuous, etc..

Nested fields are supported also (in all libraries i'm familiar with) and their customization docs are amazing: http://docs.python-cerberus.org/en/stable/customize.html

That being said, I'm not basing this answer on using all three proposed packages but rather on using jsonschema extensively and reading enough documentation and recommendations on the other two.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda