Socket
Book a DemoInstallSign in
Socket

codenav-python

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codenav-python

Python bindings for CodeNav.

0.0.2
pipPyPI
Maintainers
1

CodeNav Python Bindings

Python bindings for CodeNav.

Installation

pip install codenav-python

Quick Start

import codenav
nav = codenav.Navigator(codenav.Language.Python, './test.sqlite')
nav.index(['<YOUR_LOCAL_PATH>/codenav/examples/python'])
reference = codenav.Reference('<YOUR_LOCAL_PATH>/codenav/examples/python/chef.py', 2, 0, 'broil')
definitions = nav.resolve(reference)
for d in definitions:
    print(f'{d.path}:{d.span.start.line}:{d.span.start.column}')
    print(d.text())
nav.clean(True)

Examples

  • Resolve a Python reference
  • Resolve a Python snippet
  • Resolve a JavaScript reference
  • Resolve a JavaScript snippet
  • Resolve a TypeScript reference
  • Resolve a TypeScript snippet

Development

Install maturin:

pip install maturin

Build and install the module:

maturin develop

Run the examples:

python examples/resolve_python_reference.py
python examples/resolve_python_snippet.py
python examples/resolve_javascript_reference.py
python examples/resolve_javascript_snippet.py
python examples/resolve_typescript_reference.py
python examples/resolve_typescript_snippet.py

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.