Initial commit of numbers to words converter in Dutch#218
Initial commit of numbers to words converter in Dutch#218brentgees wants to merge 1 commit intoespanso:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces an Espanso package to convert numeric currency amounts into fully written-out Dutch text (based on zegge.nu).
Changes:
- Added package metadata via
_manifest.yml. - Added Espanso match configuration and an embedded Python converter script in
package.yml. - Added usage and installation documentation in
README.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/number-to-words-nl/0.1.0/README.md | Documents the package purpose, install command, and basic usage. |
| packages/number-to-words-nl/0.1.0/package.yml | Defines the :nr trigger, input form, and Python-based conversion logic. |
| packages/number-to-words-nl/0.1.0/_manifest.yml | Adds Espanso Hub manifest metadata (name/version/tags). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| To install from espanso hub: | ||
|
|
||
| ``` | ||
| espanso install number-to-words |
There was a problem hiding this comment.
The install command uses espanso install number-to-words, but this package’s manifest name/directory is number-to-words-nl, so the command as written won’t install this package from the hub. Update the README to use the correct package name.
| espanso install number-to-words | |
| espanso install number-to-words-nl |
There was a problem hiding this comment.
Or remove the installation instructions entirely - if you look at the Hub entries you'll see these are generated automatically and placed towards the top-right of each package's landing page anyway.
| homepage: "https://github.com/brentgees" | ||
| version: 0.1.0 | ||
| author: Brent Gees, zegge.nu | ||
| tags: ["Dutch", "Numbers", "Converter", "Utility] |
There was a problem hiding this comment.
tags has invalid YAML due to a missing closing quote on Utility (it currently reads "Utility]). This will prevent the manifest from parsing.
| tags: ["Dutch", "Numbers", "Converter", "Utility] | |
| tags: ["Dutch", "Numbers", "Converter", "Utility"] |
| sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') | ||
|
|
||
| getal = '{{form1.getal}}' | ||
|
|
There was a problem hiding this comment.
User-provided form input is interpolated directly into the Python source (getal = '{{form1.getal}}'). If the input contains a single quote/newline it can break the string literal and inject arbitrary Python code. Pass the value as a separate argv argument (or encode via JSON) and read it from sys.argv instead of templating it into the script.
There was a problem hiding this comment.
I'm not overly concerned about this - all data entered is going to come locally from the user. If they want to try and inject arbitrary Python code that's up to them.
| args: | ||
| - python | ||
| - -c | ||
| - | | ||
| # -*- coding: utf-8 -*- | ||
| import sys |
There was a problem hiding this comment.
The Python logic is fairly large to inline under python -c in YAML, which makes it harder to maintain and increases the chance of quoting/templating bugs. Consider moving the converter into a dedicated .py file within the package and invoking it from args (as done in e.g. packages/ask-airia/0.1.0/package.yml:36-38).
| **Number to words NL** is an [Espanso](https://espanso.org/) package that enables you to convert numbers directly to full written currencies from your Espanso extension. | ||
|
|
||
| This is the same functionality as https://www.zegge.nu/ and also based on that code | ||
| ## Features | ||
|
|
||
| - Easily convert numbers to full written out currencies, e.g. |
There was a problem hiding this comment.
Minor wording issue: “convert numbers directly to full written currencies” is grammatically off/unclear. Consider rephrasing to “convert numbers to fully written-out currency amounts” (or similar).
| **Number to words NL** is an [Espanso](https://espanso.org/) package that enables you to convert numbers directly to full written currencies from your Espanso extension. | |
| This is the same functionality as https://www.zegge.nu/ and also based on that code | |
| ## Features | |
| - Easily convert numbers to full written out currencies, e.g. | |
| **Number to words NL** is an [Espanso](https://espanso.org/) package that enables you to convert numbers to fully written-out currency amounts from your Espanso extension. | |
| This provides the same functionality as https://www.zegge.nu/ and is also based on that code. | |
| ## Features | |
| - Easily convert numbers to fully written-out currency amounts, e.g. |
There was a problem hiding this comment.
A fun package to convert numbers to Dutch written currency text. Uses an inline Python script to process the data entered via a form. The script appears benign, with no malicious code.
I've let Copilot do its stuff and it raises a number of issues, some of which need addressing and others which can be ignored - see my notes.
There are some minor inconsistencies in use, but these may be intentional:
12.34→twaalf euro en vierendertig eurocent
12,34→twaalf euro en vierendertig eurocent
12.345→twaalfduizend driehonderdvijfenveertig euro
12,345→twaalfduizend driehonderdvijfenveertig euro
It doesn't distinguish between periods . and commas ,, which I suppose allows for Dutch and English number formats to be used.
| To install from espanso hub: | ||
|
|
||
| ``` | ||
| espanso install number-to-words |
There was a problem hiding this comment.
Or remove the installation instructions entirely - if you look at the Hub entries you'll see these are generated automatically and placed towards the top-right of each package's landing page anyway.
| **Number to words NL** is an [Espanso](https://espanso.org/) package that enables you to convert numbers directly to full written currencies from your Espanso extension. | ||
|
|
||
| This is the same functionality as https://www.zegge.nu/ and also based on that code | ||
| ## Features | ||
|
|
||
| - Easily convert numbers to full written out currencies, e.g. |
| sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') | ||
|
|
||
| getal = '{{form1.getal}}' | ||
|
|
There was a problem hiding this comment.
I'm not overly concerned about this - all data entered is going to come locally from the user. If they want to try and inject arbitrary Python code that's up to them.
| homepage: "https://github.com/brentgees" | ||
| version: 0.1.0 | ||
| author: Brent Gees, zegge.nu | ||
| tags: ["Dutch", "Numbers", "Converter", "Utility] |
| args: | ||
| - python | ||
| - -c | ||
| - | | ||
| # -*- coding: utf-8 -*- | ||
| import sys |
Based on the website https://www.zegge.nu where you can convert numbers to full written-out words
number.to.words.converter.mp4