# Polyswarm Customer CLI
A CLI tool for interacting with the PolySwarm Customer APIs.
Supports Python 3.7 and greater.
## Installation
From PyPI:
pip install polyswarm
From source:
python setup.py install
If you want yara validation (optional):
pip install -e .[yara]
> If you get an error about a missing package named `wheel`, that means your version of pip or setuptools is too old.
> You need pip >= 19.0 and setuptools >= 40.8.0.
> To update pip, run `pip install -U pip`.
> To update setuptools, run `pip install -U setuptools`
## Usage
### Command line client
See the [Polyswarm Customer CLI documentation](https://docs.polyswarm.io/consumers/polyswarm-customer-cli-v2) for usage guidance.
### Using as a package
The `polyswarm-cli` package is built on top of the `polyswarm-api` package, and it includes
a set of higher-level methods that facilitates the usage of parallelism when making requests
to the api. We provide a class `Polyswarm` that extends from `PolyswarmAPI` and includes
these methods. For example:
```python
from polyswarm.polyswarm import Polyswarm
api = Polyswarm('my-api-key')
results = api.search_hashes(['e182cdfd5e7463d11f5e7bc49b4377ab25e58b9ff04266df3c34e6261c7b0df9',
'd80a1e42791d17cbce8d053afccd1dae7fb9f615676cb81a3a1699e86c344cb8',
'275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f'])
for result in results:
print(result.id)
```
Each hash lookup is done in a different thread using a `ThreadPoolExecutor` and results are yielded
as they come in in the same order as in the input. All functionality that is available in the command
line tool is also available for developers through this class.
## Automated Tests
To run automated tests suite (unit and integration):
pip install -r requirements.txt
pytest
To check current coverage by tests:
pytest --cov=polyswarm tests/
## Questions? Problems?
File a ticket or email us at `info@polyswarm.io`.
Raw data
{
"_id": null,
"home_page": "https://github.com/polyswarm/polyswarm-cli",
"name": "polyswarm",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.7",
"maintainer_email": null,
"keywords": null,
"author": "PolySwarm Developers",
"author_email": "info@polyswarm.io",
"download_url": "https://files.pythonhosted.org/packages/ad/e2/7b1d897ef1ff5e75c2dbb4882f98363a9a2abd55dc59dcbd00cada2c6482/polyswarm-3.8.1.tar.gz",
"platform": null,
"description": "\n# Polyswarm Customer CLI\n\nA CLI tool for interacting with the PolySwarm Customer APIs.\n\nSupports Python 3.7 and greater.\n\n## Installation\n\nFrom PyPI:\n\n pip install polyswarm\n\nFrom source:\n\n python setup.py install\n\nIf you want yara validation (optional):\n\n pip install -e .[yara]\n\n> If you get an error about a missing package named `wheel`, that means your version of pip or setuptools is too old.\n> You need pip >= 19.0 and setuptools >= 40.8.0. \n> To update pip, run `pip install -U pip`.\n> To update setuptools, run `pip install -U setuptools`\n\n## Usage\n\n### Command line client\nSee the [Polyswarm Customer CLI documentation](https://docs.polyswarm.io/consumers/polyswarm-customer-cli-v2) for usage guidance.\n\n### Using as a package\n\nThe `polyswarm-cli` package is built on top of the `polyswarm-api` package, and it includes\na set of higher-level methods that facilitates the usage of parallelism when making requests \nto the api. We provide a class `Polyswarm` that extends from `PolyswarmAPI` and includes \nthese methods. For example:\n\n```python\nfrom polyswarm.polyswarm import Polyswarm\napi = Polyswarm('my-api-key')\nresults = api.search_hashes(['e182cdfd5e7463d11f5e7bc49b4377ab25e58b9ff04266df3c34e6261c7b0df9',\n 'd80a1e42791d17cbce8d053afccd1dae7fb9f615676cb81a3a1699e86c344cb8',\n '275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f'])\nfor result in results:\n print(result.id)\n```\n\nEach hash lookup is done in a different thread using a `ThreadPoolExecutor` and results are yielded\nas they come in in the same order as in the input. All functionality that is available in the command\nline tool is also available for developers through this class.\n\n## Automated Tests\n\nTo run automated tests suite (unit and integration):\n\n pip install -r requirements.txt\n pytest\n\nTo check current coverage by tests:\n\n pytest --cov=polyswarm tests/\n\n## Questions? Problems?\n\nFile a ticket or email us at `info@polyswarm.io`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CLI for using the PolySwarm Customer APIs",
"version": "3.8.1",
"project_urls": {
"Homepage": "https://github.com/polyswarm/polyswarm-cli"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8e444a8a03f7c3368604dc82942176595ad582deff2156fad81200acd96356f8",
"md5": "187759e2b61d091fbf667449533e1f76",
"sha256": "42d53aca4f60ef560280c49a99cc3d9ff8d116c992a7db20cb4cabe8614c9852"
},
"downloads": -1,
"filename": "polyswarm-3.8.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "187759e2b61d091fbf667449533e1f76",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.7",
"size": 36894,
"upload_time": "2024-09-23T21:54:35",
"upload_time_iso_8601": "2024-09-23T21:54:35.062352Z",
"url": "https://files.pythonhosted.org/packages/8e/44/4a8a03f7c3368604dc82942176595ad582deff2156fad81200acd96356f8/polyswarm-3.8.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ade27b1d897ef1ff5e75c2dbb4882f98363a9a2abd55dc59dcbd00cada2c6482",
"md5": "48e94c50bf701af40b966c25288b47f2",
"sha256": "101471945f6c2449d1385b895550a0555e274ce21071121bdbd94f97059e3639"
},
"downloads": -1,
"filename": "polyswarm-3.8.1.tar.gz",
"has_sig": false,
"md5_digest": "48e94c50bf701af40b966c25288b47f2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.7",
"size": 27968,
"upload_time": "2024-09-23T21:54:36",
"upload_time_iso_8601": "2024-09-23T21:54:36.808110Z",
"url": "https://files.pythonhosted.org/packages/ad/e2/7b1d897ef1ff5e75c2dbb4882f98363a9a2abd55dc59dcbd00cada2c6482/polyswarm-3.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-23 21:54:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "polyswarm",
"github_project": "polyswarm-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "polyswarm"
}