rhyton.export

Module for exporting data to various formats.

class CsvExporter[source]

Bases: rhyton.export.ExportBase

Exports data to a csv file.

static getListseperator()[source]

Returns the list seperator for the current locale.

static prepFile(file, extension)

Prepares the file path for writing.

Parameters
  • file (str) – The file path.

  • extension (str) – The file extension.

Returns

The file path.

Return type

str

classmethod write(data, file=None)[source]

Writes data to a csv file.

Parameters
  • data (dict) – The data to write.

  • file (str, optional) – The file path. Defaults to None.

Returns

The file path.

Return type

str

class ExportBase[source]

Bases: object

Base class for all exporters.

static prepFile(file, extension)[source]

Prepares the file path for writing.

Parameters
  • file (str) – The file path.

  • extension (str) – The file extension.

Returns

The file path.

Return type

str

class JsonExporter[source]

Bases: rhyton.export.ExportBase

Exports data to a json file.

static append(data, file)[source]

Appends data to a json file.

Parameters
  • data (dict) – The data to append.

  • file (str) – The file path.

Returns

The file path.

Return type

str

static prepFile(file, extension)

Prepares the file path for writing.

Parameters
  • file (str) – The file path.

  • extension (str) – The file extension.

Returns

The file path.

Return type

str

classmethod write(data, file=None)[source]

Writes data to a json file.

Parameters
  • data (dict) – The data to write.

  • file (str, optional) – The file path. Defaults to None.

Returns

The file path.

Return type

str