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)

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

Uploaded Source

Built Distribution

pyjoern-4.0.61.2-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjoern-4.0.61.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pyjoern-4.0.61.2.tar.gz
Algorithm Hash digest
SHA256 ae525d2357ea56d33cc05e6c4b502d13f70d8c34e9e42b4f59ec9fa7d5a9e9ef
MD5 02b42dfaa19944239390d064b477d982
BLAKE2b-256 c46c9a834746d7294af779c5891e20c646ca23d3ce9c9196fea0b10e2698f94a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyjoern-4.0.61.2-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pyjoern-4.0.61.2-py3-none-any.whl
Algorithm Hash digest
SHA256 13f5183e9bbcc5784da9558dad3014e6c0b7005c5bc0b4fa16b47098d8072d16
MD5 194319ee80e97a2e90b1f9f66d80fc3b
BLAKE2b-256 ad24b2b073ef1adc700bc081c8c0966b2ff562653a0231459565294b228abc79

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page