This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Python 3 implementation of the Stopbadware <https://www.stopbadware.org/> Private API <https://stopbadware.atlassian.net/wiki/display/apidocs/StopBadware+API+Documentation+Home>. In its current form it only implements downloading of events from a specific timestamps, IP addresses and searching based on timestamps.

How To Use

import pysbw
import time

api = pysbw.API('~/.stopbadware.key')

# Retrieve event reports for past 24 hours using UNIX style timestamp
json_response = api.retrieve(int(time.time()) - 24 * 3600)

# Retrieve event report with report UID
json_response = api.retrieve("564f2c78e4b0a131f050f844")

# Retrieve event reports for past 24 hours using search functionality
end = int(time.time())
json_response = self.api.search_between(end - 24 * 3600, end)

Installiation

pip3 install pysbw --pre

Example Key File

[sbw]
apikey=<String of private key>
publickey=<String of public key>

Instantiation

api = pysbw.API('~/.virustotal.key')  # The default way of using the
api = pysbw.API('', private_api_key=<PRIVATE API KEY>, public_api_key=<PUBLIC API KEY>)  # Providing other parameters
api = pysbw.API( ... , max_retires=<N: Number>)  # If specified the API will only retry <N> times to get the response
api = pysbw.API( ... , rate_limit={"requests": 40, "seconds": 300})  # The rate limits for the number of queries to the API

API

Use the method *retrieve()* to get Reports. This method’s first argument can be:

  • a UNIX style timestamp in UTC to retrieve reports since that timestamp
  • an IP address in DOT notation such as ‘8.8.8.8’ to retrieve all reports relating to IP address
  • an event report UID which is a 24 digit hex number.

retrieve() will attempt to auto-detect what you’re giving it. If you want to be explicit, you can use the thing_type parameter with the values:

  • ip
  • timestamp
  • uid

These values are provided as constants that you can use instead in the ‘API_Constans’ class which you can import as follows

from pysbw import API_Constansts

Use the method *search_between()* to search for events between two timestamp values.

References

SBW API Documentation <https://stopbadware.atlassian.net/wiki/display/apidocs/StopBadware+API+Documentation+Home>.

Release History

Release History

0.1a10

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1a9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1a8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1a7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1a6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pysbw-0.1a10.tar.gz (7.2 kB) Copy SHA256 Checksum SHA256 Source Oct 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting