Skip to main content

The module converts Arabic numerals to Greek and Roman numbers

Project description

English

Module converting Arabic numerals to Greek and Roman numbers

Version: 1.0.4
Supported Python: 3.11, 3.12, 3.13, 3.14, 3.15
Repository: GitHub - GreekRomanNumerical
License: Apache 2.0

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.

Installation

Install the package using pip:

pip install GreekRomanUtils

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.
  • change_positional: Change the positional mode for conversion.
  • convert — the function of converting an Arabic number to a Greek one, returns GreekNumber object, for example, the number 20005003001 is converted to Κ___Ε__Γ_Α.
  • convert_position is a function for converting an Arabic number to a positional Greek number, returns GreekNumber object, for example, the number 20005003001 is converted to Κ~Ε~Γ~Α.
  • convert_to_arabic is a function for converting a Greek number to an Arabic one.
  • unicode_to_name — the function converts a Unicode character into its name.
  • name_to_unicode is the reverse operation for unicode_to_name.

The "GreekNumber" class:

  • set_number: set a new value
  • set_positional: set the number output flag
  • set_capital: set the upper case flag
  • get_number: get the current number
  • get_positional: get the flag value
  • get_capital: get the flag value
  • And basic mathematical operations

For "RomanConvert":

  • convert — the method converts an Arabic number to a Roman number, returns RomanNumber object.
  • convert_to_arabic is the reverse method for convert.

For "RomanNumber":

  • set_number: set a new value
  • get_number: get the current number
  • And basic mathematical operations

Ru

Модуль преобразование арабских цифр в греческие и римские числа

Версия: 1.0.4
Поддерживаемые версии Python: 3.11, 3.12, 3.13, 3.14, 3.15
Репозиторий: GitHub - GreekRomanNumerical
Лицензия: Apache 2.0

Описание

Библиотека преобразует арабские числа, такие как 1234, в римские эквиваленты, например, MCCXXXIV, или греческие — Α_ΣΛΔ.

Также этот модуль может выводить греческие цифры в разных форматах. Например, число 20005003001 можно представить как Κ___Ε__Γ_Α или Κ~Ε~Γ~Α. Кроме того, есть возможность выводить текстовое название цифр, например, Kappa macron Epsilon macron Gamma macron Alpha, или выводить их в нижнем регистре.

Установка

Установите пакет с помощью pip:

pip install GreekRomanUtils

Структура пректа

Есть два основных класса: GreekConvert и RomanConvert. Они реализуют логику преобразования в соответствующие числа. Также есть классы GreekAlphabet и RomanNumberAlphabet, которые используются для хранения списков и словарей.
Есть собственные типы данных GreekNumber и RomanNumber для работы с греческими и римскими числами, что позволит выполнять с ними базовые математические операции.

Основные функции

Для «GreekConvert»:

  • change_capital: флаг, управляющий преобразованием символов в верхний или нижний регистр.
  • change_positional: изменить режим позиционного преобразования.
  • convert — функция преобразования арабского числа в греческое, возвращает объект GreekNumber, например, число 20005003001 преобразуется в Κ___Ε__Γ_Α.
  • convert_position — функция преобразования арабского числа в позиционное греческое число, возвращает объект GreekNumber, например, число 20005003001 преобразуется в Κ~Ε~Γ~Α.
  • convert_to_arabic — функция преобразования греческого числа в арабское.
  • unicode_to_name — функция преобразует символ Unicode в его название.
  • name_to_unicode — обратная операция для unicode_to_name.

Класс «GreekNumber»:

  • set_number: установить новое значение
  • set_positional: установить флаг вывода числа
  • set_capital: установить флаг верхнего регистра
  • get_number: получить текущее число
  • get_positional: получить значение флага
  • get_capital: получить значение флага
  • И базовые математические операции

Для «RomanConvert»:

  • convert — метод преобразует арабское число в римское, возвращает объект RomanNumber.
  • convert_to_arabic — обратный метод для convert.

Для «RomanNumber»:

  • set_number: установить новое значение
  • get_number: получить текущее число
  • И базовые математические операции

Схема пректа
ScheemProject

License

Apache License 2.0

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

greekromanutils-1.0.5.tar.gz (114.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

greekromanutils-1.0.5-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file greekromanutils-1.0.5.tar.gz.

File metadata

  • Download URL: greekromanutils-1.0.5.tar.gz
  • Upload date:
  • Size: 114.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for greekromanutils-1.0.5.tar.gz
Algorithm Hash digest
SHA256 87584085324dd1bf20b00d9276a28f2b890c85abba2da9d5ffc7e5582435b178
MD5 5d661b9d8f80faf15144d382bfc8df30
BLAKE2b-256 a41b8dc079c45ee592d4bb1321e46e04f2e1453e795117bb94a0e541aca08a3b

See more details on using hashes here.

File details

Details for the file greekromanutils-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: greekromanutils-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for greekromanutils-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0f44aaba2ea28902263456c20583df3808d9e6be535149982a731d571c326f
MD5 f8af7bd1494f60c07f6d167efebd236d
BLAKE2b-256 3077aba88b0bf4b88a7fa9633427e630093f9c338357ef8ded1eb866a2c0b0d5

See more details on using hashes here.

Supported by

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