TikTokPrinter.client.engines package

Submodules

TikTokPrinter.client.engines.console module

Copyright (C) Isaac Kogan, Inc - All Rights Reserved Unauthorized copying of this project, via any medium is strictly prohibited Proprietary work of Isaac Kogan Written by Isaac Kogan <isaacikogan@gmail.com>, April 2022

You are permitted to use this project commercially so long as it was purchased firsthand from Isaac Kogan. Distributing secondhand copies to others is strictly prohibited & is illegal.

You can do anything with this project except redistribute it.

class TikTokPrinter.client.engines.console.Console

Bases: object

Dummy Console Printer

classmethod image(img_source: <module 'PIL.Image' from 'c:\\users\\jeanm\\pycharmprojects\\printertwo\\venv\\lib\\site-packages\\PIL\\Image.py'>)

Print an image (show image)

Parameters

img_source – PIL Image

Returns

None

classmethod set(*args, **kwargs)

Dummy method for setting formatting- not possible in console.

Parameters
  • args – Ignored

  • kwargs – Ignored

Returns

None

classmethod text(txt: str)

Print text to the console

Parameters

txt – Text to the print

Returns

None

TikTokPrinter.client.engines.escpos module

Copyright (C) Isaac Kogan, Inc - All Rights Reserved Unauthorized copying of this project, via any medium is strictly prohibited Proprietary work of Isaac Kogan Written by Isaac Kogan <isaacikogan@gmail.com>, April 2022

You are permitted to use this project commercially so long as it was purchased firsthand from Isaac Kogan. Distributing secondhand copies to others is strictly prohibited & is illegal.

You can do anything with this project except redistribute it.

class TikTokPrinter.client.engines.escpos.EscposEngine(engine: Union[escpos.printer.Usb, escpos.printer.Serial, escpos.printer.Network, TikTokPrinter.client.engines.console.Console], **kwargs)

Bases: object

Escpos Engine for Thermal Printing

class TikTokPrinter.client.engines.escpos.EscposEngineGenerator

Bases: object

Static Class: Generator for the EscposEngine class

classmethod create_console(**kwargs) → TikTokPrinter.client.engines.escpos.EscposEngine

Create a dummy Console printer

Parameters

kwargs – Mostly ignored

Returns

Initialized Escpos Engine with Console Printer

classmethod create_network(host: str, port: int = 9100, timeout: int = 60, *args, **kwargs) → TikTokPrinter.client.engines.escpos.EscposEngine

For more information on kwargs, visit https://python-escpos.readthedocs.io/en/latest/.

Parameters
  • host – Hostname of the printer

  • port – Port of the printer

  • timeout – Printer command timeout

  • args – Extra arguments

  • kwargs – Formatting arguments & extra printer arguments

Returns

Initialized Escpos Engine with Network Printer

Raises

MissingPrinterDriver

classmethod create_serial(devfile: str = '/dev/ttyS0', baudrate: int = 9600, bytesize: int = 8, timeout: int = 1, parity: <module 'serial' from 'c:\\users\\jeanm\\pycharmprojects\\printertwo\\venv\\lib\\site-packages\\serial\\__init__.py'> = 'N', stopbits: <module 'serial' from 'c:\\users\\jeanm\\pycharmprojects\\printertwo\\venv\\lib\\site-packages\\serial\\__init__.py'> = 1, xonxoff: bool = False, dsrdtr: bool = True, *args, **kwargs) → TikTokPrinter.client.engines.escpos.EscposEngine

Initialize the EscposEngine with a Serial Printer.

For more information on kwargs, visit https://python-escpos.readthedocs.io/en/latest/.

Parameters
  • devfile – devfile

  • baudrate – baudrate

  • bytesize – bytesize

  • timeout – Timeout for printer commands

  • parity – parity

  • stopbits – stopbits

  • xonxoff – xonxoff

  • dsrdtr – dsrdtr

  • args – Extra arguments

  • kwargs – Formatting arguments & extra printer arguments

Returns

Initialized Escpos Engine with Serial Printer

Raises

MissingPrinterDriver

classmethod create_usb(vendor_id: hex = 1, product_id: hex = 1, auto_find: bool = True, timeout: int = 1000, in_ep_override: Optional[hex] = None, out_ep_override: Optional[hex] = None, *args, **kwargs) → TikTokPrinter.client.engines.escpos.EscposEngine

Initialize the EscposEngine with a USB Printer.

To find the Vendor ID & Product ID of your printer, download USBDeview and find your device.

For more information on kwargs, visit https://python-escpos.readthedocs.io/en/latest/.

If you receive the Invalid Endpoint address error, pass the following in for a custom in_ep and out_ep: in_ep: hex = 0x81, out_ep: hex = 0x03. That might fix it.

Parameters
  • auto_find – Automatically detect & select from a list of USB devices

  • vendor_id – Vendor ID of the printer

  • product_id – Product ID of the printer

  • timeout – Timeout for printer commands

  • in_ep_override – Override the auto-found in_ep value with a custom one

  • out_ep_override – Override the auto-found out_ep value with a custom one

  • args – Extra arguments

  • kwargs – Formatting arguments & extra printer arguments

Returns

Initialized Escpos Engine with USB Printer

Raises

MissingPrinterDriver

TikTokPrinter.client.engines.sound module

Copyright (C) Isaac Kogan, Inc - All Rights Reserved Unauthorized copying of this project, via any medium is strictly prohibited Proprietary work of Isaac Kogan Written by Isaac Kogan <isaacikogan@gmail.com>, April 2022

You are permitted to use this project commercially so long as it was purchased firsthand from Isaac Kogan. Distributing secondhand copies to others is strictly prohibited & is illegal.

You can do anything with this project except redistribute it.

class TikTokPrinter.client.engines.sound.SoundEngine(loop: asyncio.events.AbstractEventLoop)

Bases: object

Sound engine for playing sounds

play(file_path: str) → Awaitable

Play a song at a given file path

Parameters

file_path – Path to play file

Returns

None

TikTokPrinter.client.engines.voice module

Copyright (C) Isaac Kogan, Inc - All Rights Reserved Unauthorized copying of this project, via any medium is strictly prohibited Proprietary work of Isaac Kogan Written by Isaac Kogan <isaacikogan@gmail.com>, April 2022

You are permitted to use this project commercially so long as it was purchased firsthand from Isaac Kogan. Distributing secondhand copies to others is strictly prohibited & is illegal.

You can do anything with this project except redistribute it.

class TikTokPrinter.client.engines.voice.VoiceEngine(loop: asyncio.events.AbstractEventLoop)

Bases: object

VoiceEngine for text-to-speech

QUEUE_INTERVAL: float = 0.1

How long to wait between voice messages

speak(text: str) → None

Speak a text message with a given string

Parameters

text – The utterance to speak

Returns

None

start() → None

Start the voice engine’s queue loop

Returns

None

stop() → None

Stop the voice engine’s queue loop

Returns

None

Module contents

Copyright (C) Isaac Kogan, Inc - All Rights Reserved Unauthorized copying of this project, via any medium is strictly prohibited Proprietary work of Isaac Kogan Written by Isaac Kogan <isaacikogan@gmail.com>, April 2022

You are permitted to use this project commercially so long as it was purchased firsthand from Isaac Kogan. Distributing secondhand copies to others is strictly prohibited & is illegal.

You can do anything with this project except redistribute it.