openconvert module

OpenConvert CLI Tool

A command-line interface for connecting to the OpenConvert OpenAgents network to discover file conversion services and perform file conversions.

openconvert.convert(input_files, output_path, host='network.openconvert.ai', port=8765)[source]

Convert files using the OpenConvert network.

Parameters:
  • input_files (List[Path]) – List of input file paths to convert

  • output_path (Path) – Output file path

  • host (str) – OpenConvert network host (default: network.openconvert.ai)

  • port (int) – OpenConvert network port (default: 8765)

Returns:

True if conversion successful, False otherwise

Return type:

bool

openconvert.convert_file(input_path, output_path, host='network.openconvert.ai', port=8765)[source]

Convert a single file using the OpenConvert network.

Parameters:
  • input_path (str) – Path to input file

  • output_path (str) – Path for output file

  • host (str) – OpenConvert network host (default: network.openconvert.ai)

  • port (int) – OpenConvert network port (default: 8765)

Returns:

True if conversion successful, False otherwise

Return type:

bool

Example

>>> from openconvert import convert_file
>>> success = convert_file("document.txt", "document.pdf")
>>> if success:
...     print("Conversion completed!")

Main Functions

convert_file

openconvert.convert_file(input_path, output_path, host='network.openconvert.ai', port=8765)[source]

Convert a single file using the OpenConvert network.

Parameters:
  • input_path (str) – Path to input file

  • output_path (str) – Path for output file

  • host (str) – OpenConvert network host (default: network.openconvert.ai)

  • port (int) – OpenConvert network port (default: 8765)

Returns:

True if conversion successful, False otherwise

Return type:

bool

Example

>>> from openconvert import convert_file
>>> success = convert_file("document.txt", "document.pdf")
>>> if success:
...     print("Conversion completed!")

convert

openconvert.convert(input_files, output_path, host='network.openconvert.ai', port=8765)[source]

Convert files using the OpenConvert network.

Parameters:
  • input_files (List[Path]) – List of input file paths to convert

  • output_path (Path) – Output file path

  • host (str) – OpenConvert network host (default: network.openconvert.ai)

  • port (int) – OpenConvert network port (default: 8765)

Returns:

True if conversion successful, False otherwise

Return type:

bool

Module Information

openconvert.__version__ = '1.1.1'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

openconvert.__author__ = 'OpenAgents Team'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

openconvert.__email__ = 'team@openagents.com'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.