Skip to main content
Made with pop, a Python implementation of Plugin Oriented Programming Made with idem, a Python implementation of Plugin Oriented Programming Documentation is published with Sphinx on docs.idemproject.io Made with Python

idem-ai extends idem with translation capabilities from the pop-ml plugin, enabling multilingual support in infrastructure management workflows.

About

idem-ai extends idem, a powerful infrastructure and configuration management tool, by adding translation capabilities from the pop-ml plugin. With idem-ai, you can enable multilingual support in your infrastructure management workflows.

By integrating idem-ai into your idem environment, you gain access to additional contracts and features that enable translation in various aspects of idem. The added contracts from idem-ai provide translation capabilities for logs, state comments, and rend output. This means you can translate log messages, comments within your states, and the rendered output of commands to facilitate communication in multiple languages.

idem-ai also introduces an ml.translate exec module, which allows you to perform on-the-fly translations using pop-ml. This module can be used within Jinja in SLS or invoked directly on the command line, giving you flexibility in translating text in your idem environment.

With idem-ai, you can effortlessly manage multilingual environments, ensuring clear and consistent communication across language barriers in your infrastructure management workflows.

What is POP?

This project is built with pop, a Python-based implementation of Plugin Oriented Programming (POP). POP seeks to bring together concepts and wisdom from the history of computing in new ways to solve modern computing problems.

For more information:

Getting Started

Prerequisites

  • Python 3.8+

  • git (if installing from source, or contributing to the project)

Installation

If wanting to use idem-ai, you can do so by either installing from PyPI or from source.

Install from PyPI

pip install idem-ai

Install from source

# clone repo
git clone git@gitlab.com/vmware/idem/idem-ai.git
cd idem-ai

# Setup venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

To use idem-ai, you need to create a YAML configuration file that defines the behavior of the translation.

Here’s an example YAML configuration file:

idem:
  translate_output: False
  translate_comments: False
  translate_docs: False
  translate_logs: False
pop_ml:
  source_lang: en
  dest_lang: es

This configuration file contains various options that control the translation behavior:

  • translate_output: If set to True, the output of the execution will be translated. Default is False.

  • translate_comments: If set to True, the comments of states and exec moduleswill be translated. Default is False.

  • translate_logs: If set to True, the log messages will be translated. Default is False.

  • dest_lang: The destination language for translation. Default is “es”.

  • source_lang: The source language for translation. Default is “en”.

The dest_lang parameter is required for the translation to work. It should be a two-letter language code.

You can modify these options based on your requirements.

Examples

Here are some example commands that demonstrate the usage of idem-ai:

Translate a text using the ml.translate exec module:

idem exec ml.translate "Hello World!" dest_lang=es

Translate logs using the –translate-logs option:

idem -c my_config.cfg exec test.ping --translate-logs --log-level=debug

In this example, the –translate-logs option enables the translation of logs with pop-ml. This will translate the log messages into the specified destination language.

Translate state comments using the –translate-state-comments option:

idem -c my_config.cfg state my_state.sls --translate-state-comments

In this example, the –translate-state-comments option enables the translation of state comments. This will translate the comments from state output from the run into the specified destination language.

Translate rend output using the –translate-output option:

idem -c my_config.cfg exec test.ping --translate-output

In this example, the –translate-output option enables the translation of rend output for a doc subcommand. However, please note that enabling this option may cause unpredictable behavior for CLI programs. It is recommended to use it with caution.

Translate docstrings from idem doc using the –translate-docs option:

idem -c my_config.cfg doc exec.test.ping --translate-docs

In this example, the –translate-docs option enables the translation of docs for the exec.test.ping command. This will translate the documentation associated with the specified command into the specified destination language without translating keys, paths, refs, and other values unrelated to docs.

Roadmap

Reference the open issues for a list of proposed features (and known issues).

Acknowledgements

Metadata

Release files for idem-ai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idem-ai 0.1.0
File Size Uploaded
idem-ai-0.1.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idem-ai 0.1.0
File Interpreter ABI Platform
idem_ai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / idem-ai-0.1.0.tar.gz

Download URL idem-ai-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ef7d0bf63d9d6aa3da4d4c9628f24541abae57f7e1802e3898d36ad81191a3f9
BLAKE2b-256 checksum
How to use checksums
3d41653e291619423fc40457b299b9de7951eeaf8566fd2fab1c08c7600474cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.30.0 requests-toolbelt/1.0.0 urllib3/2.0.2 tqdm/4.65.0 importlib-metadata/6.6.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

Release files / idem_ai-0.1.0-py3-none-any.whl

Download URL idem_ai-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43f17d399dda80e400a71ede585587e18798451c9697324e686c33a458132b09
BLAKE2b-256 checksum
How to use checksums
d9703905615a73c2ecf9113a8c80c68e8df7c46a55230b144d54bd79d8ea53ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.30.0 requests-toolbelt/1.0.0 urllib3/2.0.2 tqdm/4.65.0 importlib-metadata/6.6.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page