Skip to main content

Python Library for Facebook ThreatExchange

Project description

pytx (pie-tex) is a Python Library for interfacing with Facebook’s ThreatExchange.

Build Status

https://img.shields.io/pypi/dm/pytx.svg https://img.shields.io/pypi/v/pytx.svg https://img.shields.io/badge/python-2.7-blue.svg https://img.shields.io/pypi/l/pytx.svg

Installation

Use pip to install or upgrade pytx:

$ pip install pytx [--upgrade]

Quick Example

from pytx import init
from pytx import ThreatIndicator
from pytx.vocabulary import ThreatIndicator as ti

init('<app-id>', '<app-secret>')
results = ThreatIndicator.objects(text='www.facebook.com')
for result in results:
    print result.get(ti.THREAT_TYPES)

# type is type_ because type is a reserved word.
results = ThreatIndicator.objects(type_='IP_ADDRESS',
                                  text='127.0.0.1')
for result in results:
    print result.get(ti.INDICATOR)

Documentation

For more information you can find documentation in the ‘docs’ directory, check the Github wiki, or readthedocs (coming soon).

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

pytx-0.1.3.tar.gz (22.2 kB view hashes)

Uploaded Source

Built Distribution

pytx-0.1.3-py2-none-any.whl (21.1 kB view hashes)

Uploaded Python 2

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