Skip to main content

Python SDK for Trend Micro Vision One

Project description

tm-visionone

A Python client for the Trend Micro Vision One API v3.

This package helps you integrate with Trend Micro Vision One (XDR) services — especially Suspicious Object List and Connectivity health check APIs — with clean, consistent responses and retry handling.


✨ Features

  • Upload suspicious objects (IOCs: URL, IP, domain, file hashes, email).
  • List suspicious objects with filters, ordering, and pagination support.
  • Get next page of results using nextLink.
  • Health check API for connectivity & token validation.
  • Handles rate limiting (429) and transient errors (500, 502, 503, 504) with retries.
  • Region-aware (us, eu, jp, sg, au, in).
  • Optional logging.

📦 Installation

From PyPI (after release):

pip install tm-visionone

From TestPyPI (for testing):

pip install -i https://test.pypi.org/simple/ tm-visionone

🚀 Quick Usage

from tm_visionone import VisionOneClient

API_KEY = "YOUR_API_KEY"

client = VisionOneClient(api_key=API_KEY, region="us", enable_logging=True)

# Healthcheck
print(client.healthcheck())
# -> {'success': True, 'data': {'connectivity': True, 'status': 'available', 'message': 'API reachable and token valid'}, 'error': None}

# Upload suspicious objects
objects = [
    {"url": "http://malicious.example", "description": "Test URL", "scanAction": "log", "riskLevel": "high"}
]
print(client.upload_suspicious_objects(objects))
# -> {'success': True, 'data': [{'status': 201}], 'error': None}

# List suspicious objects
result = client.get_suspicious_objects(top=10)
print(result["data"]["items"])  # Paginated results

📖 Advanced Usage

Pagination

result = client.get_suspicious_objects(top=10)
print(result["data"]["items"])

if "nextLink" in result["data"]:
    next_page = client.get_next_page(result["data"]["nextLink"])
    print(next_page["data"]["items"])

Logging

Enable built-in logging:

client = VisionOneClient(api_key=API_KEY, region="us", enable_logging=True)

🧪 Running Tests

Clone the repo and install dev dependencies:

git clone https://github.com/saikumargandhi/tm-visionone.git
cd tm-visionone
pip install -r requirements-dev.txt
pytest -s tests/

⚖️ License

This project is licensed under the MIT License.


🙏 Attribution

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

tm_visionone-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

tm_visionone-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file tm_visionone-0.1.0.tar.gz.

File metadata

  • Download URL: tm_visionone-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for tm_visionone-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c80f28aeae71c37c6c16f2c34ce49afe8d8ac2761d3b2edc4489d7579b413c3a
MD5 c8cc490ebcaefc41b5d88b6fca2791bb
BLAKE2b-256 602d3ab1670833debb1b0b8c797c11ee8f2e9026e348dfbd14676bbc936b2533

See more details on using hashes here.

File details

Details for the file tm_visionone-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tm_visionone-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for tm_visionone-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1dcf86eff1e50abad0e086a86f727afb91344cdd89cdb17aa25963d78ab20ed
MD5 2fe7ae45218aa3498cdcf85085f73d4b
BLAKE2b-256 f31d9eaa5e969369d94439e150293c9d1121a86664c2994d131867816fa331b3

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