You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chrisr3d ca61b06aa2
Merge branch 'master' of
3 years ago
docs Tweak custom SCO ID-generating properties docs 3 years ago
examples Formatting changes made by the new pre-commit hook 'add trailing commas' 5 years ago
stix2 Merge branch 'master' of 3 years ago
.gitignore Add default weight_dict to documentation 4 years ago
.isort.cfg Update .isort.cfg 4 years ago
.pre-commit-config.yaml Update isort.cfg and .pre-commit-config.yaml 5 years ago
.travis.yml Fix some testing 3 years ago
CHANGELOG Update CHANGELOG for v1.4.0 3 years ago fixup program name w/ 'TC' to OASIS TC Open Repo... 5 years ago
LICENSE Create boilerplate LICENSE text 6 years ago Add MANIFEST to exclude test from final package 6 years ago
README.rst Fix parsing example in Readme 4 years ago
requirements.txt update .ipynb files with correct references. update package requirements 4 years ago
setup.cfg Bump version: 1.3.1 → 1.4.0 3 years ago Drop python-dateutil as a dependency and switch to the builtin 3 years ago
tox.ini Fix some TAXII DataStore tests 3 years ago


|Build_Status| |Coverage| |Version| |Downloads_Badge| |Documentation_Status|


This is an `OASIS TC Open Repository <>`__.
See the `Governance <#governance>`__ section for more information.

This repository provides Python APIs for serializing and de-serializing STIX2
JSON content, along with higher-level APIs for common tasks, including data
markings, versioning, and for resolving STIX IDs across multiple data sources.

For more information, see `the documentation <>`__ on ReadTheDocs.


Install with `pip <>`__:

.. code-block:: bash

$ pip install stix2


To create a STIX object, provide keyword arguments to the type's constructor.
Certain required attributes of all objects, such as ``type`` or ``id``, will
be set automatically if not provided as keyword arguments.

.. code-block:: python

from stix2 import Indicator

indicator = Indicator(name="File hash for malware variant",
pattern="[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']")

To parse a STIX JSON string into a Python STIX object, use ``parse()``:

.. code-block:: python

from stix2 import parse

indicator = parse("""{
"type": "indicator",
"spec_version": "2.1",
"id": "indicator--dbcbd659-c927-4f9a-994f-0a2632274394",
"created": "2017-09-26T23:33:39.829Z",
"modified": "2017-09-26T23:33:39.829Z",
"name": "File hash for malware variant",
"indicator_types": [
"pattern_type": "stix",
"pattern": "[file:hashes.md5 ='d41d8cd98f00b204e9800998ecf8427e']",
"valid_from": "2017-09-26T23:33:39.829952Z"


For more in-depth documentation, please see ` <>`__.

STIX 2.X Technical Specification Support

This version of python-stix2 brings initial support to STIX 2.1 currently at the
CSD level. The intention is to help debug components of the library and also
check for problems that should be fixed in the specification.

The `stix2` Python library is built to support multiple versions of the STIX
Technical Specification. With every major release of stix2 the ``import stix2``
statement will automatically load the SDO/SROs equivalent to the most recent
supported 2.X Committee Specification. Please see the library documentation for
more details.


This GitHub public repository (****) was
`proposed <>`__ and
`approved <>`__
[`bis <>`__] by the
`OASIS Cyber Threat Intelligence (CTI) TC <>`__
as an `OASIS TC Open Repository <>`__
to support development of open source resources related to Technical Committee work.

While this TC Open Repository remains associated with the sponsor TC, its
development priorities, leadership, intellectual property terms, participation
rules, and other matters of governance are `separate and distinct
from the OASIS TC Process and related policies.

All contributions made to this TC Open Repository are subject to open
source license terms expressed in the `BSD-3-Clause License <>`__.
That license was selected as the declared `"Applicable License" <>`__
when the TC Open Repository was created.

As documented in `"Public Participation Invited
contributions to this OASIS TC Open Repository are invited from all parties,
whether affiliated with OASIS or not. Participants must have a GitHub account,
but no fees or OASIS membership obligations are required. Participation is
expected to be consistent with the `OASIS TC Open Repository Guidelines and Procedures
the open source `LICENSE <>`__
designated for this particular repository, and the requirement for an
`Individual Contributor License Agreement <>`__
that governs intellectual property.


TC Open Repository `Maintainers <>`__
are responsible for oversight of this project's community development
activities, including evaluation of GitHub
`pull requests <>`__
and `preserving <>`__
open source principles of openness and fairness. Maintainers are recognized
and trusted experts who serve to implement community goals and consensus design

Initially, the associated TC members have designated one or more persons to
serve as Maintainer(s); subsequently, participating community members may
select additional or substitute Maintainers, per `consensus agreements

.. _currentmaintainers:

**Current Maintainers of this TC Open Repository**

- `Chris Lenk <>`__; GitHub ID:; WWW: `MITRE Corporation <>`__

- `Emmanuelle Vargas-Gonzalez <>`__; GitHub ID:; WWW: `MITRE
Corporation <>`__

- `Jason Keirstead <>`__; GitHub ID:; WWW: `IBM <>`__

About OASIS TC Open Repositories

- `TC Open Repositories: Overview and Resources <>`__
- `Frequently Asked Questions <>`__
- `Open Source Licenses <>`__
- `Contributor License Agreements (CLAs) <>`__
- `Maintainers' Guidelines and Agreement <>`__


Questions or comments about this TC Open Repository's activities should be
composed as GitHub issues or comments. If use of an issue/comment is not
possible or appropriate, questions may be directed by email to the
Maintainer(s) `listed above <#currentmaintainers>`__. Please send general
questions about TC Open Repository participation to OASIS Staff at and any specific CLA-related questions

.. |Build_Status| image::
:alt: Build Status
.. |Coverage| image::
:alt: Coverage
.. |Version| image::
:alt: Version
.. |Downloads_Badge| image::
:alt: Downloads
.. |Documentation_Status| image::
:alt: Documentation Status