Skip to main content

Python client for running CAT tests in a Python codebase

Project description

CAT Test Framework - Python Version

This project implements the CAT (Continuous Alignment Testing) framework for Python, providing tools for recording and validating test experiments with confidence levels.

Prerequisites

  • Python 3.13 or higher
  • Poetry for dependency management

Installation

  1. Clone the repository

  2. Install dependencies with Poetry:

    poetry install
    

Development

Running Tests

Run all tests:

poetry run pytest

Run tests with output:

poetry run pytest -v

Code Quality

# Format code
poetry run black .

# Check style
poetry run flake8 src tests

# Type checking
poetry run mypy .

Project Structure

  • src/cat_python/cat.py: Main CAT implementation with core functionality
  • src/cat_python/db.py: Database utilities and connection management
  • src/cat_python/types.py: Shared type definitions and interfaces
  • tests/: Test suite using pytest
    • conftest.py: Common test fixtures
    • src/cat/test_cat.py: Test implementations
  • pyproject.toml: Project configuration and dependencies

Implementation Notes

This is an alpha version converted from the TypeScript implementation. The main differences include:

  • Use of Python's type hints instead of TypeScript types
  • Async/await implementation using Python's native coroutines
  • SQLite integration using Python's built-in sqlite3 module
  • Testing with pytest instead of Jest
  • Context managers for resource management
  • Poetry for dependency management and project configuration

How to Publish this Library

  • set up your api key poetry config pypi-token.pypi YOUR_PYPI_TOKEN
  • run poetry publish --build

How to generate auto docs

  • generate docs: poetry run sphinx-apidoc -f -o source/ src/
  • build docs into github Pages jekyll: poetry run sphinx-build -b html source ../../docs/api

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cat_ai-0.0.4a0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cat_ai-0.0.4a0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file cat_ai-0.0.4a0.tar.gz.

File metadata

  • Download URL: cat_ai-0.0.4a0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for cat_ai-0.0.4a0.tar.gz
Algorithm Hash digest
SHA256 6a06bbd7687c7fe84e0e2036f4ada668c408a4814cedeaa87faf03a7e1c03eed
MD5 c46a2bde5d26296add5e887385a0b9cb
BLAKE2b-256 e9278b98ecdad327d00631b75c7828e7f347013f08a06a8fc252af8c6766a020

See more details on using hashes here.

File details

Details for the file cat_ai-0.0.4a0-py3-none-any.whl.

File metadata

  • Download URL: cat_ai-0.0.4a0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for cat_ai-0.0.4a0-py3-none-any.whl
Algorithm Hash digest
SHA256 636b7d16d4f925d1c445aba0e9501fae329ee927e11dbe256c485e160064901d
MD5 88ee031acdb1660f11cc5455960316f2
BLAKE2b-256 ee67fe36fc0f38791d027bf8e79fa5b190443da3786a9f0d66899b08b198ee89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page