Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cpgclientlib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpgclientlib

A client library for CPG servers

  • 0.11.321
  • PyPI
  • Socket score

Maintainers
1

A Python client library for Joern Server

A library to script code analyzers based on code property graphs (e.g., Joern/Ocular) via Python.

Requirements

  • Python 3 and Pip(we do not support Python 2.7) see (https://packaging.python.org/tutorials/installing-packages/)

Installation

To download and install the latest version, issue the following command:

pip install cpgclientlib

Usage

Assuming that joernd is running locally, the following short scripts creates a code property graph and runs a query to retrieve all methods in JSON format.

#!/usr/bin/env python3

from cpgclient.CpgClient import CpgClient

server = '127.0.0.1'
port = 8080
client = CpgClient(server, port)
client.create_cpg('/path/to/cpg')
methods = client.query('cpg.method.toJson')
print(methods)

References

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc