Skip to main content

Python SDK for ANY.RUN APIs

Project description

ANY.RUN Tools

Tests Documentation PyPI version Python versions License Code style: black Checked with mypy Downloads codecov

Python SDK for ANY.RUN APIs

Features

  • ✨ Modern async/await API
  • 🚀 Type hints and data validation with Pydantic
  • 💾 Built-in caching support (memory and Redis)
  • 🔄 Automatic retries with exponential backoff
  • 🚦 Rate limiting
  • 📝 Comprehensive documentation
  • 🧪 Extensive test coverage
  • 🐍 Supports Python 3.8-3.12

Installation

# Basic installation
pip install anyrun-tools

# With Redis caching support
pip install anyrun-tools[redis]

# With all optional dependencies
pip install anyrun-tools[all]

Quick Start

from anyrun import AnyRunClient

async with AnyRunClient(api_key="your-api-key") as client:
    # Submit file for analysis
    response = await client.sandbox.analyze(
        obj_type="file",
        file=b"file_content",
        env_os="windows",
        env_version="10"
    )

    task_id = response["data"]["task_id"]

    # Monitor analysis status
    async for update in client.sandbox.get_analysis_status(task_id):
        print(f"Status: {update['status']}")

    # Get analysis results
    result = await client.sandbox.get_analysis(task_id)
    print(f"Analysis score: {result['data']['score']}")

Available APIs

Sandbox API

  • Submit files and URLs for analysis
  • Monitor analysis progress in real-time
  • Get detailed analysis results
  • Manage analysis tasks

TI Lookup API (coming soon)

  • Look up file hashes
  • Get threat intelligence data
  • Check indicators of compromise

TI YARA API (coming soon)

  • Match YARA rules against samples
  • Get matching details
  • Manage YARA rules

Documentation

For detailed documentation, please visit https://bykovk-pro.github.io/anyrun-tools

Development

# Clone the repository
git clone https://github.com/bykovk-pro/anyrun-tools.git
cd anyrun-tools

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# Install development dependencies
pip install -e .[dev]

# Install pre-commit hooks
pre-commit install

# Build documentation
pip install -e .[docs]
mkdocs serve

Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Security

If you discover a security vulnerability within ANY.RUN Tools, please send an e-mail to Kirill Bykov via bykovk@anyrun.tools. All security vulnerabilities will be promptly addressed.

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

anyrun_tools-0.1.1.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

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

anyrun_tools-0.1.1-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

Details for the file anyrun_tools-0.1.1.tar.gz.

File metadata

  • Download URL: anyrun_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for anyrun_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 10f302491a6474cb4eef3d0ecd83491dbc3f0c892abffb0ad9e266e5dca77145
MD5 fd9e0f5ef73a6335b691cf67ddfa142e
BLAKE2b-256 58f9ff04b2176951b5fc1ab3a320aceecf1c6ce3c81d70911c9633cbb0dfdf6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyrun_tools-0.1.1.tar.gz:

Publisher: publish.yml on bykovk-pro/anyrun-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anyrun_tools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: anyrun_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for anyrun_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f6908190ee62cb4ac8640311336e2a39e482767469ff181d8e537d11286dca0
MD5 7cf7a352131bbc2f5aa93fa88fe74e5a
BLAKE2b-256 dee505b30df68e2795c36f368c4ba8beaba233fa73ba11ba7a7ebb5e38c22772

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyrun_tools-0.1.1-py3-none-any.whl:

Publisher: publish.yml on bykovk-pro/anyrun-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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