interregnum.cli package

Command line tool.

interregnum.cli.getparser()

Get argument parser.

Return type:

ArgumentParser

interregnum.cli.main()

CLI main invokation.

Return type:

None

Submodules

interregnum.cli.cmd_calculate module

Allocate seats for an electoral system.

interregnum.cli.cmd_calculate.command(args)

Allocate seats for an electoral system.

Parameters:

args (Namespace)

Return type:

None

interregnum.cli.cmd_calculate.update_parser(parser)

Update parser with this command.

Parameters:

parser (ArgumentParser)

Return type:

ArgumentParser

interregnum.cli.cmd_dump module

Dump an electoral system schema to file.

interregnum.cli.cmd_dump.command(args)

Dump an electoral system schema.

Parameters:

args (Namespace)

Return type:

None

interregnum.cli.cmd_dump.update_parser(parser)

Update parser with this command.

Parameters:

parser (ArgumentParser)

Return type:

ArgumentParser

interregnum.cli.cmd_list module

Enumerate a collection.

interregnum.cli.cmd_list.command(args)

List collections.

Parameters:

args (Namespace)

Return type:

None

interregnum.cli.cmd_list.print_collection(name)

Print collection items to stdout.

Parameters:

name (str)

Return type:

None

interregnum.cli.cmd_list.update_parser(parser)

Update parser with this command.

Parameters:

parser (ArgumentParser)

Return type:

ArgumentParser

interregnum.cli.files module

Files readers and writers.

interregnum.cli.files.normalize_extension(extension)

Normalize extensions.

Parameters:

extension (str)

Return type:

str

interregnum.cli.files.open_electoral_system(filename, cwd, encoding='utf-8')

Open a serialized electoral system.

Supported formats: .json, .yaml, .yml

Parameters:
  • filename (Path)

  • cwd (Path)

  • encoding (str)

Return type:

Node

interregnum.cli.files.read_dict_file(filename, encoding='utf-8', extension=None)

Read structured information from file.

Parameters:
  • filename (Path)

  • encoding (str)

  • extension (str | None)

Return type:

dict[str, Any]

interregnum.cli.files.write_electoral_system(data, filename, decimals, encoding='utf-8', extension=None)

Write an electoral system to file.

Supported formats: .json, .yaml, .yml

Parameters:
  • data (Node)

  • filename (Path)

  • decimals (int | None)

  • encoding (str)

  • extension (str | None)

Return type:

None