Skip to main content

Locify 🔎

PyPI - Python Versions PyPI - Package Version GitHub - License Docs - GitHub.io

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> get_map_with_token_count [options]
  • <strategy>: Choose between fullmap and repomap.
  • [options]: Additional options for customizing the mapping process, e.g. file's depth, or specific directories only.

Example

  • To generate a full map of a codebase:

    python -m locify.cli fullmap get_map_with_token_count --root /path/to/gitrepo
    
  • To generate a full map of the locify directory only, with maximum depth of 3:

    python -m locify.cli fullmap get_map_with_token_count 3 locify
    

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.

Metadata

Release files for locify 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for locify 0.0.9
File Size Uploaded
locify-0.0.9.tar.gz 19.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for locify 0.0.9
File Interpreter ABI Platform
locify-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 48.0 kB

Release files / locify-0.0.9.tar.gz

Download URL locify-0.0.9.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ea534855997a2479a3203b1a1a0e3134ec0e88ea14b907bf444e6ff23e83a781
BLAKE2b-256 checksum
How to use checksums
d0ad3d3c61d40a4c826f32d1f191aa6087d666c439002c7635b23ffaa0f4ba29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.4 Linux/6.8.0-1015-azure

Release files / locify-0.0.9-py3-none-any.whl

Download URL locify-0.0.9-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb0683f54890835bc066c835db64b75fd57c8bf7f496e633690283bbbc48d82c
BLAKE2b-256 checksum
How to use checksums
0d081e1405810f626031f8f4228a4b7cd0961048f9251777b3910e91074bc178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.4 Linux/6.8.0-1015-azure

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page