Skip to main content

A library for navigating over large codebases.

Project description

Locify 🔎

Locify is a library designed to help LLM-based agents navigate and analyze large codebases efficiently. It leverages parsing techniques to provide insights into code structure and relationships.

Features

On a Git-based repository, Locify offers:

  • Codebase Skeleton Mapping:

    • FullMapStrategy: Generates a skeleton map of the entire codebase or a directory only.
    • RepoMapStrategy: Focuses on the reference relationships, using graph theory to rank and analyze code elements.
  • Tree-sitter Integration: Utilizes Tree-sitter for precise parsing of source code, supporting multiple programming languages.

  • Command-Line Interface: Provides a user-friendly CLI for executing different mapping strategies.

Installation

Locify can be installed via pip:

pip install locify

Usage

Command-Line Interface

Locify offers a CLI to execute mapping strategies:

python -m locify.cli <strategy> [options]
  • <strategy>: Choose between fullmap and repomap.
  • [options]: Additional options for customizing the mapping process.

Example

To generate a full map of a codebase:

python -m locify.cli fullmap --root /path/to/codebase

Development

Directory Structure

  • locify/: Main source code directory.
    • cli.py: Command-line interface implementation.
    • indexing/: Contains strategies for code mapping.
      • full_map/: Implementation of FullMapStrategy.
      • repo_map/: Implementation of RepoMapStrategy.
    • tree_sitter/: Tree-sitter integration for parsing.
      • parser.py: Tree-sitter parser implementation.
      • queries/: Schema query files for different languages.
    • utils/: Utility functions and classes.

Testing

Tests are located in the tests directory. Run tests using:

poetry run pytest

Acknowledgements

This project was inspired by the aider's RepoMap implementation.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

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

locify-0.0.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

locify-0.0.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file locify-0.0.1.tar.gz.

File metadata

  • Download URL: locify-0.0.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.8.0-1014-azure

File hashes

Hashes for locify-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5ef84d05a2fdf6a4fa652ab4983f1238af7e4ad65491b284221cd488b684aa38
MD5 65cfca260661eef764de26524c6cf7ea
BLAKE2b-256 9a599ac41621e7e4beb5e1325e5c269c408e1189b836351d056155ea1ac03f22

See more details on using hashes here.

File details

Details for the file locify-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: locify-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.8.0-1014-azure

File hashes

Hashes for locify-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0332dbffa349085b5f5b2c010be38d88bd01559d39a6d102194dceafe7cb359
MD5 342ce8bace2f160170c01d48b2a52bdc
BLAKE2b-256 57f64af3e0ee568227f0708a989b1254102f46df27e5aae8ea967ecf59c09691

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page