diff --git a/stix2/__init__.py b/stix2/__init__.py index d6de92b..b876adb 100644 --- a/stix2/__init__.py +++ b/stix2/__init__.py @@ -3,6 +3,7 @@ .. autosummary:: :toctree: api + confidence core datastore environment @@ -10,26 +11,19 @@ markings patterns properties - sources utils - patterns - properties - utils - workbench + v20.bundle v20.common v20.observables v20.sdo v20.sro + v21.bundle v21.common v21.observables v21.sdo v21.sro + workbench - The .v21 import can't be relocated, or we get circular import problems. - The 'isort:skip' line comment didn't work to skip only that one problematic - import. The only thing that did was telling it to skip the whole file. - - isort:skip_file """ # flake8: noqa diff --git a/stix2/base.py b/stix2/base.py index db17a62..73afe47 100644 --- a/stix2/base.py +++ b/stix2/base.py @@ -1,4 +1,4 @@ -"""Base classes for type definitions in the stix2 library.""" +"""Base classes for type definitions in the STIX2 library.""" import collections import copy diff --git a/stix2/confidence/__init__.py b/stix2/confidence/__init__.py index da6e3a7..80e0dc7 100644 --- a/stix2/confidence/__init__.py +++ b/stix2/confidence/__init__.py @@ -5,5 +5,6 @@ Functions to operate with STIX2 Confidence scales. :toctree: confidence scales + | """ diff --git a/stix2/core.py b/stix2/core.py index 86ef68c..96ce2ec 100644 --- a/stix2/core.py +++ b/stix2/core.py @@ -1,3 +1,5 @@ +"""STIX2 Core Objects and Methods.""" + import copy import importlib import pkgutil diff --git a/stix2/datastore/__init__.py b/stix2/datastore/__init__.py index 376afc3..01bfc04 100644 --- a/stix2/datastore/__init__.py +++ b/stix2/datastore/__init__.py @@ -1,4 +1,5 @@ -"""Python STIX 2.0 DataStore API. +""" +Python STIX2 DataStore API. .. autosummary:: :toctree: datastore diff --git a/stix2/datastore/filesystem.py b/stix2/datastore/filesystem.py index 3f72c90..f9315d5 100644 --- a/stix2/datastore/filesystem.py +++ b/stix2/datastore/filesystem.py @@ -1,4 +1,4 @@ -"""Python STIX 2.0 FileSystem Source/Sink""" +"""Python STIX2 FileSystem Source/Sink""" import io import json diff --git a/stix2/datastore/filters.py b/stix2/datastore/filters.py index 261d0ad..ddd43fe 100644 --- a/stix2/datastore/filters.py +++ b/stix2/datastore/filters.py @@ -1,4 +1,4 @@ -"""Filters for Python STIX 2.0 DataSources, DataSinks, DataStores""" +"""Filters for Python STIX2 DataSources, DataSinks, DataStores""" import collections from datetime import datetime diff --git a/stix2/datastore/memory.py b/stix2/datastore/memory.py index eb3c2b5..a838703 100644 --- a/stix2/datastore/memory.py +++ b/stix2/datastore/memory.py @@ -1,6 +1,4 @@ -""" -Python STIX 2.0 Memory Source/Sink -""" +"""Python STIX2 Memory Source/Sink""" import io import itertools diff --git a/stix2/datastore/taxii.py b/stix2/datastore/taxii.py index a4353e3..f55c5c0 100644 --- a/stix2/datastore/taxii.py +++ b/stix2/datastore/taxii.py @@ -1,4 +1,5 @@ -"""Python STIX 2.x TAXIICollectionStore""" +"""Python STIX2 TAXIICollection Source/Sink""" + from requests.exceptions import HTTPError from stix2 import v20, v21 diff --git a/stix2/environment.py b/stix2/environment.py index 78c1492..104fdb2 100644 --- a/stix2/environment.py +++ b/stix2/environment.py @@ -1,5 +1,4 @@ -"""Python STIX 2.0 Environment API. -""" +"""Python STIX2 Environment API.""" import copy @@ -177,9 +176,9 @@ class Environment(DataStoreMixin): up. Returns: - The STIX object's creator, or - None, if the object contains no `created_by_ref` property or the - object's creator cannot be found. + str: The STIX object's creator, or None, if the object contains no + `created_by_ref` property or the object's creator cannot be + found. """ creator_id = obj.get('created_by_ref', '') diff --git a/stix2/exceptions.py b/stix2/exceptions.py index 172cc69..231eeb6 100644 --- a/stix2/exceptions.py +++ b/stix2/exceptions.py @@ -1,5 +1,4 @@ -"""STIX 2 error classes. -""" +"""STIX2 Error Classes.""" class STIXError(Exception): diff --git a/stix2/markings/__init__.py b/stix2/markings/__init__.py index b8f2c6e..79d1012 100644 --- a/stix2/markings/__init__.py +++ b/stix2/markings/__init__.py @@ -9,7 +9,6 @@ Note: Definitions. The corresponding methods on those classes are identical to these functions except that the `obj` parameter is omitted. - .. autosummary:: :toctree: markings diff --git a/stix2/markings/granular_markings.py b/stix2/markings/granular_markings.py index c8f9fe0..09c3d37 100644 --- a/stix2/markings/granular_markings.py +++ b/stix2/markings/granular_markings.py @@ -1,5 +1,4 @@ -"""Functions for working with STIX 2.0 granular markings. -""" +"""Functions for working with STIX2 granular markings.""" from stix2 import exceptions from stix2.markings import utils diff --git a/stix2/markings/object_markings.py b/stix2/markings/object_markings.py index 53517be..dc85dfa 100644 --- a/stix2/markings/object_markings.py +++ b/stix2/markings/object_markings.py @@ -1,5 +1,4 @@ -"""Functions for working with STIX 2.0 object markings. -""" +"""Functions for working with STIX2 object markings.""" from stix2 import exceptions from stix2.markings import utils diff --git a/stix2/markings/utils.py b/stix2/markings/utils.py index 77f57bb..4b4841c 100644 --- a/stix2/markings/utils.py +++ b/stix2/markings/utils.py @@ -1,5 +1,4 @@ -"""Utility functions for STIX 2.0 data markings. -""" +"""Utility functions for STIX2 data markings.""" import collections diff --git a/stix2/patterns.py b/stix2/patterns.py index 6d5ce57..59528bd 100644 --- a/stix2/patterns.py +++ b/stix2/patterns.py @@ -1,5 +1,4 @@ -"""Classes to aid in working with the STIX 2 patterning language. -""" +"""Classes to aid in working with the STIX 2 patterning language.""" import base64 import binascii diff --git a/stix2/properties.py b/stix2/properties.py index 3a14cff..24549aa 100644 --- a/stix2/properties.py +++ b/stix2/properties.py @@ -1,5 +1,5 @@ -"""Classes for representing properties of STIX Objects and Cyber Observables. -""" +"""Classes for representing properties of STIX Objects and Cyber Observables.""" + import base64 import binascii import collections diff --git a/stix2/utils.py b/stix2/utils.py index fab8a2d..6bdf144 100644 --- a/stix2/utils.py +++ b/stix2/utils.py @@ -1,4 +1,5 @@ -"""Utility functions and classes for the stix2 library.""" +"""Utility functions and classes for the STIX2 library.""" + from collections import Mapping import copy import datetime as dt diff --git a/stix2/v20/__init__.py b/stix2/v20/__init__.py index 44c06c4..bef7d66 100644 --- a/stix2/v20/__init__.py +++ b/stix2/v20/__init__.py @@ -1,3 +1,4 @@ +"""STIX 2.0 API Objects.""" # flake8: noqa diff --git a/stix2/v20/bundle.py b/stix2/v20/bundle.py index f096b2c..76386ef 100644 --- a/stix2/v20/bundle.py +++ b/stix2/v20/bundle.py @@ -1,3 +1,5 @@ +"""STIX 2.0 Bundle Representation.""" + from collections import OrderedDict from ..base import _STIXBase diff --git a/stix2/v20/common.py b/stix2/v20/common.py index c57e0c9..afd7812 100644 --- a/stix2/v20/common.py +++ b/stix2/v20/common.py @@ -1,4 +1,4 @@ -"""STIX 2 Common Data Types and Properties.""" +"""STIX 2.0 Common Data Types and Properties.""" from collections import OrderedDict import copy diff --git a/stix2/v20/sdo.py b/stix2/v20/sdo.py index 3fcfed0..cd99e69 100644 --- a/stix2/v20/sdo.py +++ b/stix2/v20/sdo.py @@ -1,5 +1,4 @@ -"""STIX 2.0 Domain Objects. -""" +"""STIX 2.0 Domain Objects.""" from collections import OrderedDict import itertools diff --git a/stix2/v21/__init__.py b/stix2/v21/__init__.py index 9101e7e..4a8fe29 100644 --- a/stix2/v21/__init__.py +++ b/stix2/v21/__init__.py @@ -1,3 +1,4 @@ +"""STIX 2.1 API Objects.""" # flake8: noqa diff --git a/stix2/v21/bundle.py b/stix2/v21/bundle.py index aba81d5..c9e083a 100644 --- a/stix2/v21/bundle.py +++ b/stix2/v21/bundle.py @@ -1,3 +1,5 @@ +"""STIX 2.1 Bundle Representation.""" + from collections import OrderedDict from ..base import _STIXBase diff --git a/stix2/v21/sdo.py b/stix2/v21/sdo.py index 144e6a0..37699a6 100644 --- a/stix2/v21/sdo.py +++ b/stix2/v21/sdo.py @@ -1,4 +1,4 @@ -"""STIX 2.1 Domain Objects""" +"""STIX 2.1 Domain Objects.""" from collections import OrderedDict import itertools diff --git a/stix2/workbench.py b/stix2/workbench.py index 4e1ece1..e621073 100644 --- a/stix2/workbench.py +++ b/stix2/workbench.py @@ -1,4 +1,4 @@ -"""Functions and class wrappers for interacting with STIX data at a high level. +"""Functions and class wrappers for interacting with STIX2 data at a high level. .. autofunction:: create .. autofunction:: set_default_creator