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-pand 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-sand-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
FakeBusandFakeMessagestand in for during testing. - OpenVoiceOS/ovos-config. Reads and writes
mycroft.conf, the configuration file used byLOG,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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovos_utils-0.13.10a1.tar.gz.
File metadata
- Download URL: ovos_utils-0.13.10a1.tar.gz
- Upload date:
- Size: 82.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2832118cb5b67d0a7a1e7ebb1d739602e5205bfb5336be9fc098f4b61ae800e
|
|
| MD5 |
af336a27fcdfcd5b68c49a5a38c0a6a4
|
|
| BLAKE2b-256 |
0dc2029d81d3fcbc1ca41c451495eab561d9981b192c20b59ede508a7dc935af
|
File details
Details for the file ovos_utils-0.13.10a1-py3-none-any.whl.
File metadata
- Download URL: ovos_utils-0.13.10a1-py3-none-any.whl
- Upload date:
- Size: 92.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c3871a10a52afdebcaa606e11f94aa5cf84bd3e6d522cb4a444d2ebcb09157f
|
|
| MD5 |
0769a799454b1d00b31fa40d0b1808d8
|
|
| BLAKE2b-256 |
aaaef8cc5880a6aab93cdd15933da188154318bd8fa69c280e2cb5e3dfa83f4c
|