Skip to main content

Create a progress bar that you can view on chrono.shodan.io

Project description

Shodan Chrono: Python

Quickstart

Install the library using:

pip install shodan-chrono

And then use it in your code:

import chrono

items = [i for i in range(100)]
with chrono.progress("My Script", len(items), api_key="YOUR SHODAN API KEY") as pb:
    for item in items:
        # Do something
        # Update the progress bar after we've processed the item
        pb.update()

You can also tell the progress bar to update by more than 1 tick:

    pb.update(5)  # Tell Chrono that we've processed 5 items

Configuring the API key

The Chrono API requires a Shodan API key and there are 3 possible ways you can provide that:

  • Initialize the Shodan CLI on your local machine: shodan init YOUR_API_KEY
  • Set the SHODAN_API_KEY environment variable. For example: export SHODAN_API_KEY="YOUR KEY"
  • Use the api_key parameter on the chrono.progress() class

If you're already using the Shodan CLI for other things then you won't need to configure anything in order to use Chrono.

Contributing

Checkout the repository and then use poetry to manage the dependencies, virtual environment and packaging. To get started, simply run the following command once you're in the python/ subdirectory of this repository:

poetry install

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

shodan-chrono-0.1.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

shodan_chrono-0.1.0-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page