Skip to main content

CleanChausie

CleanChausie is a data validation and transformation library for Python. It is a successor to CleanCat.

Check out the docs!

Interested in working on projects like this? Close is looking for great engineers to join our team.

Key features:

  • Operate on/with type-checked objects that have good IDE/autocomplete support
  • Annotation-based declarations for simple fields
  • Composable/reusable fields and field validation logic
  • Support (but not require) passing around a context (to avoid global state)
    • Context pattern is compatible with explicit sqlalchemy-based session management. i.e. pass in a session when validating
  • Cleanly support intra-schema field dependencies (i.e. one field can depend on the validated value of another)
  • Explicit nullability/omission parameters
  • Errors returned for multiple fields at a time, with field attribution

CleanChausie by example

This is a short example of how a schema might be used to support a flask endpoint. More detailed examples can be found in the docs.

from typing import List
from cleanchausie import (
  clean, ListField, URLField, EmailField, field, ValidationError, Schema
)
from flask import app, request, jsonify

class JobApplication(Schema):
  first_name: str
  last_name: str
  email: str = field(EmailField())
  urls: List[str] = field(ListField(URLField(default_scheme='http://')))

@app.route('/job_application', methods=['POST'])
def test_view():
  result = clean(JobApplication, request.json)
  if isinstance(result, ValidationError):
    return jsonify(result.serialize()), 400

  # Now "result" has the validated data, in the form of a `JobApplication` instance.
  assert isinstance(result, JobApplication)
  name = f'{result.first_name} {result.last_name}'

Release process

  • Make sure to thoroughly review and test the code changes.
  • Prepare for a new release
    • Update the package version within cleanchausie/__init__.py.
    • Add a changelog entry for the new version.
    • Merge to master
  • Dispatch a new "build and release" workflow action within the github actions tab.

The resulting workflow will build and publish the new version to PyPi.

Release files for cleanchausie 1.17.8

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

Source distribution (sdist)

Source distribution for cleanchausie 1.17.8
File Size Uploaded
cleanchausie-1.17.8.tar.gz 26.5 kB Details

Release files / cleanchausie-1.17.8.tar.gz

Download URL cleanchausie-1.17.8.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a85315230c7614f92d2115c08c1b8990757e91b6e87eb2e756321a301a620f3e
BLAKE2b-256 checksum
How to use checksums
23b26547073a1d53e2ed8ad010983e4e6e9db305205db11f6e38a9c9b8097b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.17.8 This release

1 release file

1.17.7

1 release file

1.17.6

1 release file

1.17.5

1 release file

1.17.4

1 release file

1.17.2

1 release file

1.17.1

1 release file

1.17.0

1 release file

1.16.2

1 release file

1.16.1

1 release file

1.16.0

1 release file

1.15.0

1 release file

1.14.0

1 release file

1.13.3

1 release file

1.13.2

1 release file

1.13.1

1 release file

1.13.0

1 release file

1.12.2

1 release file

1.12.1

1 release file

1.12.0

1 release file

1.11.2

1 release file

1.11.1

1 release file

1.11.0

1 release file

1.10.0

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.3

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

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