Skip to main content

Python Library for Facebook ThreatExchange

Project description

python-threatexchange

A Python Library for downloading and using datasets stored in ThreatExchange.

Code style: black

Overview

Fetching data from ThreatExchange "correcty" is sadly not as straightforward as it should be.

Additionally, once you have the data, the application of that data might not always be straightforward.

This library provides a reference implementation for fetching datasets, applying many common formats, and uploading your own data to the dataset.

These reference implementations are not meant to be the best, most efficient, or production ready versions, but to instead be simple enough that they could be easily pasted to other languages.

The bundled cli tool of the same name is meant to demonstrate the library, as well as potentially provide a first draft implementation for prototype or evaluation.

Installation

$ python3 -m pip install threatexchange [--upgrade]

Usage

This package can be used as a library, but the fastest way to use it is from the CLI

$ threatexchange match text "bball now?"
Looks like you haven't set up a collaboration config, so using the sample one against public data
Looks like you are running this for the first time. Fetching some sample data.
video_md5: 2
raw_text: 3
url: 1
video_tmk_pdqf: 1
photo_md5: 1
pdq: 138
trend_query: 1
3425830734108278 raw_text media_priority_samples
3261912580534814 trend_query media_priority_samples

$ threatexchange label descriptor 3425830734108278 false_positive

Documentation

The best documentation is in the --help of the tool, as well as the docstrings in libraries. Open issues if something is lacking.

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

threatexchange-0.0.11.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

threatexchange-0.0.11-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file threatexchange-0.0.11.tar.gz.

File metadata

  • Download URL: threatexchange-0.0.11.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for threatexchange-0.0.11.tar.gz
Algorithm Hash digest
SHA256 9bab06f23f94ffcef72181c1f23319d555970f477eb06690e430e9236fd99d55
MD5 7465f7f5c0252a4318c81eff5137cb97
BLAKE2b-256 bc6da3e90cb83dd5fa303e7df445062716bee1255deac4c904e2d55142ed5cc6

See more details on using hashes here.

File details

Details for the file threatexchange-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: threatexchange-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for threatexchange-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a850ee5c4de4b9b7592e11ce3d3b210eff2db4f321c0f08c08e0d1265de34479
MD5 9399436bc343fd4986c0775f7f6d76e1
BLAKE2b-256 5ad5161da070866b89684d8c21ef051c07ba1664b11c4a14be3a200c51741b50

See more details on using hashes here.

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