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

Uploaded Source

Built Distributions

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

code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB view details)

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

code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.1 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ppc64le

code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (5.1 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ i686

code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARMv7l

code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

code_navigation_python-0.0.3-cp37-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

code_navigation_python-0.0.3-cp37-abi3-macosx_10_12_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for code_navigation_python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 334c5bf96a288af6bfaa9d5299125bb64a2d1d5dcbc3d93d582cac7edbf55223
MD5 aec13e38276131604f976334ba902e73
BLAKE2b-256 34ee8628ce0379fb32c84b783a6571aeaeefa65520c48e70f1e232a1e3bf33e5

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d74835319956b39fe0d85a19df7de8d60aa4889ddb55133aac8c523387bb984
MD5 b7bc3e062d622971270332906ad1ac9e
BLAKE2b-256 3bae0dc415d0bf125b4927e597d2494c61561617e4f3784d63fa3d05cca9119b

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 14272079ea83dc888239a958eee21aff295a2ebb0fdd6abf39c0f2d494995bd7
MD5 ab1f206e141199b68ef0d7c9406ccbb8
BLAKE2b-256 25a1f108091f63796a000c07bb18179f5c483d837f48b777f8880531ade433dd

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c95d683b7b022d089f7a1d1d8b9d397fabccba3a70efe2b4171b392c5ec62c93
MD5 085bf2b45ed4cee3f8280754233981be
BLAKE2b-256 94acbef10a12a96a36d795bc91d9b288c672af2a3a9525861131b11210005d40

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8801b8a20787c763c5f5d2faf4a9c94614b75afb42b54f6dec76567c5aff9735
MD5 c438b89c59a277f94311db12944094ef
BLAKE2b-256 808bb79889099e885d1b75df02068f099756e6de3d40f743907a0299757ec789

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9f0d8e4d5911a98a3d927a4d32b4118a541231267a913d8299e4ac2790db68a6
MD5 582024bdd53da91f9699f2cc6fff9b18
BLAKE2b-256 9594d4c2a8966a1257bccec049884dc882b914e4d57590026749dc37e81e5b17

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e27f3e03c5af68b9711df20b9cdef73566f33f1f8a6b5d37b2363610a890761c
MD5 17f96b621cc63a661932bef33bd10909
BLAKE2b-256 aad2aaec51d3a390ed03bc0a06d65b38ce23e4961d92913768b37af07ddbe273

See more details on using hashes here.

File details

Details for the file code_navigation_python-0.0.3-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for code_navigation_python-0.0.3-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bd77327f2a2e0741bcdbb82308045dad76a870b1c2e78756b42f6df7297bb05f
MD5 51115fc534390d8db828998840928b9f
BLAKE2b-256 0d4da8cbdf5470b60fa1b3e5a1f9c0cb4818173656dafaf7c0a4d7d8545864a8

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