Giter Site home page Giter Site logo

socket-sdk-python's Introduction

socketdev-python-sdk ###############

Purpose

The Socket.dev Python SDK provides a wrapper around the Socket.dev REST API to simplify making calls to the API from Python.

Initializing the module

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")

Supported Functions

npm.issues(package, version)

Retrieve the Issues associated with a package and version.

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.npm.issues("hardhat-gas-report", "1.1.25"))

PARAMETERS:

  • package (str) - The name of the NPM package.
  • version (str) - The version of the NPM Package.

npm.score(package, version)

Retrieve the Issues associated with a package and version.

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.npm.score("hardhat-gas-report", "1.1.25"))

PARAMETERS:

  • package (str) - The name of the NPM package.
  • version (str) - The version of the NPM Package.

dependencies.get(limit, offset) """""""""""""""""" Retrieve the dependencies for the organization associated with the API Key

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.dependencies.get(10, 0))

PARAMETERS:

  • limit (int) - The maximum number of dependencies to return
  • offset (int) - The index to start from for pulling the dependencies

dependencies.post(files, params)

Retrieve the dependencies for the organization associated with the API Key

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
file_names = [
    "path/to/package.json"
]
params = {
    "repository": "username/repo-name",
    "branch": "dependency-branch
}
print(socket.dependencies.post(file_names, params))

PARAMETERS:

  • files (list) - The file paths of the manifest files to import into the Dependency API.
  • params (dict) - A dictionary of the repository and branch options for the API

org.get()

Retrieve the Socket.dev org information

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.org.get())

quota.get()

Retrieve the the current quota available for your API Key

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.quota.get())

report.list()

Retrieve the list of all reports for the organization

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.report.list())

report.delete(report_id)

Delete the specified report

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.report.delete("report-id"))

PARAMETERS:

  • report_id (str) - The report ID of the report to delete

report.view(report_id)

Retrieve the information for a Project Health Report

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.report.view("report_id"))

PARAMETERS:

  • report_id (str) - The report ID of the report to view

report.supported()

Retrieve the supported types of manifest files for creating a report

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.report.supported())

report.create(files)

Create a new project health report with the provided files

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
files = [
    "/path/to/manifest/package.json"
]
print(socket.report.create(files))

PARAMETERS:

  • files (list) - List of file paths of manifest files

repositories.get()

Get a list of information about the tracked repositores

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.repositories.get())

settings.get()

Retrieve the Socket Organization Settings

Usage:

from socketdev import SocketDev
socket = SocketDev("REPLACE_ME")
print(socket.settings.get())

socket-sdk-python's People

Contributors

dacoburn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.