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 and formatter 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 /path/to/the/project

Or

cca /path/to/the/project --ignore assests/

Or

cca https://github.com/pallets/flask

๐Ÿ“ฆ Used configurable flags

Flag Description
-h --help show this help message and exit
--branch Branch name (for GitHub repos) default "main"
--ignore Comma-separated ignore patterns (dist/*, *min.js/, main.py)
--max-files Max files to analyze
--ignore-tests Ignore all tests that start with 'tests' (true/false)
--no-clipboard Do not copy to clipboard

๐Ÿงฉ Architecture Overview

code_context_analyzer/
โ”œโ”€โ”€ /
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ analyzer/
โ”‚   โ”œโ”€โ”€ clipboard.py
โ”‚   โ”œโ”€โ”€ discovery.py
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ analyzer\parsers/
โ”‚   โ”œโ”€โ”€ base.py
โ”‚   โ”œโ”€โ”€ js_parser.py
โ”‚   โ”œโ”€โ”€ python_parser.py
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ cli/
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ dto/
โ”‚   โ”œโ”€โ”€ models.py
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ formatters/
โ”‚   โ”œโ”€โ”€ base.py
โ”‚   โ”œโ”€โ”€ default.py
โ”‚   โ”œโ”€โ”€ factory.py
โ”‚   โ”œโ”€โ”€ html_formatter.py
โ”‚   โ”œโ”€โ”€ json_formatter.py
โ”‚   โ”œโ”€โ”€ yaml_formatter.py
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ repo_system/
โ”‚   โ”œโ”€โ”€ handler.py
โ”‚   โ”œโ”€โ”€ session.py
โ”‚   โ””โ”€โ”€ __init__.py
โ””โ”€โ”€ utils/
    โ”œโ”€โ”€ dto_converter.py
    โ”œโ”€โ”€ temp_dir.py
    โ””โ”€โ”€ __init__.py

๐Ÿ› ๏ธ Development

Install dev dependencies:

pip install -r requirements.txt

Run tests:

pytest

๐Ÿ“š Documentation

Generated using MkDocs Run locally:

pip install mkdocs
mkdocs serve

Or visit here for docs:

๐Ÿชช 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.3.3.tar.gz (21.8 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.3.3-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: code_context_analyzer-0.3.3.tar.gz
  • Upload date:
  • Size: 21.8 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.3.3.tar.gz
Algorithm Hash digest
SHA256 b48dce653f8cde131e313988317d2224483e077096e7aca76cde831b6bdcb779
MD5 a8bff2ce44558d6f942b85a87e7940a8
BLAKE2b-256 1869470eb1c83094d9d1c928b548f58b8da424609d69d0da85a7966d675999a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code_context_analyzer-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73bf52f686eccc6a81be0b23218cace2c7bdfca817dd4ff89324023b54dbac25
MD5 035efb7a348cebda2f3197e6f6247f0f
BLAKE2b-256 7518ed42914f743baa6a815cc6733cb6492b4ce7cceffffbb0f0e85438da3b2a

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