Registry / serialization / stix
library1.2.0.11pypypiunverified

An API for parsing and generating Structured Threat Information Expression (STIX) content. Current version 1.2.0.11 is legacy, based on the older STIX 1.x standard; development has been superseded by stix2 for STIX 2.x. Low release cadence.

pip install stix
INSTALL
IMPORT
SIG · STIX
S
stix
serializationpythonv1.2.0.11
Install
5.5s avg
Import
728ms
Disk
45MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.0.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.460s · 45.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.5s · import 0.414s · 46MB
45MB installed
● package 45MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

STIXPackage
from stix.core import STIXPackage
from stix.core import STIXPackage

Parse a STIX 1.x XML document and access the package title.

from stix.core import STIXPackage from stix.utils import parse_xml import os stix_xml = os.environ.get('STIX_XML', '<stix:STIXPackage xmlns:stix="http://stix.mitre.org/stix-1" id="example:package-1"><stix:STIX_Header><stix:Title>Example</stix:Title></stix:STIX_Header></stix:STIXPackage>') package = parse_xml(stix_xml) print(package.stix_header.title)
Debug
Known issues
gotchastix library is for STIX 1.x only. For STIX 2.x, use the stix2 library. Using stix with STIX 2.x XML will fail.
fix
Install stix2 (`pip install stix2`) and import from stix2.
affects: all
deprecatedThe stix library is no longer actively developed. New features and STIX 2.x support are only in stix2.
fix
Migrate to the stix2 library for STIX 2.x compatibility.
affects: >=1.2
gotchaparse_xml() expects a string, not a file path. Use open().read() or handle file reading separately.
fix
with open('file.xml', 'r') as f: package = parse_xml(f.read())
affects: all
Upgrade
Version history
1.2.0.11latest on PyPI · released Nov 16, 2020
Audit
Dependencies
lxmlrequiredXML parsing and generation for STIX content
python-dateutilrequiredDate/time parsing
cyboxoptionalCybOX objects used within STIX
Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources
stix — pip install stix · libregistry