Skip to main content

Open Source Python SDK for Checktica - AI-written text detector.

Project description

Checktica Python SDK

Tests Coverage License Python 3.13+ PyPI version

Open Source Python SDK for Checktica - detect AI-generated text with high accuracy.

Features

  • 🎯 99%+ accuracy in detecting AI-generated content
  • 🚀 Multiple detection methods from fastest to most accurate
  • 📦 Simple API - just one function to call
  • 🔄 Automatic retries with smart error handling
  • 📝 No length limits on text analysis
  • 🆓 Free API access

Installation

Install Checktica using uv:

uv add checktica

Quick Start

Step 1: Import the SDK

from checktica import detect

Step 2: Check Your Text

text = """
    AI detectors help distinguish between human and AI-generated writing.
    Checktica offers high accuracy, a free Python SDK, and no text length limits.
"""

result = detect(text)

Step 3: Interpret Results

if result.is_llm_generated:
    print(f"AI-generated (confidence: {result.confidence:.2%})")
    print(f"Remarks: {result.remarks}")
else:
    print(f"Human-written (confidence: {result.confidence:.2%})")

Detection Methods

Checktica provides five detection methods with different speed/accuracy tradeoffs:

Method Speed Accuracy Best For
most_accurate Slowest Highest Critical decisions, academic integrity
more_accurate Slow Very High Important content verification
balanced Medium High General purpose use
fast Fast Good Real-time filtering
fastest Fastest Acceptable Bulk processing

Choosing a Detection Method

# Use the most accurate method (default, recommended)
result = detect(text, detection_method="most_accurate")

# Use faster method for bulk processing
result = detect(text, detection_method="fastest")

# Balanced approach for most cases
result = detect(text, detection_method="balanced")

Understanding Results

The detect() function returns a DetectionResult object with three fields:

result = detect(text)

# Is the text AI-generated?
print(result.is_llm_generated)  # True or False

# Confidence score (0.0 to 1.0)
print(result.confidence)  # e.g., 0.95 means 95% confident

# Additional context about the detection
print(result.remarks)  # e.g., "None."

More Examples

Check out the examples/ directory for complete working examples:

Development Setup

Want to contribute? Here's how to set up your development environment:

Step 1: Clone the Repository

git clone https://github.com/checktica/checktica-python.git
cd checktica-python

Step 2: Install Dependencies

This project uses uv for dependency management:

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync

Step 3: Run Tests

# Run all tests with coverage
uv run pytest

# View coverage report
open htmlcov/index.html  # macOS
xdg-open htmlcov/index.html  # Linux

Step 4: Code Quality

We use Ruff for linting and formatting:

# Format code
uv run ruff format .

# Check for issues
uv run ruff check .

# Fix auto-fixable issues
uv run ruff check --fix .

Step 5: Pre-commit Hooks

Set up pre-commit hooks to automatically check code quality:

uv run pre-commit install

Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/amazing-feature).
  3. Make your changes.
  4. Test your changes (uv run pytest tests/).
  5. Commit your changes (git commit -m 'feat: Add amazing feature').
  6. Push to the branch (git push origin feature/amazing-feature).
  7. Open a Pull Request.

Please ensure:

  • All tests pass (uv run pytest).
  • Code is formatted (uv run ruff format .).
  • Linting passes (uv run ruff check .).
  • Coverage remains at 100%.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

Built with ❤️ by the Checktica team.

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

checktica-0.1.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

checktica-0.1.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file checktica-0.1.4.tar.gz.

File metadata

  • Download URL: checktica-0.1.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for checktica-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a062a1f7f0d07c2a3cab401c69255f53fb67228e5165d17a9614b3bb54bec034
MD5 31390b438235108955be68adbc16b546
BLAKE2b-256 5595b8974eac7b1012f54a92e2c007f8223e338339463ea0d7477d0facea961a

See more details on using hashes here.

File details

Details for the file checktica-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: checktica-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for checktica-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2a5f35b603bc843c8494679870569b4a1beb58d122345e4125908e54f2333c9
MD5 26cd66d3035339102bef0a9b94dac113
BLAKE2b-256 8563859b09d2e39fb583a5a865e9885a7aa3b091acad1fd65bcecf6063d33465

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