Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

OVOS-utils

ovos-utils is a shared utility library for the OpenVoiceOS ecosystem. It provides logging, process lifecycle management, a testing-friendly fake message bus, event scheduling, file utilities, network checks, audio playback, and XDG path helpers. Most OVOS packages, including ovos-bus-client, ovos-config, and ovos-workshop, depend on it, so most projects get it as a transitive dependency.

Install

pip install ovos-utils

Usage

The library exposes many small, independent modules. Import only what you need. For example, use FakeBus to test skill code without a live message bus:

from ovos_utils.fakebus import FakeBus, FakeMessage

bus = FakeBus()

def on_utterance(message):
    print(message.data["utterances"])

bus.on("recognizer_loop:utterance", on_utterance)
bus.emit(FakeMessage("recognizer_loop:utterance", {"utterances": ["hello"]}))

See docs/index.md for the full module overview, with links to detailed pages on logging, process utilities, FakeBus, and event handling.

Command line: ovos-logs

ovos-logs is a helper tool that slices, lists, and reduces OVOS service logs.

  • ovos-logs slice [options]. Slice logs for a time period. The default period runs from the last service start (-s) until now (-u). Pick specific logs with -l (default: all logs). Set the log directory with -p and the output file with -f.

    ovos-logs slice
    # Slice all logs from the last service start until now.
    
    ovos-logs slice -s 17:05:20 -u 17:05:25
    # Slice all logs between 17:05:20 and 17:05:25.
    
    ovos-logs slice -s 17:05:20 -u 17:05:25 -l skills
    # Slice only skills.log between 17:05:20 and 17:05:25.
    
    ovos-logs slice -s 17:05:20 -u 17:05:25 -f ~/testslice.log
    # Slice logs between 17:05:20 and 17:05:25 into ~/testslice.log.
    # Default output file: ~/slice_<timestamp>.log
    
  • ovos-logs list [-e|-w|-d|-x] [options]. List log lines by severity (error, warning, debug, exception). Specify at least one level. You can combine several. Set the time range with -s and -u (default: last service start until now). Pick specific logs with -l (default: all logs).

    ovos-logs list -x
    # List EXCEPTION-level lines (with tracebacks) from the last service start until now.
    
    ovos-logs list -w -e -s 20-12-2023 -l bus -l skills
    # List WARNING and ERROR lines from bus.log and skills.log since 20 December 2023.
    
  • ovos-logs reduce [options]. Shrink logs to a target size in bytes, or remove entries before a given date. Pick specific logs with -l (default: all logs). Set the log directory with -p.

    ovos-logs reduce
    # Shrink all logs to 0 bytes.
    
    ovos-logs reduce -s 1000000
    # Shrink all logs to about 1 MB, keeping the latest entries.
    
    ovos-logs reduce -d "1-12-2023 17:00"
    # Shrink all logs to entries after the given date and time.
    
    ovos-logs reduce -s 1000000 -l skills -l bus
    # Shrink skills.log and bus.log to about 1 MB each.
    
  • ovos-logs show -l <servicelog>. Print the contents of a log file.

    ovos-logs show -l bus
    # Print the contents of bus.log.
    

    The logs shown depend on which log files exist in the log folder.

Related projects

  • OpenVoiceOS/ovos-bus-client. The real message bus client that FakeBus and FakeMessage stand in for during testing.
  • OpenVoiceOS/ovos-config. Reads and writes mycroft.conf, the configuration file used by LOG, PIDLock, and the network utilities.
  • OpenVoiceOS/ovos-workshop. The skill framework built on EventContainer, RuntimeRequirements, and the other utilities in this library.

License

Apache License 2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_utils-0.13.10a2.tar.gz (82.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_utils-0.13.10a2-py3-none-any.whl (92.9 kB view details)

Uploaded Python 3

File details

Details for the file ovos_utils-0.13.10a2.tar.gz.

File metadata

  • Download URL: ovos_utils-0.13.10a2.tar.gz
  • Upload date:
  • Size: 82.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ovos_utils-0.13.10a2.tar.gz
Algorithm Hash digest
SHA256 3e0cb7de9e05524ab59ddda6783755af18fda6472997700c3b5e50ce647887d0
MD5 c27a154c34ca65ccf1455e9ef3451e64
BLAKE2b-256 162f00c84d9f4ad090cfb212e4e43af886cd19b3da4e318d672b1413766c4e9b

See more details on using hashes here.

File details

Details for the file ovos_utils-0.13.10a2-py3-none-any.whl.

File metadata

  • Download URL: ovos_utils-0.13.10a2-py3-none-any.whl
  • Upload date:
  • Size: 92.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ovos_utils-0.13.10a2-py3-none-any.whl
Algorithm Hash digest
SHA256 84c028bdaa6ae950591c8890d24438ae83c29022811c0990b98a603989c6e023
MD5 edd116fc593e6b02ea3ac68eb40fce76
BLAKE2b-256 7895d7b7608f85517e867712e9f23ac4b1b9c99f079d41c6a800b551abf39dec

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.13.10a2 This release

2 files

0.8.5

2 files

0.8.4

2 files

0.8.1

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.1.0

2 files

0.1.0a2

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.35a4

2 files

0.0.35a3

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

1 file

0.0.19

1 file

0.0.18

1 file

0.0.15

1 file

0.0.14

1 file

0.0.14a6

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page