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.5a0.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.5a0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cat_ai-0.0.5a0.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.5a0.tar.gz
Algorithm Hash digest
SHA256 a4e9e402ad4935bd810c2e5a3aff77eb6e1bfc5c5f957ee5beb416500ed60903
MD5 feb01f54ec9d50e31ca67d1d3f704047
BLAKE2b-256 d9dddea8059ff67bdd1fa9fdaa6f61ece5c5904c7c3f3be60e2e93cc7c3f91bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cat_ai-0.0.5a0-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.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0b71c6d890cfeda71716e28a29c5bc026f9b1c43975f2449ea8bea9d50c9692
MD5 7a670ba00c35df91af9f274993fa6f43
BLAKE2b-256 58aa30ba5d28d42a7e5eaffcf28e7507d1409e883f76a367a479f9f796d67c07

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