API

situation

situation.dump()[source]

Build a dictionary containing the entire Situation.

Returns:a Dict with the situation as nested Dictionaries.
situation.save(filename)[source]

Write the Situation to a JSON file.

Parameters:filename (str) – the name of the file to output to.
situation.id_generator(size=8, chars=None)[source]

Create a random sequence of letters and numbers.

Parameters:
  • size (int) – the desired length of the sequence
  • chars (str) – the eligible character set to draw from when picking random characters
Returns:

a string with the random sequence

Resource

class situation.Resource(unique, name, url, publisher, author[, description])[source]

A Resource is an authoritative information source from which evidence is drawn.

Usually, a Resource is an artifact like a newspaper article, a report, or another document. These documents usually have an associated URL.

Any time an Excerpt is used, that Excerpt must be directly quotable from a Resource.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • name (str) – what the resource is called
  • url (str) – the canonical URL for the resource
  • publisher (str) – the name of the institution reputationally backing this resource
  • author (str) – the name of the author(s)
  • description (str) – a short summary of this resource

Excerpt

class situation.Excerpt(unique, content, resource_id[, xpath])[source]

Description.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • content (str) – the actual quoted material of the excerpt
  • resource (Resource) – the Resource from which this excerpt comes
  • xpath (str) – the xpath leading to this excerpt within the Resource

Person

class situation.Person(name, unique, alias, slug[, excerpts, events, places, possessions, properties, groups, acquaintances])[source]

Description.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • name (str) – what the person is called
  • alias (str) – that other thing the person is called
  • slug (str) – a URL-friendly identifier
  • excerpts ([Excerpt]) – null
  • events ([Event]) – null
  • places ([Place]) – null
  • possessions ([Item]) – null
  • properties ([Place]) – null
  • groups ([Group]) – null
  • acquaintances ([Acquaintance]) – null

Acquaintance

class situation.Acquaintance(isa, excerpts, person, acquainted)[source]

Description.

Parameters:id (int) – the database object identifier

:param int : :param int : :param int : :param int : :param int :

Place

class situation.Place(**kwargs)[source]

Description.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • name (str) – what the place is called

:param int : :param int : :param int : :param int : :param int : :param int :

Item

class situation.Item(unique, name, slug, excerpts, owners[, description])[source]

Description.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • name (str) – what the item is called

:param int : :param int : :param int :

Group

class situation.Group(**kwargs)[source]

Description.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • name (str) – what the group is called

:param int : :param int :

Event

class situation.Event(**kwargs)[source]

Description.

Parameters:
  • id (int) – the database object identifier
  • unique (str) – alpha-numeric code for shorthand identifier
  • name (str) – what the event is called

:param int : :param int : :param int : :param int : :param int : :param int : :param int :