Skip to main content

Contexta code analysis core engine

Project description

Contexta Core

PyPI version License

Contexta code analysis core engine - Rust + Python bindings for fast, accurate code intelligence.

Features

  • 🚀 Fast: Rust-powered tree-sitter parsing
  • 🔍 Accurate: Syntax-aware code analysis
  • 🐍 Pythonic: Clean Python API via PyO3
  • 📦 Standalone: Use as a library in any Python project
  • 🌐 Cross-platform: Linux, macOS, Windows

Installation

pip install contexta-core

Quick Start

from contexta_core import analyze, AnalysisConfig

# Analyze a Python file
result = analyze('/path/to/file.py')

print(f"Found {len(result.symbols)} symbols")
for symbol in result.symbols:
    print(f"  {symbol.kind}: {symbol.name}")

API Reference

analyze(source, config=None)

Analyze a source file or directory.

Parameters:

  • source (str | Path): Path to file or directory
  • config (AnalysisConfig, optional): Analysis configuration

Returns: AnalysisResult containing symbols and dependencies

Example:

from contexta_core import analyze, AnalysisConfig

config = AnalysisConfig(enable_deep_mode=False)
result = analyze('/path/to/project', config)

capabilities()

Returns list of available capabilities.

Returns: List[str] - Capability strings like ['analyze', 'search', 'deep-mode']

check_compatibility(client_version)

Check if a client version is compatible with this core version.

Parameters:

  • client_version (str): Semantic version string (e.g., "0.1.0")

Returns: bool - True if compatible

Development

Building from Source

Requires Rust 1.75+ and Python 3.8+:

# Install Maturin
pip install maturin

# Build release wheel
maturin build --release

# Install locally
pip install target/wheels/*.whl

Running Tests

# Rust tests
cargo test

# Python tests
pytest python/tests/

License

Licensed under either of:

at your option.

Contributing

Contributions are welcome! Please see our Contributing Guide.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

contexta_core-0.1.4-cp39-abi3-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.9+Windows x86-64

contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file contexta_core-0.1.4-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for contexta_core-0.1.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b89a31d068ead34eaf802c9c190875671be3afe256f9e10ddfe535ff89d31c59
MD5 96e99d0653b6147a570272a12a4ee18b
BLAKE2b-256 ff8e1a75f957036d158ae62abc1bb243e40a27e80a602a2831820b22a97894a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexta_core-0.1.4-cp39-abi3-win_amd64.whl:

Publisher: release.yml on usecontexta/contexta-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 358e654b74caaf657e2d8874bf6fd48c1ccc2ada7d32ef9e2a8c98eba25cd95f
MD5 dd51abbef1d26426424d3dd8d54c7064
BLAKE2b-256 81ab84111d1922edd3d5738b5b3696ca612ae6a61428bcee3a0ae6b326efa646

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on usecontexta/contexta-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 25590620b35776eade41cfba44275d9133652b36f16c6b3b80baba708309180b
MD5 fd83cc5dd53c2b9e0fcb51fcce15c62d
BLAKE2b-256 13354955338afdf60d3c893e488f6d76ca7e60c3b4d4502c591419868f193a50

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on usecontexta/contexta-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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