# RISify
[](https://gitlab.com/parcifal/ris-py/-/pipelines)
[](https://gitlab.com/parcifal/ris-py/-/commits/master)
[][pypi]
RISify is a Python library and CLI for working with Regional Indicator Symbols
(RIS) — the Unicode characters used to represent country and region flags.
It provides:
- Encoding and decoding between RIS, ASCII, and HTML entities
- Upper- and lowercase ASCII variants
- Safe HTML output using markupsafe
- Concatenation and comparison support
> Licensed under the [AGPLv3.0](LICENSE)
> The RISify logo uses the [Twemoji](https://github.com/twitter/twemoji)
> project © 2017 Twitter, licensed under
> [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/).
## Installation
RISify is available on [PyPI][pypi]:
```bash
pip install RISify
```
Or install directly from source:
```bash
git clone git@gitlab.com:parcifal/ris-py.git
cd ris-py
pip install .
```
## Usage (API)
### Basic Conversion
```python
from ris import ris
# decode a country code to RIS
pt = ris("PT")
print(pt) # 🇵🇹
```
### HTML to RIS
```python
de = ris("🇩🇪").encode("unicode")
print(de) # 🇩🇪
```
### RIS to ASCII (upper/lower)
```python
nl = ris("🇳🇱").encode("ascii").upper()
print(nl) # NL
eu = ris("🇪🇺").encode("ascii").lower()
print(eu) # eu
```
### RIS to HTML
```python
fo = ris("🇫🇴").encode("html")
print(fo) # 🇫🇴
```
### Concatenation
```python
print("spam " + pt + " bacon " + de + " sausage " + nl + " eggs " + eu + " ham " + fo)
# spam 🇵🇹 bacon 🇩🇪 sausage 🇳🇱 eggs 🇪🇺 ham 🇫🇴
```
## Usage (CLI)
Installing RISify also provides a `ris` command-line tool:
```bash
ris NL # 🇳🇱
```
### Options
```bash
usage: ris [-h] [-a | -A | -u | -H] [-v] [-l OUTPUT_LOG] [-V] value
Convert a country code to a RIS code.
positional arguments:
value input text (ascii, ris or html) to convert
optional arguments:
-h, --help show this help message and exit
-a, --ascii output as a country code in lowercase ascii
-A, --ASCII output as a country code in uppercase ascii
-u, --unicode output as a ris code in unicode (default)
-H, --html output as a ris code in html
-v, --verbose increase verbosity
-l OUTPUT_LOG, --output-log OUTPUT_LOG
output log file (defaults to stdout)
-V, --version show program's version number and exit
```
### Examples
```bash
# convert iso country code to ris
ris PT # 🇵🇹
# convert ris to ascii uppercase
ris 🇳🇱 --ASCII # NL
# convert ris to ascii lowercase
ris 🇪🇺 --ascii # eu
# convert iso country code to html entities
ris FO --html # 🇫🇴
# increase verbosity and log to file
ris PT -vvv -l ris.log
```
## Contributing
Found a bug? Have a suggestion? Open an issue or submit a merge request at
[the GitLab repository](https://gitlab.com/parcifal/ris-py). All
contributions are welcome.
[pypi]: https://pypi.org/project/RISify/
Raw data
{
"_id": null,
"home_page": null,
"name": "RISify",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "unicode, regional indicator symbols, encoding, decoding, flags, internationalization, localization, emoji",
"author": null,
"author_email": "\"M.P. van de Weerd\" <michael@parcifal.dev>",
"download_url": "https://files.pythonhosted.org/packages/6b/48/43819ae55277605cc31f8a183f3e11715531612caca042263ad1bc2ecc1e/risify-1.2.1.tar.gz",
"platform": null,
"description": "# RISify\n\n[](https://gitlab.com/parcifal/ris-py/-/pipelines)\n[](https://gitlab.com/parcifal/ris-py/-/commits/master)\n[][pypi]\n\nRISify is a Python library and CLI for working with Regional Indicator Symbols \n(RIS) \u2014 the Unicode characters used to represent country and region flags. \n\nIt provides:\n\n - Encoding and decoding between RIS, ASCII, and HTML entities\n - Upper- and lowercase ASCII variants\n - Safe HTML output using markupsafe\n - Concatenation and comparison support\n\n > Licensed under the [AGPLv3.0](LICENSE)\n \n > The RISify logo uses the [Twemoji](https://github.com/twitter/twemoji) \n > project © 2017 Twitter, licensed under\n > [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/).\n\n## Installation\n\nRISify is available on [PyPI][pypi]:\n\n```bash\npip install RISify\n```\n\nOr install directly from source:\n\n```bash\ngit clone git@gitlab.com:parcifal/ris-py.git\ncd ris-py\npip install .\n```\n\n## Usage (API)\n\n### Basic Conversion\n\n```python\nfrom ris import ris\n\n# decode a country code to RIS\npt = ris(\"PT\")\nprint(pt) # \ud83c\uddf5\ud83c\uddf9\n```\n\n### HTML to RIS\n\n```python\nde = ris(\"🇩🇪\").encode(\"unicode\")\nprint(de) # \ud83c\udde9\ud83c\uddea\n```\n\n### RIS to ASCII (upper/lower)\n\n```python\nnl = ris(\"\ud83c\uddf3\ud83c\uddf1\").encode(\"ascii\").upper()\nprint(nl) # NL\n\neu = ris(\"\ud83c\uddea\ud83c\uddfa\").encode(\"ascii\").lower()\nprint(eu) # eu\n```\n\n### RIS to HTML\n\n```python\nfo = ris(\"\ud83c\uddeb\ud83c\uddf4\").encode(\"html\")\nprint(fo) # 🇫🇴\n```\n\n### Concatenation\n\n```python\nprint(\"spam \" + pt + \" bacon \" + de + \" sausage \" + nl + \" eggs \" + eu + \" ham \" + fo)\n# spam \ud83c\uddf5\ud83c\uddf9 bacon \ud83c\udde9\ud83c\uddea sausage \ud83c\uddf3\ud83c\uddf1 eggs \ud83c\uddea\ud83c\uddfa ham \ud83c\uddeb\ud83c\uddf4\n```\n\n## Usage (CLI)\n\nInstalling RISify also provides a `ris` command-line tool:\n\n```bash\nris NL # \ud83c\uddf3\ud83c\uddf1\n```\n\n### Options\n\n```bash\nusage: ris [-h] [-a | -A | -u | -H] [-v] [-l OUTPUT_LOG] [-V] value\n\nConvert a country code to a RIS code.\n\npositional arguments:\n value input text (ascii, ris or html) to convert\n\noptional arguments:\n -h, --help show this help message and exit\n -a, --ascii output as a country code in lowercase ascii\n -A, --ASCII output as a country code in uppercase ascii\n -u, --unicode output as a ris code in unicode (default)\n -H, --html output as a ris code in html\n -v, --verbose increase verbosity\n -l OUTPUT_LOG, --output-log OUTPUT_LOG\n output log file (defaults to stdout)\n -V, --version show program's version number and exit\n```\n\n### Examples\n\n```bash\n# convert iso country code to ris\nris PT # \ud83c\uddf5\ud83c\uddf9\n\n# convert ris to ascii uppercase\nris \ud83c\uddf3\ud83c\uddf1 --ASCII # NL\n\n# convert ris to ascii lowercase\nris \ud83c\uddea\ud83c\uddfa --ascii # eu\n\n# convert iso country code to html entities\nris FO --html # 🇫🇴\n\n# increase verbosity and log to file\nris PT -vvv -l ris.log\n```\n\n## Contributing\n\nFound a bug? Have a suggestion? Open an issue or submit a merge request at\n[the GitLab repository](https://gitlab.com/parcifal/ris-py). All \ncontributions are welcome.\n\n[pypi]: https://pypi.org/project/RISify/\n",
"bugtrack_url": null,
"license": null,
"summary": "Simplifies the encoding and decoding of Regional Indicator Symbols.",
"version": "1.2.1",
"project_urls": {
"Bug Tracker": "https://gitlab.com/parcifal/ris-py/-/issues",
"Homepage": "https://gitlab.com/parcifal/ris-py"
},
"split_keywords": [
"unicode",
" regional indicator symbols",
" encoding",
" decoding",
" flags",
" internationalization",
" localization",
" emoji"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8fe8e2792fd06ef3d3b19977e6b60463cdcebc9ff39bc50eec970ce3719b966b",
"md5": "c63a32a8178f9bb641f9d6c46d1a3149",
"sha256": "3646f7a0dbb7385f2060ebbfff1ee7e027eb83cfc18399e148c0daa23d7cfd0d"
},
"downloads": -1,
"filename": "risify-1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c63a32a8178f9bb641f9d6c46d1a3149",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17331,
"upload_time": "2025-09-01T11:34:24",
"upload_time_iso_8601": "2025-09-01T11:34:24.627835Z",
"url": "https://files.pythonhosted.org/packages/8f/e8/e2792fd06ef3d3b19977e6b60463cdcebc9ff39bc50eec970ce3719b966b/risify-1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6b4843819ae55277605cc31f8a183f3e11715531612caca042263ad1bc2ecc1e",
"md5": "1677697b1288df125b6a8d6522750382",
"sha256": "5a5bd3aab7cb5b58aeb0734e1a18d9b3d14f1821d0da883e740d39ed6eead658"
},
"downloads": -1,
"filename": "risify-1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "1677697b1288df125b6a8d6522750382",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17293,
"upload_time": "2025-09-01T11:34:25",
"upload_time_iso_8601": "2025-09-01T11:34:25.853723Z",
"url": "https://files.pythonhosted.org/packages/6b/48/43819ae55277605cc31f8a183f3e11715531612caca042263ad1bc2ecc1e/risify-1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-01 11:34:25",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "parcifal",
"gitlab_project": "ris-py",
"lcname": "risify"
}