library to add, lookup and remove entries from DroneBL
Project description
pydronebl
Installation
$ pip3 install dronebl
Usage
The RPC key, IP and ID below are fake.
Looking up an IP
returns None
if not found
>>> from dronebl import DroneBL
>>> d = DroneBL("04efa460cf244b6e88d9d2b8c31eb953")
>>> # by IP
>>> d.lookup("198.51.100.123")
Lookup(198.51.100.123, id=3174874, type=19, datetime=2020-08-21T10:18:44, comment='abused VPN (connect verified)')
>>> # by ID
>>> d.lookup(3174874)
Lookup(198.51.100.123, id=3174874, type=19, datetime=2020-08-21T10:18:44, comment='abused VPN (connect verified)')
Adding an IP
>>> d.add("198.51.100.123", 19, "abused VPN (connect verified)")
(3174874, 'Added 198.51.100.123')
>>> d.add("198.51.100.123", 19, "abused VPN (connect verified)")
(None, 'You already reported 198.51.100.123 as type 19')
Removing an IP
>>> d.remove(3174874)
(True, 'Removed 3174874')
>>> d.remove(3174874)
(False, '3174874 already delisted')
Asyncified!
identical methods are offered on the async version of DroneBL
, AsyncDroneBL
>>> from dronebl import AsyncDroneBL
>>> d = AsyncDroneBL("04efa460cf244b6e88d9d2b8c31eb953")
>>> await d.lookup("198.51.100.123")
Lookup(198.51.100.123, id=3174874, type=19, datetime=2020-08-21T10:18:44, comment='abused VPN (connect verified)')
Contact
Come say hi at ##jess on freenode
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
dronebl-0.3.1.tar.gz
(4.7 kB
view hashes)