The module converts Arabic numerals to Greek and Roman numbers
Project description
English
Module converting Arabic numerals to Greek and Roman numbers
Description
The library converts Arabic numbers, such as 1234, to Roman equivalents, such as MCCXXXIV, or Greek — Α_ΣΛΔ.
This module can also output Greek numbers in different formats. For example, the number 20005003001 can be represented as Κ___Ε__Γ_Α or Κ~Ε~Γ~Α. In addition, it is possible to output the text name of the digits, for example, Kappa macron Epsilon macron Gamma macron Alpha, or output them in lowercase.
The structure of the project
There are two main classes: GreekConvert and RomanConvert. They implement the logic of converting to the corresponding numbers. There are also classes GreekAlphabet and RomanNumberAlphabet, which are used to store lists and dictionaries.
There are proprietary data types GreekNumber and RomanNumber for working with Greek and Roman numbers, which will allow you to perform basic mathematical operations with them.
Main functions
For "GreekConvert":
change_capital: A flag that controls the conversion of characters to upper or lower case.create_greek_number: creates theGreekNumberclassconvert— the function of converting an Arabic number to a Greek one, for example, the number20005003001is converted toΚ___Ε__Γ_Α.convert_positionis a function for converting an Arabic number to a Greek number according to a given pattern, for example, the number20005003001is converted toΚ~Ε~Γ~Α.convert_to_arabicis a function for converting a Greek number to an Arabic one.covert_to_position_arabic— This function is used in combination withconvert_positionand converts a Greek number to an Arabic one.unicode_to_name— the function converts a Unicode character into its name.name_to_unicodeis the reverse operation for unicode_to_name.
The "GreekNumber" class:
set_number: set a new valueset_positional: set the number output flagset_capital: set the upper case flagget_number: get the current numberget_positional: get the flag valueget_capital: get the flag value- And basic mathematical operations
For "RomanConvert":
create_roman_number: creates theRomanNumberclassconvert— the method converts an Arabic number to a Roman number.convert_to_arabicis the reverse method forconvert.
For "RomanNumber":
set_number: set a new valueget_number: get the current number- And basic mathematical operations
Ru
Модуль преобразование арабских цифр в греческие и римские числа
Описание
Библиотека преобразует арабские числа, такие как 1234, в римские эквиваленты, например, MCCXXXIV, или греческие — Α_ΣΛΔ.
Также этот модуль может выводить греческие цифры в разных форматах. Например, число 20005003001 можно представить как Κ___Ε__Γ_Α или Κ~Ε~Γ~Α. Кроме того, есть возможность выводить текстовое название цифр, например, Kappa macron Epsilon macron Gamma macron Alpha, или выводить их в нижнем регистре.
Структура пректа
Есть два основных класса: GreekConvert и RomanConvert. Они реализуют логику преобразования в соответствующие числа. Также есть классы GreekAlphabet и RomanNumberAlphabet, которые используются для хранения списков и словарей.
Есть собственные типы данных GreekNumber и RomanNumber для работы с греческими и римскими числами, что позволит выполнять с ними базовые математические операции.
Основные функции
Для «GreekConvert»:
change_capital: флаг, управляющий преобразованием символов в верхний или нижний регистр.create_greek_number: создает классGreekNumberconvert— функция преобразования арабского числа в греческое, например, число20005003001преобразуется вΚ___Ε__Γ_Α.convert_position— функция преобразования арабского числа в греческое в соответствии с заданным шаблоном, например, число20005003001преобразуется вΚ~Ε~Γ~Α.convert_to_arabic— функция преобразования греческого числа в арабское.covert_to_position_arabic— эта функция используется в сочетании сconvert_positionи преобразует греческое число в арабское.unicode_to_name— функция преобразует символ Unicode в его название.name_to_unicode— обратная операция дляunicode_to_name.
Класс «GreekNumber»:
set_number: установить новое значениеset_positional: установить флаг вывода числаset_capital: установить флаг верхниго регистраget_number: получить нынешнее числоget_positional: получить значение флагаget_capital: получить значение флага- И базывые математические операции
Для «RomanConvert»:
create_roman_number: создает классRomanNumberconvert— метод преобразует арабское число в римское.convert_to_arabic— обратный метод дляconvert.
Для «RomanNumber»:
set_number: установить новое значениеget_number: получить нынешнее число- И базывые математические операции
Схема пректа
License
Apache License 2.0
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 greekromanutils-1.0.3.tar.gz.
File metadata
- Download URL: greekromanutils-1.0.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6153fb098448e9a7a1dd1e743ccc8cbed8b60d000e669caf69f59d915a680cf
|
|
| MD5 |
5cc11537d7aefb18531a33e762b2893b
|
|
| BLAKE2b-256 |
60596096ce0b5980bba20fc12fa3d47a85c35330bce2ab4486d311f150c69e58
|
File details
Details for the file GreekRomanUtils-1.0.3-py3-none-any.whl.
File metadata
- Download URL: GreekRomanUtils-1.0.3-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c8e6ef9d851b771d8b87e9ecb0330caaeef5b7f098bb9c04ecb708cf72542ae
|
|
| MD5 |
faf325a187363e4efef71f2406579334
|
|
| BLAKE2b-256 |
f13c7d423a3d4e64998f28337b2f58a58eeddcf15a582ce2ab9dde4bee9e214e
|