Skip to main content

arpapy

Multilingual text/IPA to ARPAbet G2P for text2speech generation.

Installation

sudo apt install espeak-ng
pip install arpapy

Quick Start

Getting pronunciation

from arpapy import get_arpa

s: str = '"Marron glacé is in my DNA." adiós'
print(get_arpa(s))
# ['M', 'AA1', 'R', 'AX0', 'N', '/', 'G', 'L', 'AA0', 'S', 'EY1', '/', 'IH0', 'Z', '/', 'IH0', 'N', '/', 'M', 'AY0', '/', 'D', 'IY2', 'EH2', 'N', 'EY1', '-', 'EY1', 'D', 'IH0', 'AX2', 'UH0', 'Z']

s: str = 'あわてんのおつかい'
print(get_arpa(s, lang=CharacterCategory.JAPANESE)) # ['AA2', 'W', 'AA0', 'T', 'EY2', 'N', 'N', 'OW0', 'OW0', 'T', 'S', 'UW0', 'V', 'K', 'AA1', 'IY0']

Segmenting Languages

from arpapy import segment_string, CharacterCategory

test_string = "😊yo ♠你好hello, 人😊♠ 出自日本童谣'あわてん坊のおつかい'"
result = segment_string(test_string, [CharacterCategory.LATIN, CharacterCategory.CHINESE, CharacterCategory.JAPANESE])
print(result)
# [('yo ♠', <CharacterCategory.LATIN: 5>), ('你好', <CharacterCategory.CHINESE: 2>), ('hello, ', <CharacterCategory.LATIN: 5>), ("人😊♠ 出自日本童谣'", <CharacterCategory.CHINESE: 2>), ('あわてん', <CharacterCategory.JAPANESE: 3>), ('坊', <CharacterCategory.CHINESE: 2>), ("のおつかい'", <CharacterCategory.JAPANESE: 3>)]

Limitation

Some of the convertion from IPA to ARPA might be inaccurate or out of scope, which might result in arpapy.excepts.PhonemeError: Unable to recognize the phoneme. If this is the case, please submit a PR according to IPA consonant chart with audio.

Language scope: (If there is any error within the scope, I'll fix it.)

  • All standard English
  • All Chinese
  • All Japanese Hiragana, Katakana
  • Some western languages (Spanish, German, etc...)
  • Some korean (not tested)

Future:

  • Support Japanese Kanji

Citation

See CREADITS.md for all credits.

@misc{arpapy,
  title={arpapy: Multilingual text/IPA to ARPAbet G2P for text2speech generation.},
  author={Koke_Cacao},
  year={2025},
  howpublished={\url{https://github.com/KokeCacao/arpapy}},
  note={Open-source software}
}

Metadata

Release files for arpapy 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arpapy 0.0.3
File Size Uploaded
arpapy-0.0.3.tar.gz 23.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arpapy 0.0.3
File Interpreter ABI Platform
arpapy-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 46.8 kB

Release files / arpapy-0.0.3.tar.gz

Download URL arpapy-0.0.3.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
86422ebdf16489ea7ee5bb83480d3d00afb33d8a5891b5e7788c65cb563505aa
BLAKE2b-256 checksum
How to use checksums
ceff6918020bfd26e3a67629f48f7798e4064e720a0ff58f7baae63ed1c0bdba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2025.

Transparency log

Release files / arpapy-0.0.3-py3-none-any.whl

Download URL arpapy-0.0.3-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
066fb32c01aa9a4e7a2532822c629e5fa67929f4c26a81db60e58638445dbea5
BLAKE2b-256 checksum
How to use checksums
af402b3454da89a8c7bb81ac9fc607e10fed77de801420dff632f914183262a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page