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.3.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.3-py3-none-any.whl (60.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptsandbox-5.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 775a95c31ede26bd33a5cb407a6ef793b92fbefd6aaa20b137b02aa09c620062
MD5 c346da88926efe8ad7273d765c5a052a
BLAKE2b-256 e4960b62149a367d36276863d2ffc98585b7a8f51327edf3c6612f2913432712

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ptsandbox-5.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3ab6b28236c80ab45aab589c6830f9991e61b58b46a4bd742388fa297c05dcf2
MD5 e9199b825132a71588a8a250e1b86adc
BLAKE2b-256 4e3d1577c9044f7087874cde508172490fe956b242a4d9a71d9b0ea89d809293

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