Skip to main content

A tool to analyze codebase structure and summarize content to use with AI easily.

Project description

Code Context Analyzer

Analyze the structural context of codebases with file discovery, parsing, summarization, and CLI support.

Code Context Analyzer is a Python tool that inspects a codebase (local or GitHub) and provides a structured summary of its layout — including modules, classes, functions, and constants — with support for Python and JavaScript.


🔧 Features

  • 📁 Codebase discovery with .gitignore respect
  • 🧠 Parsers for Python and JavaScript
  • 📋 Clipboard export
  • 🖨️ CLI output formatting with depth and hierarchy controls
  • 🌐 Supports local paths or GitHub URLs
  • 🧪 Extensible parser architecture

🚀 Installation

pip install code-context-analyzer

Or clone it with

git clone https://github.com/youruser/code-context-analyzer.git
cd code-context-analyzer
pip install .

🧪 Example Usage

cca ./my_project --lang python --depth 3

Or

cca https://github.com/pallets/flask --lang python --depth 2

📦 Used configurable flags

Flag Description
--lang Comma-separated list of languages (e.g. python,js)
--depth How deep the hierarchy output should go
--max-files Optional limit on files to analyze
--ignore-tests Skip test files
--copy Copy output to clipboard

🧩 Architecture Overview

code_context_analyzer/
├── cli/
│   ├── __init__.py            # CLI app codes
├── analyzer/
│   ├── discovery.py          # File discovery logic   ├── formatter.py          # Output formatter   ├── repository_handler.py # GitHub/local repo handling   ├── clipboard.py          # Clipboard support   ├── parsers/              # Code parsers (Python, JS)   └── utils/                # Temporary directory helpers
└── tests/                    # Test suite
└── main.py                   # Entrypoint

🛠️ Development

Install dev dependencies:

pip install -r requirements-dev.txt

Run tests:

pytest

📚 Documentation

Generated using MkDocs . Run locally:

pip install mkdocs
mkdocs serve

🪪 License

MIT License © Md. Ahasanul Arafath

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

code_context_analyzer-0.1.4.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

code_context_analyzer-0.1.4-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: code_context_analyzer-0.1.4.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for code_context_analyzer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 32e6820e9348f5cf20571b1a204bcb6fb05e6d01820d846e27ba9b17d25e9559
MD5 d6b5fe437a560817809df65055c5888c
BLAKE2b-256 d9ee872f29c119164fd15338529150e03dc1b856f23f75f464795ad0e77c566e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code_context_analyzer-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0ada34aec6688e153cf43201cc8bbd28943213d02491ba8883e3ac7df2cc90dd
MD5 d517394f6610461bf8d1149a88921af2
BLAKE2b-256 3b07e94431b9581b02fec68ea48807b88ebbbbde27547b51a886a96b8ffbd355

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