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.0.tar.gz (42.3 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.0-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptsandbox-5.0.0.tar.gz
  • Upload date:
  • Size: 42.3 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.0.tar.gz
Algorithm Hash digest
SHA256 7cfd5a025b6e36b141035becd1b1e8d10d8c080053240a8a13407fafb21e9c47
MD5 55a45612de4fc372293de66e5ef717ee
BLAKE2b-256 9b56770e00bb3cb27e646861c2dd285871e95d545e77592cf6f6954d8f1f9280

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ptsandbox-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 53.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5db555c994571c69379f74d287266a1074482c4ba772a4c6ad081ff4b6ed826c
MD5 b357fd9d7480655a51efc3b963b266ef
BLAKE2b-256 949c957c1acb0e89a9d9eef85f24b41859905b46337c36c973719c1bf6db4836

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