Skip to content
CAI
Software that uses CAICheck a score

pvieito/PythonKit

61.1

Adequate · 1 October 2026

2.3k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

PythonKit is a Swift package that enables native interoperability with Python, allowing Swift code to dynamically load and interact with the Python runtime. It provides an ergonomic API for calling Python functions and classes, along with specific support for converting data between Swift arrays and NumPy ndarrays. The system is maintained as a command-line tool-free library, relying on Swift Package Manager for distribution and testing.

Features

Initial public release of PythonKit under Apache 2.0

This change introduces the initial public release of the PythonKit Swift package, providing a framework to interact with Python from Swift code. The repository is now structured as a public project with an Apache 2.0 license, including documentation (README, AGENTS.md) and configuration files (.gitignore) to support usage via Swift Package Manager and runtime Python library loading.

(repo-wide) · high confidence

Removals

PythonTool CLI removed

The PythonTool command-line interface has been removed from the project. This change deletes the tool's source files (including main.swift, which previously handled argument parsing and Python module listing via CommandLineKit) and its associated configuration files (Info.plist, OperatingSystemVersion.swift), effectively eliminating the standalone CLI capability.

PythonTool · high confidence

Removed Xcode project and workspace files

The Xcode project file (project.pbxproj) and the associated workspace configuration (contents.xcworkspacedata) have been deleted from the repository. This removes the native Xcode build system support for the PythonKit library, indicating a shift away from Xcode-based development or build workflows for this component.

PythonKit.xcodeproj · high confidence

Behavioural changes

The .agents/skills and .claude/skills directories are now symlinks pointing to ../Agents/Skills, centralizing skill definitions. Additionally, placeholder .gitkeep files were added to the Agents/Instructions and Agents/Skills directories to ensure they are tracked by version control.

.agents, .claude, Agents · high confidence

PythonKit rewritten with native Swift interoperability and NumPy support

The PythonKit library has been completely rewritten to provide a native Swift interoperability layer for Python, replacing the previous \PythonGlue\ implementation. The new \Python.swift\ core introduces \PythonObject\ with \@dynamicMemberLookup\ and \@dynamicCallable\ for ergonomic Python interaction, and \PythonLibrary.swift\ implements robust runtime dynamic loading of the Python library across macOS, Linux, and Windows. Additionally, the new \NumpyConversion.swift\ file adds support for bridging \numpy.ndarray\ data to and from Swift arrays, enabling seamless integration with the NumPy ecosystem.

PythonKit · high confidence

Test coverage

Added test coverage for Numpy conversion, Python functions, and runtime behavior

Added new test suites in the Tests directory to verify core PythonKit functionality. NumpyConversionTests validates the conversion between Swift arrays and NumPy arrays, including handling of different data types, empty arrays, and strided views. PythonFunctionTests exercises the creation of Python functions and classes from Swift closures, covering keyword arguments, dynamic class construction, inheritance, and exception handling. PythonRuntimeTests ensures correct behavior of the Python runtime integration, including list and dictionary operations, range and slice handling, binary/unary operators, and error throwing.

Tests · high confidence

Dependencies

Swift Package Manifest Updated to Swift 6.0 and Swift 5 Language Mode

The Package.swift manifest has been updated to specify Swift tools version 6.0 while explicitly setting the language mode to Swift 5 via the \swiftLanguageModes\ configuration. This ensures compatibility with the newer Swift Package Manager tooling while maintaining source compatibility with Swift 5 code.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 61 → 61 (+0.0)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 44 → 44 (+0.0)
  • Readiness 51 → 55 (+3.6)
  • Security 97 → 97 (+0.0)

Resolved (1)

  • Documentation: no architecture or design documentation (README.md)

New (2)

  • Coverage not measured — Swift suite
  • Redundant operations for importing modules. attemptImport and import appear to perform the same core action (importing a module by name), differing only potentially in error handling semantics (throwing vs returning an object that might represent an error or nil), which is not clearly distinguished by the name alone.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pvieito/PythonKit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit e1d34f95c58189b771bfc8423b9b2cf8fc651664 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.