Skip to main content

PyJoern lifts Joern data and APIs into Pythonic form, focused on graph manipulation.

Project description

PyJoern

A Python frontend and lifter for Joern API, focused on CFG manipulation.

Install

This package requires you to have Java 19, Graphviz, and Unzip installed on your machine before running the pip installer. In you don't have them on your system, use the install_dependencies.sh script found in the source repo.

pip3 install pyjoern && pyjoern --install

Running pyjoern --install will init the Joern package for this first time, which will download the backend.

Usage

Use PyJoern as a library for collecting info on source and getting a CFG. The IL the source CFG is lifted to is described in JIL.

from pyjoern import parse_source, fast_cfgs_from_source

# for full parsing
functions = parse_source("tests/source/simple.c")
main = functions["main"]
print(main.start_line)
print(main.cfg)

# for only the CFG
cfgs = fast_cfgs_from_source("tests/source/simple.c")
main_func = cfgs["main"]
print(main_func.edges)

See the tests for more examples of how to use PyJoern.

Versioning

The current version of PyJoern can be found in [pyjoern/__init__.py] as __version__. The point in the version is the PyJoern specific updates. The first three are the current version of Joern that PyJoern is supporting.

Example:

__version__ = "v1.2.18.1"

This would mean Joern version v1.2.18, with PyJoern update 1.

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

pyjoern-4.0.150.4.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

pyjoern-4.0.150.4-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file pyjoern-4.0.150.4.tar.gz.

File metadata

  • Download URL: pyjoern-4.0.150.4.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for pyjoern-4.0.150.4.tar.gz
Algorithm Hash digest
SHA256 d028d99086e24a2e8be8e816ac99f4eac5f7aec84ef390938539cb8037f5c00c
MD5 983fd102968230c65d0a84abfff4f8b7
BLAKE2b-256 94050de084a8c2ed7e0339045717f3c3396567a268eebd9a1db51e008df033dd

See more details on using hashes here.

File details

Details for the file pyjoern-4.0.150.4-py3-none-any.whl.

File metadata

  • Download URL: pyjoern-4.0.150.4-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for pyjoern-4.0.150.4-py3-none-any.whl
Algorithm Hash digest
SHA256 37dd3d65a2e5617063cf32e62e9408bab5612c2439af5620b7e8f8acc7afbd57
MD5 4ab2786f4cb5ebe353297934d7cbf1c9
BLAKE2b-256 be5bf457789da0ac3997396d3afb9d54c00714de1b2943577da8a8d6b195ab4a

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