Giter VIP home page Giter VIP logo

currency2text's Introduction

Currency to text converter

This is modular multilingual multi-currency amount to text converter written in Python. Module can be used to convert numbers to the text representation in various languages for various currencies. It's aim is to provide correct textual representation.

Supported sum: 0 ... 999999999999.99

Supported languages: (for more reference see languages folder) de_DE (German - Deutch), en_US (English), es_ES (Spanish - Español), lt_LT (Lithuanian - Lietuvių), lv_LV (Latvian - Laviešu), ru_RU (Russian - Русский) tr_TR (Turkish - Türkçe) uk_UA (Ukranian - Українська мова)

Supported currencies: (see particular language for reference) EUR, USD, TRY, MXN, LVL, LTL, UAH, RUB

Installation

from local folder: #> sudo ./setup.py install

directly from github: #> pip3 install git+https://github.com/aeroo/currency2text.git

Usage

from currency2text import currency_to_text, supported_language print(currency_to_text(23.45, 'EUR', 'lv_LV'))

divdesmit trīs eiro četrdesmit pieci centi

print(currency_to_text(23.45, 'EUR', 'en_US'))

twenty three euro fourty five cents

print(supported_language)

{'uk_UA': uk_UA, 'ru_RU': ru_RU, 'lt_LT': lt_LT, 'en_US': en_US, 'lv_LV': lv_LV, 'de_DE': de_DE, 'es_ES': es_ES, 'tr_TR': tr_TR}

suppl = supported_language[language_code] print(suppl.currency_to_text(23.45, 'USD'))

twenty three US dollars fourty five cents

print(supported_language.get('en_US').supported_currency)

{u'TRY': TRY, u'MXN': MXN, u'USD': USD, u'LVL': LVL, u'EUR': EUR, u'LTL': LTL}

Module Structure

Please inspect folder structure, in order to add new languages and currencies! Referrence languages are Latvian (lv_LV), English (en_US). Please consider implementing as much as possible other currencies for your language!

/currency2text (Main folder) /languages /lv_LV (Folder containing particular language) init.py (Main file that facilitates convertion of numbers to text) /currencies (Folder containing all currencies supported by the language) init.py (Do not edit this file!) lvl.py (Currency file, named by ISO code) usd.py (Another currecy) ...

currency2text's People

Contributors

sraps avatar samuelpx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.