Skip to main content

Convert AutoKey phrase entries to Espanso YAML format

Project description

autokey2espanso

Convert AutoKey phrase entries into Espanso YAML configuration.

Why?

If you are migrating from AutoKey to Espanso, this tool converts your existing phrase entries automatically.

It reads matching .json and .txt pairs and generates a valid Espanso matches: configuration.


Requirements

  • Python 3.8+

Installation

Clone the repository:

git clone https://github.com/johannjdk/autokey2espanso.git
cd autokey2espanso
pip install .

Or run directly:

python3 autokey2espanso/cli.py <directory>

Usage

Basic usage (prints YAML to stdout):

autokey2espanso /path/to/autokey/phrases

Write output to file:

autokey2espanso /path/to/autokey/phrases -o espanso.yml

Verbose mode:

autokey2espanso /path/to/autokey/phrases -o espanso.yml -v

Word mode (-w / --wordmode):

autokey2espanso /path/to/autokey/phrases -o espanso.yml -w

Custom prefix (-p / --prefix):

autokey2espanso /path/to/autokey/phrases -p ":" -o espanso.yml

When enabled, the prefix will be added before each trigger. If omitted, triggers are taken 1:1 from AutoKey.

When word mode is enabled, each entry will include:

word: true

This is useful for triggers that should only match entire words in Espanso.


How it works

For each entry, both files must exist:

Example.json
Example.txt

The first abbreviation inside the JSON file becomes the Espanso trigger. With optional prefix:

"abbreviations": ["hello"]

Becomes with -p ":":

matches:
  - trigger: ":hello"
    replace: |
      Hello World!

Or 1:1 (no prefix):

matches:
  - trigger: "hello"
    replace: |
      Hello World!

If word mode is enabled:

matches:
  - trigger: ":hello"
    word: true
    replace: |
      Hello World!

License

MIT

Project details


Download files

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

Source Distribution

autokey2espanso-1.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

autokey2espanso-1.0.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file autokey2espanso-1.0.2.tar.gz.

File metadata

  • Download URL: autokey2espanso-1.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autokey2espanso-1.0.2.tar.gz
Algorithm Hash digest
SHA256 6229b84c267e5c4b7d6e0b2318a1e11e1ba581d7cfed52076fd58de83c949cef
MD5 df19c4f40f476a421fd2ecd3996a9997
BLAKE2b-256 fad890274728ba2b09bb57778856493b1849e429264d6dd32ad94c7fedc18d68

See more details on using hashes here.

Provenance

The following attestation bundles were made for autokey2espanso-1.0.2.tar.gz:

Publisher: python-publish.yml on johannjdk/autokey2espanso

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autokey2espanso-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for autokey2espanso-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c65c334d446c846078c397da4e358b0565ddcdccb72b1695ee000fe8d4f8388
MD5 f08596f7243acf34fe2c45b660dd694c
BLAKE2b-256 811e290bbbd7886c28ef131c01917222dd5c7c4a7e62e93dc3da337bb88ddea8

See more details on using hashes here.

Provenance

The following attestation bundles were made for autokey2espanso-1.0.2-py3-none-any.whl:

Publisher: python-publish.yml on johannjdk/autokey2espanso

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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