DeepL translation plugin for Sopel IRC bots.
Project description
sopel-deepl
DeepL translation plugin for Sopel IRC bots.
Installation
This plugin is released on PyPI, so it's easy to install using pip:
pip install sopel-deepl
Sopel loads all available plugins by default. If you have changed your bot to
the "enabled only" mode, edit your config file to enable
the deepl plugin or run sopel-plugins enable deepl in your terminal.
Usage
.deepl [text to translate]
# Totally-not-contrived example
<dgw> .deepl Dormez-vous?
<Sopel> [DeepL] "Are you asleep?" (FR 🡒 EN-US)
The target language can be configured globally, with overrides at the channel and user levels via IRC commands; see below.
Configuring global settings
The easiest way to configure this plugin is using Sopel's built-in wizard: In
your terminal, run sopel-plugins configure deepl and follow the prompts.
These settings are also configurable by editing the [deepl] section of your
bot's config file manually, if you choose.
[deepl]
auth_key = your_DeepL_API_key # required
default_target = FR # optional; defaults to EN-US
Refer to DeepL's list of supported target languages when
choosing a value for default_target.
Configuring user settings
# set to French
.deeplang FR
# clear user preference
.deeplang -
Users can set their preferred target language for translations using the
.deeplang command. See DeepL's supported target languages.
The special value - clears this setting.
Configuring channel settings
# set to French
.deepclang FR
# clear channel setting
.deepclang -
Channel operators and higher can set a channel's default target language,
overriding the bot's global default, using the .deepclang command. See
DeepL's list of supported target languages.
The special value - clears this setting.
Limitations
In some cases, it might be useful to pass a source-language hint along with the
input text. DeepL's language detection is fairly good when given well-formed
source material, but it can make wild incorrect guesses on "wrong" usage. (For
example, passing the earlier Dormez-vous? example without the hyphen yielded a
guessed source language of Hungarian instead of French during testing.)
sopel-deepl doesn't support such a feature yet, but it's on the radar.
Changelog
0.2.0
Added:
- Bot-level default target language setting (#3)
English is no longer the only supported translation target! 🎉 - User & channel preferences for target language (#3)
These are configured through IRC commands; see README.
Changed:
- Require Sopel 8.0+; Sopel 7.x and Python <= 3.7 are no longer supported (#1)
- Use first-party
deepllibrary instead of unofficialdeepl-api(#5)
Meta:
- Filled out README documentation (#5)
- Converted to
pyproject.tomlpackage with future-proofing (#1) - Miscellaneous code style tweaks & modernization
0.1.0
First release of sopel-deepl with basic translate-to-English functionality.
Project details
Release history Release notifications | RSS feed
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 sopel_deepl-0.2.0.tar.gz.
File metadata
- Download URL: sopel_deepl-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1248a8b15695ca024745055a2e3d9a6a74532f73e8cdabaf2c17051d68d30922
|
|
| MD5 |
473d5366c8d0a9acf2613b221731058e
|
|
| BLAKE2b-256 |
bdb1ded167cbe5cd4cd4021b6ce19590c582c68a60d75b32b551a12b14e43737
|
Provenance
The following attestation bundles were made for sopel_deepl-0.2.0.tar.gz:
Publisher:
pypi.yml on dgw/sopel-deepl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sopel_deepl-0.2.0.tar.gz -
Subject digest:
1248a8b15695ca024745055a2e3d9a6a74532f73e8cdabaf2c17051d68d30922 - Sigstore transparency entry: 258220378
- Sigstore integration time:
-
Permalink:
dgw/sopel-deepl@94874474838bd7db54c93f72761c3d8d1e3889bb -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dgw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@94874474838bd7db54c93f72761c3d8d1e3889bb -
Trigger Event:
release
-
Statement type:
File details
Details for the file sopel_deepl-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sopel_deepl-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a23cb5eb8047f29a67146a47f935bebfbcb61c931b03823a13d4a375d77f092
|
|
| MD5 |
1b0fa6df03acc33242873be5787a14e5
|
|
| BLAKE2b-256 |
8c3cd7a921e82813fde3363fb5a11d035e8681dbc887a017435fa3d2978b81c7
|
Provenance
The following attestation bundles were made for sopel_deepl-0.2.0-py3-none-any.whl:
Publisher:
pypi.yml on dgw/sopel-deepl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sopel_deepl-0.2.0-py3-none-any.whl -
Subject digest:
3a23cb5eb8047f29a67146a47f935bebfbcb61c931b03823a13d4a375d77f092 - Sigstore transparency entry: 258220402
- Sigstore integration time:
-
Permalink:
dgw/sopel-deepl@94874474838bd7db54c93f72761c3d8d1e3889bb -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dgw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@94874474838bd7db54c93f72761c3d8d1e3889bb -
Trigger Event:
release
-
Statement type: