Skip to main content

Async API connector for PT Sandbox instances

Project description

Image

Async API connector for PT Sandbox instances


Documentation: https://security-experts-community.github.io/py-ptsandbox

Source Code: https://github.com/Security-Experts-Community/py-ptsandbox


Installation

You can use the following command to install the package:

PyPI:

python3 -m pip install ptsandbox

uv:

uv add ptsandbox

Nix:

TBA

Usage

Getting a list of all installed images using the API:

import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main() -> None:
    key = SandboxKey(
        name="test-key-1",
        key="<TOKEN_FROM_SANDBOX>",
        host="10.10.10.10",
    )

    sandbox = Sandbox(key)
    print(await sandbox.api.get_images())

asyncio.run(main())

Getting system settings using the UI API:

import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    key = SandboxKey(
        name="test-key-1",
        key="<TOKEN_FROM_SANDBOX>",
        host="10.10.10.10",
        ui=SandboxKey.UI(
            login="login",
            password="password",
        ),
    )

    sandbox = Sandbox(key)
    # You must log in before using the UI API
    await sandbox.ui.authorize()

    print(await sandbox.ui.get_system_settings())

asyncio.run(main())

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

ptsandbox-5.0.2.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

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

ptsandbox-5.0.2-py3-none-any.whl (60.4 kB view details)

Uploaded Python 3

File details

Details for the file ptsandbox-5.0.2.tar.gz.

File metadata

  • Download URL: ptsandbox-5.0.2.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ptsandbox-5.0.2.tar.gz
Algorithm Hash digest
SHA256 b81f90a928f4a0e63cd2c25336eabfa613408f37bc7059e02f36f392cafc5f42
MD5 a99c0265aa3a8a85388014d9fa70cb4d
BLAKE2b-256 fd1c7f1b62515b311c3979abe3f55e46c8f5f2f44f178a9de166808dd951457f

See more details on using hashes here.

File details

Details for the file ptsandbox-5.0.2-py3-none-any.whl.

File metadata

  • Download URL: ptsandbox-5.0.2-py3-none-any.whl
  • Upload date:
  • Size: 60.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ptsandbox-5.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a8e9c60a685e486b4362943e8f102b8c8f4be188a063f27e7ce2d96afebe216
MD5 3a9ab0d1c79a518718b4a9d461f1864f
BLAKE2b-256 89f7ef6fba326517280199cb1e75c52c8073c721896222cab17349d3e0b35f55

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