Skip to main content

Ancient Athenian acrophonic numeral converter

Project description

Akrophonobolos

Python package for handling Ancient Athenian monetary values in talents, drachmas and obols, including input and output in Greek acrophonic numerals (such as ๐…Ž, ๐…, ๐…Œ, ๐…‹, ๐…Š, etc.)

Installation

pip install akrophonobolos

Usage

Read the full documentation on Read the Docs

Akrophonobolos provides functions for parsing, manipulating, and formatting Greek acrophonic numerals. It also provides a class, Khremata encapsulating these methods. Interally, the python fractions library is used to minimize issues caused by floating point arithmetic.

>>> import akrophonobolos as obol
>>> cash = obol.parse_greek_amount("ฮค๐……ฮ—ฮ—ฮ—ฮ”๐…‚๐…‚๐…‚ฮ™๐…")
>>> cash
Fraction(81759, 2)
>>> obol.format_amount(cash)
'1t 813d 1ยฝb'
>>> obol.format_amount(cash, obol.Fmt.ENGLISH)
'1 talent, 813 drachmas, 1ยฝ obols'
>>> obol.format_amount(cash, obol.Fmt.GREEK)
'ฮค๐……ฮ—ฮ—ฮ—ฮ”๐…‚๐…‚๐…‚ฮ™๐…'
>>> obol.format_amount(cash * 2)
'2t 1626d 3b'

Using the class:

>>> cash1 = obol.Khremata('1t')
>>> cash2 = obol.Khremata('300d 3b')
>>> cash1 + cash2
Khremata (1t 300d 3b [= 37803.0 obols])
>>> cash1 - cash2
Khremata (5699d 3b [= 34197.0 obols])
>>> cash1/cash2
Fraction(12000, 601)

There are functions for working with the sort of interest we see in inscriptions such as IG Iยณ 369.

>>> rate = obol.interest_rate("5t", 1, "1d")
>>> rate
Fraction(1, 30000)
>>> obol.loan_term("๐…Š", "ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ”", rate)
1397

The first line calculates the rate required for 1 drachma interest on 1 talent in 1 day. The last applies it to the amounts found on line 7 of that inscription for the principal (๐…Š, 50 talents) and interest (ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ”, 2 talents 1,970 drachmas) to determine that the loan term was 1,397 days.

This package also provides two command lin scripts. obol performs conversion and simple math:

$ obol ๐…‰๐…‰๐…ˆ 348d "1d 5.5b" 14T1800D4O
๐…‰๐…‰๐…ˆ = 25 talents
348d = ฮ—ฮ—ฮ—ฮ”ฮ”ฮ”ฮ”๐…ƒ๐…‚๐…‚๐…‚
1d 5.5b = ๐…‚ฮ™ฮ™ฮ™ฮ™ฮ™๐…
14T1800D4O = ๐…‰ฮคฮคฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ™ฮ™ฮ™ฮ™

$ obol 1t + 1000d
ฮคฮง = 1t 1000d
$ obol 1t - 1000d
๐…† = 5000d

logistes does loan calculations:

$ logistes -p 50t -d 1397
๐…Š (50t) at 10 drachmas per day for 1397 days = ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ” (2t 1970d) interest
$ logistes -p 50t -i ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ”
๐…Š (50t) at 10 drachmas per day for 1397 days = ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ” (2t 1970d) interest
$ logistes -d 1397 -i ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ”
๐…Š (50t) at 10 drachmas per day for 1397 days = ฮคฮคฮง๐……ฮ—ฮ—ฮ—ฮ—๐…„ฮ”ฮ” (2t 1970d) interest

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/seanredmond/akrophonobolos

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

akrophonobolos-1.0.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

akrophonobolos-1.0.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file akrophonobolos-1.0.0.tar.gz.

File metadata

  • Download URL: akrophonobolos-1.0.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.17

File hashes

Hashes for akrophonobolos-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c382ad321cbec796aa0c6382dda014362352d94ca0deb0238e29e1a02dcb319d
MD5 5df5e9f4e1860ae4b4e0ef03f07f2aac
BLAKE2b-256 f4cf6d0b96ea63577b9b0a5960526452102f0a5cc5b00f31155b1078125e7839

See more details on using hashes here.

File details

Details for the file akrophonobolos-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: akrophonobolos-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.17

File hashes

Hashes for akrophonobolos-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5852b6c99b1aef4682867936e3df05c6ac92aa2a24bcf724c1485c3625f2892
MD5 f798193784bee677c52565fee20a51fa
BLAKE2b-256 d15d7b9e34bd0c4bae87827dcfc172015591f4c46b9c756ecba6d7675b61d3e3

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