Metadata-Version: 2.2
Name: anyrun-sdk
Version: 1.1.1
Summary: This is the official Python client library for ANY.RUN. Automate management of ANY.RUN REST endpoints
Author-email: Semen Shalnev <anyrun-integrations@any.run>
License: Apache v2.0
Project-URL: Homepage, https://github.com/anyrun/anyrun-sdk
Project-URL: Examples, https://github.com/anyrun/anyrun-sdk/tree/main/examples
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp==3.11.12
Requires-Dist: typing-extensions==4.12.2
Provides-Extra: dev
Requires-Dist: pytest==8.3.4; extra == "dev"
Requires-Dist: pytest-asyncio==0.25.3; extra == "dev"
Requires-Dist: pytest-cov==6.0.0; extra == "dev"

<p align="center">
    <a href="#readme">
        <img alt="ANY.RUN logo" src="https://raw.githubusercontent.com/anyrun/anyrun-sdk/b3dfde1d3aa018d0a1c3b5d0fa8aaa652e80d883/static/logo.svg">
    </a>
</p>

______________________________________________________________________

# ANY.RUN SDK
This is the official Python client library for ANY.RUN.  
With this library you can interact with the ANY.RUN REST API and automate your workflow quickly and efficiently.

Available features:

* Automate ANY.RUN Threat Intelligence Feeds management.  
  Supports the following feed formats:
  * MISP 
  * STIX
  * Network iocs
* Automate Lookup and YARA search management
* Built-in objects iterator
* Synchronous and asynchronous interface

# The library public interface overview

```python
import os
from pprint import pprint

from anyrun.connectors import FeedsConnector


def main():
    # Initialize the connector object
    with FeedsConnector(api_key) as connector:
      # Process request to ANY.RUN feeds endpoint
      feeds = connector.get_stix(url=False, period='month', limit=500)
      pprint(feeds)


if __name__ == '__main__':
    # Setup ANY.RUN api key
    api_key = os.getenv('ANY_RUN_FEEDS_API_KEY')
    main()
```
You can find additional usage examples [here](https://github.com/anyrun/anyrun-sdk/tree/main/examples)

#  Installation Guide

#### You can install the SDK using pip or any other package manager
```console
$ pip install anyrun-sdk
```

#### Also, you can install the SDK manually using setup.py module
```console
$ git clone git@github.com:anyrun/anyrun-sdk.git
$ cd anyrun-sdk
$ python -m pip install .
```


# Contribution Guide

There are a several conventions you must follow to add source code to the project

#### 1. Clone project repository using one of the following ways
```console
$ git clone git@github.com:anyrun/anyrun-sdk.git
$ git clone https://github.com/anyrun/anyrun-sdk.git
```

#### 2. Jump into the project directory
```console
$ cd anyrun-sdk
```

#### 4. Create a new local branch
```console
$ git checkout -b <branch_title>

Branch title template: feature/public/[TaskShortDescription]
```
* **TaskShortDescription** - Feature name. Includes only lower case words separated by dashes

#### 5. Commit your changes
```console
$ git add .
$ git commit -m <commit_title>

Commit title template: [ImpactType]([ImpactScope]): [CommitChanges]
```
* **ImpactType** 
  * feat - To implement a new feature
  * fix - To fix some bugs
  * tests - To add some tests
* **ImpactScope** - The part of the project in free form that is affected by the commit 
  * general - To add global changes
  * logs - To add logs changes
  * and other...

* **CommitChanges** - The main changes. Includes only lower case words separated by spaces. 
Multiple changes could be written separated by commas

#### 6. Open a new pull request

# Running tests

#### 1. Jump into the project directory
```console
$ cd anyrun-sdk
```

#### 2. Install dev requirements
```console
$ python -m pip install -e '.[dev]'
```

#### 3. Run tests
```console
$ pytest tests -x
$ pytest --cov=anyrun --cov-report=term-missing
```

# Backward Compatibility

The SDK supports Python 3.9 and higher

# Useful links

[TI Lookup query Guide](https://intelligence.any.run/TI_Lookup_Query_Guide_v4.pdf)  
[ANY.RUN API documentation](https://any.run/api-documentation/#api-Request-Request)
