Skip to main content

Simplifies the encoding and decoding of Regional Indicator Symbols.

Project description

RISify

RISify is a Python library that provides functions for encoding and decoding Regional Indicator Symbols (RIS), which are Unicode characters used to represent flags of countries and regions.

Installation

You can install RISify via pip:

pip install RISify

Usage

from ris import ris

# decode a country code to RIS
pt = ris("PT")

print(pt)  # 🇵🇹

# decode an HTML code to RIS
de = ris("🇩🇪")
de = de.encode("unicode")  # default

print(de)  # 🇩🇪

# encode a RIS code to uppercase ASCII
nl = ris("🇳🇱")
nl = nl.encode("ascii")
nl = nl.upper()  # default

print(nl)  # NL

# encode a RIS code to lowercase ASCII
eu = ris("🇪🇺")
eu = eu.encode("ascii")
eu = eu.lower()

print(eu)  # eu

# encode a RIS code to HTML
fo = ris("🇫🇴")
fo = fo.encode("html")

print(fo)  # 🇫🇴

# concatenate RIS codes into a string
print("spam " + pt + " bacon " + de + " sausage " + nl + " eggs " + eu + " ham " + fo)
# spam 🇵🇹 bacon 🇩🇪 sausage NL eggs eu ham 🇫🇴

Note that HTML is encoded with HTML-safe symbols, which can be useful for ensuring that the symbols are markup-safe when used in HTML.

Contributing

Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue on the GitLab repository. If you would like to contribute code, please fork the repository and submit a pull request.

License

RISify is released under the GPLv3 license. See LICENSE for details.

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

RISify-1.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

RISify-1.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file RISify-1.1.0.tar.gz.

File metadata

  • Download URL: RISify-1.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for RISify-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4f9759fc864f7993a905a790152173054af90eb0591d19033faa06983e9018a5
MD5 cab95644efff7b65467d9d624b3e9540
BLAKE2b-256 ff8f8d5c7798e6b97b595494cdbf6102e81dd69ae3d41d3c946e1d4c39fc2cbf

See more details on using hashes here.

File details

Details for the file RISify-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: RISify-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for RISify-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5012dbc116863e5b403d5451e87a118d8dac726ea295db2bdb20450f6fdadb28
MD5 fcea40b0437967ca4672ff95710b611b
BLAKE2b-256 05f9c5ba47c93622dc1b4b05d140df49d214e3ce6f00d982facba969461776b5

See more details on using hashes here.

Supported by

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