Skip to main content

WS Python SDK

Project description

Logo License CI Python 3.7 PyPI

WhiteSource Python SDK

SDK written in Python to simplify access to WhiteSource resources

The SDK contains the following modules:

  • web - Module for accessing WhiteSource Application (reports, administration, etc...).
  • client - UA wrapper layer (download UA, execute scan, read UA output files...).

Supported Operating Systems

  • Linux (Bash): CentOS, Debian, Ubuntu, RedHat
  • Windows (PowerShell): 10, 2012, 2016

How to build and install package from source

  1. Download the code: git clone https://github.com/whitesource-ps/ws-sdk.git
  2. Build wheel package python setup.py bdist_wheel
  3. Download wheel from GitHub and install : pip install ws-sdk*.whl

How to install package

  1. Obtain connection details from WS Application (Home > Admin > Integration)
  2. Install package from Pypi: pip install ws-sdk

Execution

# Web (WhiteSource Application)
from ws_sdk.web import WS
ws = WS(api_url="WS_URL", user_key="USER_KEY", token="ORG_TOKEN")
# Get alerts 
all_alerts = ws.get_alerts()
# Get vulnerabilities report in XLSX format
vul_report = ws.get_vulnerability(report=True)
# Get all projects ()
project_list = ws.get_projects()
# Create user in the organization
ws.create_user(name='USER_TEST1', email="USER_TEST1@EMAIL.COM", inviter_email="INVITER@EMAIL.COM")

# Client (WhiteSource Unified Agent)
from ws_sdk.client import WSClient
ws_client = WSClient(api_url="WS_URL", user_key="USER_KEY", token="ORG_TOKEN", ua_path="/UA/WORKING/DIR")
# Download latest UA jar and conf file
ws_client.download_ua()
# Execute scan into defined project token
out = ws_client.execute_scan(scan_dir="/PATH/TO/DIR", project_token="PROJ_TOKEN")
# Read scan artifcat's policy rejection summary 
pol_rej = ws_client.get_policy_rejection_summary()

Project details


Release history Release notifications | RSS feed

This version

0.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ws_sdk-0.6.0-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

ws_sdk-0.6-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file ws_sdk-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: ws_sdk-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 47.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ws_sdk-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98c24124d4a69400b769835805e42800f156e7397064d23b9630096825948786
MD5 f3b52aecf6fd0b6d7cc3d09c5b408730
BLAKE2b-256 896e3dcf1c5ac9c8152ebe629a937d0e7f7eb1a9bdbc79bc83c8435b46ef5e39

See more details on using hashes here.

File details

Details for the file ws_sdk-0.6-py3-none-any.whl.

File metadata

  • Download URL: ws_sdk-0.6-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for ws_sdk-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ef748008e75a674d22fed88b1fadd79667c54441e7c25fbfff3b18c104964a0d
MD5 86e9d4355360b9b1ba4f7a349943fc02
BLAKE2b-256 9ddcf02c03a093fa601a7a635c89d87517d40319fef9772492c6e18a126c8d16

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