Skip to main content

A python package written in rust for code navigation features like text search, fuzzy search and go to definition/references

Project description

# Code Navigation Python Package

This Python package provides functionality for indexing and searching code repositories using Rust and PyO3. The package supports text search, fuzzy search, and retrieving token information and hoverable ranges from the code.

## Installation

To install the package, use the following command:

```sh
pip install code_navigation_python

Usage

Import the Package

import code_navigation_python

Functions

go_to

Retrieves token information for a given position in a file.

Parameters
  • root_path_str (str): The root path of the repository.
  • index_path_str (str): The path where the index is stored.
  • relative_path (str): The relative path of the file.
  • line (int): The line number.
  • start_index (int): The start index in the line.
  • end_index (int): The end index in the line.
Returns
  • str: Token information.
Example
result = code_navigation_python.go_to("/path/to/repo", "/path/to/index", "src/main.rs", 10, 0, 5)
print(result)

text_search

Performs a text search in the code repository.

Parameters
  • root_path_str (str): The root path of the repository.
  • index_path_str (str): The path where the index is stored.
  • query (str): The search query.
  • case_sensitive (bool): Whether the search should be case sensitive.
Returns
  • str: Search results.
Example
result = code_navigation_python.text_search("/path/to/repo", "/path/to/index", "search term", True)
print(result)

get_hoverable_ranges

Retrieves the hoverable ranges for a given file.

Parameters
  • root_path_str (str): The root path of the repository.
  • index_path_str (str): The path where the index is stored.
  • relative_path (str): The relative path of the file.
Returns
  • str: Hoverable ranges in JSON format.
Example
result = code_navigation_python.get_hoverable_ranges("/path/to/repo", "/path/to/index", "src/main.rs")
print(result)

License

This project is licensed under the Apache License.

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_navigation_python-0.0.1.tar.gz (90.6 kB view details)

Uploaded Source

Built Distribution

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

code_navigation_python-0.0.1-cp37-abi3-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for code_navigation_python-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f86fea01904ab17ab3c0417bd9ebb3a42e5d77e942c20582468b53e58e9c2be6
MD5 f63d37ff417b8d4f6feaa8ce2832d5b4
BLAKE2b-256 02b84746450d3a1e1263b456bc81d863040e3bdc61d3ebb71877add28ca44220

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.1-cp37-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.1-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 82f8aeadd5f0deef6a71c259384e49a8caf3adad9fd251c26061ee85baaa003f
MD5 1ccb51434d4f089c61631558e0212494
BLAKE2b-256 36afe2cfd24d5bc259489edfea2737f093291793980cc4123ecb3ddb6036e82c

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