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

A library for querying custom and third party web address blacklists and whitelists.

Features

  • client classes for Google Safe Browsing Lookup API and hpHosts services
  • support for custom DNSBL service clients
  • preconfigured clients for SURBL, Spamhaus ZEN and Spamhaus DBL
  • support for querying and populating custom host whitelists and blacklists
  • combining multiple URL testers into a composite tester
  • optional querying for redirect URL addresses when using a composite URL tester
  • support for Python 2 and 3

Usage

Simple test for membership of a host value in a host blacklist:

>>> from spam_lists import SPAMHAUS_DBL
>>> 'dbltest.com' in SPAMHAUS_DBL
True

lookup(host_value) method returns a named tuple containing:

  • a listed host that is a parent of a searched domain, or a listed ip address equal to one searched in the blacklist
  • source of the returned information as an instance of the client used to search for the value
  • a set of classificiation terms associated with the value
>>> SPAMHAUS_DBL.lookup('dbltest.com')
AddressListItem(value=u'dbltest.com', ...)

Testing if there is any spam URL in a sequence:

>>> urls_to_test = (
'http://google.com',
'http://wikipedia.org',
'http://dbltest.com'
)
>>> SPAMHAUS_DBL.any_match(urls_to_test)
True

Filtering recognized spam URLs out of a sequence of values returns a generator object that yields the spam URLs:

>>> result = SPAMHAUS_DBL.filter_matching(urls_to_test)
>>> result
<generator object <genexpr> at 0xb4f60a7c>
>>> list(result)
['http://dbltest.com']

Calling lookup_matching(urls) returns a generator object yielding instances of the AddressListItem named tuple for matching URLs:

>>> result = SPAMHAUS_DBL.lookup_matching(urls_to_test)
>>> result
<generator object lookup_matching at 0xb4f60e3c>
>>> list(result)
[AddressListItem(value=u'dbltest.com', ...)]

For further information, read spam_lists package docstring.

Installation

Install using pip:

$ pip install spam-lists

To be able to run tests, install test extras:

$ pip install spam-lists[test]

License

MIT
Release History

Release History

1.0.0

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

1.0.0b7

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

1.0.0b6

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

1.0.0b5

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

1.0.0b4

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

1.0.0b3

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

1.0.0b2

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
spam-lists-1.0.0.tar.gz (30.8 kB) Copy SHA256 Checksum SHA256 Source Sep 19, 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