Warning

This documentation is still a work in progress. If you have any issues or questions, please ask on the stix-discussion mailing list or file a bug in our issue tracker.

stix.utils.idgen Module

Classes

class stix.utils.idgen.IDGenerator(namespace=None, method=1)

Bases: object

Utility class for generating STIX ids

create_id(prefix='guid')

Create an ID.

Note that if prefix is not provided, it will be quid, even if the method is METHOD_INT.

class stix.utils.idgen.InvalidMethodError(method)

Bases: exceptions.ValueError

Functions

stix.utils.idgen._get_generator()

Return the stix.utils module’s generator object.

Only under rare circumstances should this function be called by external code. More likely, external code should initialize its own IDGenerator or use the set_id_namespace, set_id_method, or create_id functions of the stix.utils module.

stix.utils.idgen.set_id_namespace(namespace)

Set the namespace for the module-level ID Generator

stix.utils.idgen.set_id_method(method)

Set the method for the module-level ID Generator

stix.utils.idgen.get_id_namespace()

Return the namespace associated with generated ids

stix.utils.idgen.get_id_namespace_alias()

Returns the namespace alias assoicated with generated ids

stix.utils.idgen.create_id(prefix=None)

Create an ID using the module-level ID Generator

Constants

stix.utils.idgen.__generator = None
stix.utils.idgen.EXAMPLE_NAMESPACE = {'http://example.com': 'example'}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)

Table Of Contents

Previous topic

stix.utils.dates Module

Next topic

stix.utils.nsparser Module

This Page

Related Documentation