Skip to main content

Kye Validation Tool

Kye is a validation tool in progress that allows you to define models to validate your data against.

Getting Started

Install

pip install kye

Run

Pass the location of the kye file, the data (.csv, .json or .jsonl) file, and the name of the Model to evaluate the data against. If the data does not pass the model's assertions then the errors and errant data will be displayed.

kye user.kye --data users.csv --model User

Models are defined in a .kye file using the Kye language.

The Kye language can optionally be compiled into a json or yaml file. Using the -c flag followed by a path to a .json or .yaml file. Run the compiled file like you would a normal .kye file

kye user.kye -c user.kye.yaml
kye user.kye.yaml --data users.csv --model User

Kye Models

User(id)(username) {
  id: Number
  username: String
  name: String
  age?: Number

  assert age > 0 & age <= 120
}

Models

The above Kye script defines a User table. Table names must be upper-cased.

Indexes

The name of the table is followed by its index definition. The (id)(username) means that we expect both the id or username columns to be able to uniquely identify a record.

Composite indexes are defined by listing multiple column names within a single set of parenthesis ex. (id, username)

Columns

Column names must start with a lowercase and not contain spaces or other special characters. If the source data has column names that don't follow these rules, then you can specify the full column name in quotes after the column name.

  id "User Id": Number

The column definitions specify the value type as Number, String or Boolean. More data types like date/time and user defined types are coming soon.

You can specify whether the column allows null values by prefixing the colon with a ?

age?: Number

You can also specify if the column allows multiple values (like an array of values) by using + if you expect at least one value, or * if it is okay to have no values.

# Expect at least one version
versions+: String

# It's okay for a post to have no tags
tags*: String 

Assertions

You can specify extra assertions through the assert keyword. Just write an expression that evaluates to true or false, and the rows that evaluate to false will be flagged. You can reference columns by their names.

Expressions support the basic operations:

  • + - * / % math
  • == != >= > < <= comparison
  • ! & | ^ logical (not, and, or, xor)
  • () parenthesis

Release files for kye 0.1.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 kye 0.1.2
File Size Uploaded
kye-0.1.2.tar.gz 65.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kye 0.1.2
File Interpreter ABI Platform
kye-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 95.0 kB

Release files / kye-0.1.2.tar.gz

Download URL kye-0.1.2.tar.gz
Size 65.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1ea7ec7ae72675b633f56c990a0502711e23440fc213f41c8ff4bcf1d3d5a7cc
BLAKE2b-256 checksum
How to use checksums
932f74f6ab2a208596ab767bece6954a46746095d3d4df41ec361c4fda0dd313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Release files / kye-0.1.2-py3-none-any.whl

Download URL kye-0.1.2-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5c66b773c66242b337c18488e553d121929b3e574bf313934a77c678a82c502
BLAKE2b-256 checksum
How to use checksums
c2cf09d6b2691c08e0a046d3b95bf4a593a2e3bfe6d4514349726d9cd8447383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

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