Metadata-Version: 2.4
Name: xnum
Version: 0.4
Summary: XNum: Universal Numeral System Converter
Home-page: https://github.com/openscilab/xnum
Download-URL: https://github.com/openscilab/xnum/tarball/v0.4
Author: XNum Development Team
Author-email: xnum@openscilab.com
License: MIT
Project-URL: Source, https://github.com/openscilab/xnum
Keywords: convert numeral number numeral-system digits
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Manufacturing
Classifier: Topic :: Education
Classifier: Topic :: Text Editors :: Text Processing
Classifier: Topic :: Software Development :: Localization
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.md
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: download-url
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary


<div align="center">
    <img src="https://github.com/openscilab/xnum/raw/main/otherfiles/logo.png" alt="XNum Logo" width="220">
    <h1>XNum: Universal Numeral System Converter</h1>
    <br/>
    <a href="https://badge.fury.io/py/xnum"><img src="https://badge.fury.io/py/xnum.svg" alt="PyPI version"></a>
    <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
    <a href="https://codecov.io/gh/openscilab/xnum"><img src="https://codecov.io/gh/openscilab/xnum/graph/badge.svg?token=0R14OKY0TB"></a>
    <a href="https://github.com/openscilab/xnum"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/xnum"></a>
    <a href="https://discord.gg/h8T2F8WpFN"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>

</div>

----------


## Overview
<p align="justify">
<b>XNum</b> is a simple and lightweight Python library that helps you convert digits between different numeral systems — like English, Persian, Hindi, Arabic-Indic, Bengali, and more.
It can automatically detect mixed numeral formats in a piece of text and convert only the numbers, leaving the rest untouched. Whether you're building multilingual apps or processing localized data, <b>XNum</b> makes it easy to handle numbers across different languages with a clean and easy-to-use API.
</p>

<table>
    <tr>
        <td align="center">PyPI Counter</td>
        <td align="center">
            <a href="https://pepy.tech/projects/xnum">
                <img src="https://static.pepy.tech/badge/xnum">
            </a>
        </td>
    </tr>
    <tr>
        <td align="center">Github Stars</td>
        <td align="center">
            <a href="https://github.com/openscilab/xnum">
                <img src="https://img.shields.io/github/stars/openscilab/xnum.svg?style=social&label=Stars">
            </a>
        </td>
    </tr>
</table>
<table>
    <tr> 
        <td align="center">Branch</td>
        <td align="center">main</td>
        <td align="center">dev</td>
    </tr>
    <tr>
        <td align="center">CI</td>
        <td align="center">
            <img src="https://github.com/openscilab/xnum/actions/workflows/test.yml/badge.svg?branch=main">
        </td>
        <td align="center">
            <img src="https://github.com/openscilab/xnum/actions/workflows/test.yml/badge.svg?branch=dev">
            </td>
    </tr>
</table>


## Installation

### PyPI
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- Run `pip install xnum==0.4`
### Source code
- Download [Version 0.4](https://github.com/openscilab/xnum/archive/v0.4.zip) or [Latest Source](https://github.com/openscilab/xnum/archive/dev.zip)
- Run `pip install .`

## Usage

```pycon
>>> from xnum import convert, NumeralSystem
>>> print(convert("۱۲۳ apples & ٤٥۶ cars", target=NumeralSystem.ENGLISH))
123 apples & 456 cars
>>> print(convert("۱۲۳ and ٤٥٦", source=NumeralSystem.PERSIAN, target=NumeralSystem.HINDI))
१२३ and ٤٥۶
```

ℹ️ By default, the `source` parameter is set to `NumeralSystem.AUTO`, which automatically detects the numeral system

## Supported numeral systems

- English
- Persian
- Hindi
- Arabic-Indic
- Bengali
- Thai
- Khmer
- Burmese
- Tibetan
- Gujarati
- Odia
- Telugu
- Kannada
- Gurmukhi

## Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to [xnum@openscilab.com](mailto:xnum@openscilab.com "xnum@openscilab.com"). 

- Please complete the issue template

You can also join our discord server

<a href="https://discord.gg/h8T2F8WpFN">
  <img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
</a>


## Show your support


### Star this repo

Give a ⭐️ if this project helped you!

### Donate to our project
If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .			

<a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/xnum/raw/main/otherfiles/donation.png" width="270" alt="XNum Donation"></a>
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.4] - 2025-08-18
### Added
- Gurmukhi numeral system
- Kannada numeral system
- Telugu numeral system
### Changed
- Test system modified
- `README.md` updated
## [0.3] - 2025-08-05
### Added
- Tibetan numeral system
- Gujarati numeral system
- Odia numeral system
### Changed
- `README.md` updated
## [0.2] - 2025-07-28
### Added
- Thai numeral system
- Khmer numeral system
- Burmese numeral system
- Logo
### Changed
- Test system modified
- `target` parameter bug fixed
- `README.md` updated
## [0.1] - 2025-07-20
### Added
- English numeral system
- Persian numeral system
- Hindi numeral system
- Arabic-Indic numeral system
- Bengali numeral system


[Unreleased]: https://github.com/openscilab/xnum/compare/v0.4...dev
[0.4]: https://github.com/openscilab/xnum/compare/v0.3...v0.4
[0.3]: https://github.com/openscilab/xnum/compare/v0.2...v0.3
[0.2]: https://github.com/openscilab/xnum/compare/v0.1...v0.2
[0.1]: https://github.com/openscilab/xnum/compare/2ed44ad...v0.1
