Contexta code analysis core engine
Project description
Contexta Core
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 directoryconfig(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:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
Contributing
Contributions are welcome! Please see our Contributing Guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contexta_core-0.1.4-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: contexta_core-0.1.4-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b89a31d068ead34eaf802c9c190875671be3afe256f9e10ddfe535ff89d31c59
|
|
| MD5 |
96e99d0653b6147a570272a12a4ee18b
|
|
| BLAKE2b-256 |
ff8e1a75f957036d158ae62abc1bb243e40a27e80a602a2831820b22a97894a7
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contexta_core-0.1.4-cp39-abi3-win_amd64.whl -
Subject digest:
b89a31d068ead34eaf802c9c190875671be3afe256f9e10ddfe535ff89d31c59 - Sigstore transparency entry: 702249044
- Sigstore integration time:
-
Permalink:
usecontexta/contexta-core@d9056aac93cdd454596c857e0efeee692ee3fd03 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/usecontexta
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9056aac93cdd454596c857e0efeee692ee3fd03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
358e654b74caaf657e2d8874bf6fd48c1ccc2ada7d32ef9e2a8c98eba25cd95f
|
|
| MD5 |
dd51abbef1d26426424d3dd8d54c7064
|
|
| BLAKE2b-256 |
81ab84111d1922edd3d5738b5b3696ca612ae6a61428bcee3a0ae6b326efa646
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contexta_core-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
358e654b74caaf657e2d8874bf6fd48c1ccc2ada7d32ef9e2a8c98eba25cd95f - Sigstore transparency entry: 702249051
- Sigstore integration time:
-
Permalink:
usecontexta/contexta-core@d9056aac93cdd454596c857e0efeee692ee3fd03 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/usecontexta
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9056aac93cdd454596c857e0efeee692ee3fd03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25590620b35776eade41cfba44275d9133652b36f16c6b3b80baba708309180b
|
|
| MD5 |
fd83cc5dd53c2b9e0fcb51fcce15c62d
|
|
| BLAKE2b-256 |
13354955338afdf60d3c893e488f6d76ca7e60c3b4d4502c591419868f193a50
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contexta_core-0.1.4-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
25590620b35776eade41cfba44275d9133652b36f16c6b3b80baba708309180b - Sigstore transparency entry: 702249059
- Sigstore integration time:
-
Permalink:
usecontexta/contexta-core@d9056aac93cdd454596c857e0efeee692ee3fd03 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/usecontexta
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9056aac93cdd454596c857e0efeee692ee3fd03 -
Trigger Event:
push
-
Statement type: