# NumTextAlchemy
**NumTextAlchemy** is a Python library that allows for the conversion of extremely large numbers (up to \(10^{212}\)) into their text representation and back to integer format. Unlike most other libraries, **NumTextAlchemy** supports arbitrary-precision numbers, enabling it to handle conversions of both very large integers and their textual counterparts with ease.
## Features
- Convert integers up to \(10^{212}\) to their textual representation.
- Convert the textual representation back to integer format.
- No external libraries are required—it's a pure Python implementation.
- Efficient handling of arbitrary-precision integers.
- Works with numbers far beyond traditional integer limits.
## Installation
Using PIP:
```bash
pip install NumTextAlchemy
```
Clone the repository:
```bash
git clone https://github.com/Srinath-N-Gudi/NumTextAlchemy.git
```
## Usage
### Example 1: Converting Large Numbers to Text
```python
from NumTextAlchemy import num2text
number = "94891894789189789496964897"
number_text = num2text(number)
print(number_text) # The above number in text-format
```
### Example 2: Converting Large Text to Numbers
```python
from NumTextAlchemy import text2num
text = 'one hundred twenty-three octodecillion four hundred fifty-six septendecillion seven hundred eighty-nine sexdecillion twelve quindecillion three hundred forty-five quattuordecillion six hundred seventy-eight tredecillion nine hundred one duodecillion two hundred thirty-four undecillion five hundred sixty-seven decillion eight hundred ninety nonillion one hundred twenty-three octillion four hundred fifty-six septillion seven hundred eighty-nine sextillion twelve quintillion three hundred forty-five quadrillion six hundred seventy-eight trillion nine hundred one billion two hundred thirty-four million five hundred sixty-seven thousand eight hundred ninety'
number_text = text2num(text)
print(number_text) # 123456789012345678901234567890123456789012345678901234567890
```
## How It Works
### Number to Text Conversion
The library implements an algorithm that takes large numbers and breaks them down into manageable parts for conversion into readable English text. This allows you to convert numbers far beyond normal integer limits into a human-readable format, even numbers with hundreds of digits.
### Text to Number Conversion
**NumTextAlchemy** also supports converting textual representations of numbers back into their integer format. This is done using a custom parser to handle large-scale text-based number input, allowing for seamless back-and-forth conversions.
## Why NumTextAlchemy?
Most number-to-text conversion libraries are limited by the size of the numbers they can handle, often restricted to standard integer ranges. **NumTextAlchemy** breaks these barriers by supporting numbers as large as \(10^{212}\) and beyond, making it ideal for applications that require arbitrary-precision arithmetic.
## Use Cases
- **Scientific Computation**: Represent extremely large numbers in text for easier interpretation in papers or output.
- **Data Serialization**: Convert large integers into text for storage and easily parse them back into numbers.
- **Educational Tools**: Use the library for teaching or working with large numbers in a textual format.
## Contribution
Contributions are welcome! If you'd like to improve the library, feel free to open a pull request or submit an issue.
1. Fork the repository.
2. Create your feature branch:
3. Commit your changes:
4. Push to the branch:
5. Open a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/Srinath-N-Gudi/NumTextAlchemy",
"name": "NumTextAlchemy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": null,
"keywords": "python, library, num2text, num2words, numbers, texts, words, conversion, alchemy, numtext",
"author": "Srinath Gudi",
"author_email": "srinathngudi11@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8a/79/e2a1afe6c8c4567570122252ad8fc9c67554094a1e0704a835faca219dd5/numtextalchemy-0.1.2.tar.gz",
"platform": null,
"description": "# NumTextAlchemy\r\n\r\n**NumTextAlchemy** is a Python library that allows for the conversion of extremely large numbers (up to \\(10^{212}\\)) into their text representation and back to integer format. Unlike most other libraries, **NumTextAlchemy** supports arbitrary-precision numbers, enabling it to handle conversions of both very large integers and their textual counterparts with ease.\r\n\r\n## Features\r\n\r\n- Convert integers up to \\(10^{212}\\) to their textual representation.\r\n- Convert the textual representation back to integer format.\r\n- No external libraries are required\u2014it's a pure Python implementation.\r\n- Efficient handling of arbitrary-precision integers.\r\n- Works with numbers far beyond traditional integer limits.\r\n\r\n## Installation\r\nUsing PIP:\r\n```bash\r\npip install NumTextAlchemy\r\n```\r\n\r\n\r\nClone the repository:\r\n\r\n```bash\r\ngit clone https://github.com/Srinath-N-Gudi/NumTextAlchemy.git\r\n```\r\n\r\n## Usage\r\n### Example 1: Converting Large Numbers to Text\r\n```python\r\nfrom NumTextAlchemy import num2text\r\n\r\nnumber = \"94891894789189789496964897\"\r\n\r\nnumber_text = num2text(number)\r\n\r\nprint(number_text) # The above number in text-format\r\n```\r\n\r\n### Example 2: Converting Large Text to Numbers\r\n\r\n```python\r\nfrom NumTextAlchemy import text2num\r\n\r\ntext = 'one hundred twenty-three octodecillion four hundred fifty-six septendecillion seven hundred eighty-nine sexdecillion twelve quindecillion three hundred forty-five quattuordecillion six hundred seventy-eight tredecillion nine hundred one duodecillion two hundred thirty-four undecillion five hundred sixty-seven decillion eight hundred ninety nonillion one hundred twenty-three octillion four hundred fifty-six septillion seven hundred eighty-nine sextillion twelve quintillion three hundred forty-five quadrillion six hundred seventy-eight trillion nine hundred one billion two hundred thirty-four million five hundred sixty-seven thousand eight hundred ninety'\r\n\r\nnumber_text = text2num(text)\r\n\r\nprint(number_text) # 123456789012345678901234567890123456789012345678901234567890\r\n```\r\n\r\n## How It Works\r\n\r\n### Number to Text Conversion\r\nThe library implements an algorithm that takes large numbers and breaks them down into manageable parts for conversion into readable English text. This allows you to convert numbers far beyond normal integer limits into a human-readable format, even numbers with hundreds of digits.\r\n\r\n### Text to Number Conversion\r\n**NumTextAlchemy** also supports converting textual representations of numbers back into their integer format. This is done using a custom parser to handle large-scale text-based number input, allowing for seamless back-and-forth conversions.\r\n\r\n## Why NumTextAlchemy?\r\n\r\nMost number-to-text conversion libraries are limited by the size of the numbers they can handle, often restricted to standard integer ranges. **NumTextAlchemy** breaks these barriers by supporting numbers as large as \\(10^{212}\\) and beyond, making it ideal for applications that require arbitrary-precision arithmetic.\r\n\r\n## Use Cases\r\n\r\n- **Scientific Computation**: Represent extremely large numbers in text for easier interpretation in papers or output.\r\n- **Data Serialization**: Convert large integers into text for storage and easily parse them back into numbers.\r\n- **Educational Tools**: Use the library for teaching or working with large numbers in a textual format.\r\n\r\n## Contribution\r\n\r\nContributions are welcome! If you'd like to improve the library, feel free to open a pull request or submit an issue.\r\n\r\n1. Fork the repository.\r\n2. Create your feature branch:\r\n3. Commit your changes:\r\n4. Push to the branch:\r\n5. Open a pull request.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "NumTextAlchemy is a Python library designed to convert extremely large numbers into their text representations and back to their numerical form.",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/Srinath-N-Gudi/NumTextAlchemy"
},
"split_keywords": [
"python",
" library",
" num2text",
" num2words",
" numbers",
" texts",
" words",
" conversion",
" alchemy",
" numtext"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c79c3036674c23d87db38ec4a3c2fd855b08701c812773daa6c9fa4a4a2a64d1",
"md5": "86499665a9002119edca793e17ca8cb7",
"sha256": "1202cecbbde5c5b7dd97747bb1dbb02ada8b94155c4318897dfcd9da80fb6279"
},
"downloads": -1,
"filename": "NumTextAlchemy-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "86499665a9002119edca793e17ca8cb7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0",
"size": 6714,
"upload_time": "2024-10-01T06:03:53",
"upload_time_iso_8601": "2024-10-01T06:03:53.687714Z",
"url": "https://files.pythonhosted.org/packages/c7/9c/3036674c23d87db38ec4a3c2fd855b08701c812773daa6c9fa4a4a2a64d1/NumTextAlchemy-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8a79e2a1afe6c8c4567570122252ad8fc9c67554094a1e0704a835faca219dd5",
"md5": "bb6ec19ef7aca2fe1f07ec1f3cd4e18e",
"sha256": "10a55e04fcbf2e74f51c4c7c13ea4803fe251ce8bc2c1ab790f9c9742625717d"
},
"downloads": -1,
"filename": "numtextalchemy-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "bb6ec19ef7aca2fe1f07ec1f3cd4e18e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0",
"size": 6427,
"upload_time": "2024-10-01T06:03:55",
"upload_time_iso_8601": "2024-10-01T06:03:55.484910Z",
"url": "https://files.pythonhosted.org/packages/8a/79/e2a1afe6c8c4567570122252ad8fc9c67554094a1e0704a835faca219dd5/numtextalchemy-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-01 06:03:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Srinath-N-Gudi",
"github_project": "NumTextAlchemy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "numtextalchemy"
}