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 thechrono.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
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
Built Distribution
File details
Details for the file shodan-chrono-0.1.0.tar.gz
.
File metadata
- Download URL: shodan-chrono-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.2 Linux/4.18.0-25-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2a18f2b8cb0f55e63e79e87463644e9eb40da5dcf76e92f6d7ce6365e60034c |
|
MD5 | 02d6fd6cc88359611b0410b26ca627ff |
|
BLAKE2b-256 | 012bb87a286e44d025900fdfc90c2b2a0c08f7c59c17c581514842c011e899b4 |
File details
Details for the file shodan_chrono-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: shodan_chrono-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.2 Linux/4.18.0-25-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f26d61daaf2a8c142444d2ddc703d5512b9d6aa05c8c223d612d402fc424abc8 |
|
MD5 | 478ea5e5b67fe0d9f4790783425446c8 |
|
BLAKE2b-256 | 822f8269f5f7b630c916151c0445e7a1cf19480c57da1fa0480146d9708c69ed |