Python Library for Facebook ThreatExchange
Project description
python-threatexchange
A Python Library for downloading and using datasets stored in ThreatExchange.
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
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bab06f23f94ffcef72181c1f23319d555970f477eb06690e430e9236fd99d55 |
|
MD5 | 7465f7f5c0252a4318c81eff5137cb97 |
|
BLAKE2b-256 | bc6da3e90cb83dd5fa303e7df445062716bee1255deac4c904e2d55142ed5cc6 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a850ee5c4de4b9b7592e11ce3d3b210eff2db4f321c0f08c08e0d1265de34479 |
|
MD5 | 9399436bc343fd4986c0775f7f6d76e1 |
|
BLAKE2b-256 | 5ad5161da070866b89684d8c21ef051c07ba1664b11c4a14be3a200c51741b50 |