Skip to main content

CLI for using the PolySwarm Customer APIs

Project description

Polyswarm Customer CLI

A CLI tool for interacting with the PolySwarm Customer APIs.

Supports Python 3.10 and greater.

Installation

From PyPI:

pip install polyswarm

From source:

python setup.py install

Usage

Command line client

See the Polyswarm Customer CLI documentation 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:

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 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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyswarm-3.17.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

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

polyswarm-3.17.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file polyswarm-3.17.0.tar.gz.

File metadata

  • Download URL: polyswarm-3.17.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for polyswarm-3.17.0.tar.gz
Algorithm Hash digest
SHA256 c560e65aa54ca244004b6133d2486b7dda04687b33cf035978869ea6e989be0f
MD5 bff70997c373f450c85bfb7cb00a00a8
BLAKE2b-256 63c09d73c8a496522686ec298352d50ebabd89b20077942e2b18d739d2312ce1

See more details on using hashes here.

File details

Details for the file polyswarm-3.17.0-py3-none-any.whl.

File metadata

  • Download URL: polyswarm-3.17.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for polyswarm-3.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf166a386c78d7ed07403cf6653341418468a38fcd2e62f32af72cdac62d2550
MD5 b35ec89c922a5a627303ab9401646df5
BLAKE2b-256 8e16209d512d0cf66ba1617bba6ff7af048d4e63b7e99d3bdd36c60fd5ba00d0

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