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.1.tar.gz (42.7 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.1-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptsandbox-5.0.1.tar.gz
  • Upload date:
  • Size: 42.7 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.1.tar.gz
Algorithm Hash digest
SHA256 c773f6942fb9bb14db9aa444675731fe22486eec07aa4c2b472d8375e239664c
MD5 3c97d428e8231222e96c0f98e61eb347
BLAKE2b-256 328208b3f8180c13818ded727f3392c8127554c8b9e8fc517540975b34ecf586

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ptsandbox-5.0.1-py3-none-any.whl
  • Upload date:
  • Size: 54.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cc7095a24ccbfe14dd3142eb6e7f5392b8b3d79eff5e2248f1ceb13e630421b
MD5 ef238b4fe63b08706257e1b05dfd7457
BLAKE2b-256 b8f0c86777635a1fa293fbb70afa736b359378d38f39749cf7731b35611fd505

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