Metadata-Version: 2.4
Name: radixhopper
Version: 1.0.0
Summary: A Python library for efficient radix-based number system conversions, specializing in cyclic fractions handling, for bases 2 through 36.
Project-URL: Documentation, https://github.com/aarmn/radixhopper#readme
Project-URL: Issues, https://github.com/aarmn/radixhopper/issues
Project-URL: Source, https://github.com/aarmn/radixhopper
Author-email: aarmn <aarmn80@gmail.com>
License: MIT License
        
        Copyright (c) 2024-present Aarmn the limitless <aarmn80@gmail.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License-File: LICENSE
Keywords: bases,conversion,cyclic fractions,math,mathematics,number system,radix
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
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: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: typeguard>=4.4.0
Requires-Dist: typer>=0.15.2
Provides-Extra: cli
Requires-Dist: fire>=0.4.0; extra == 'cli'
Requires-Dist: rich; extra == 'cli'
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: uv; extra == 'dev'
Description-Content-Type: text/markdown

# ✨ RadixHopper ✨

[![PyPI - Version](https://img.shields.io/pypi/v/radixhopper.svg)](https://pypi.org/project/radixhopper)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/radixhopper.svg)](https://pypi.org/project/radixhopper)

-----

🌟 Hop between number bases with ease! 🌟

RadixHopper is a python library and terminal utility for flexible numerical radix (a.k.a base) conversions, specializing in cyclic fractions handling, for arbitrary bases with arbitrary digits, with sane default and crazy levels of customization.

## ✨ Features

- 🔢 Convert numbers between radices 2 to 36 out-of-the-box, and more with custom digits!
- 🧑‍🔬 Support for scientific notation
- 🦅 Arbitrary precision operations, by leveraging fractions
- 🖥️ Support for `0x`, `0o` and `0b` format
- 🔄 Handle cyclic fractions with grace
- 🚀 Fast evaluations with conversion buffering
- 📓 Jupyter notebook support
- 🎨 Intuitive CLI interface
- 🌈 And alot more...

## 🌠 Installation

Sprinkle some magic into your Python environment:

```sh
pip install radixhopper
```

## 🎭 Usage

### As a library

```python
from radixhopper import RadixNumber

# Create a RadixNumber instance from a string in base 10
num = RadixNumber("3.14", base=10)

# Convert it to base 2
result = num.to(base=2)

# Print the representation in base 2
print(f"{result!r}") # or simply `>>> result` or print(repr(result))
# >>> RadixNumber(number=11.0[01000111101011100001], representation_base=2, digits=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ, case_sensitive=False, fraction=(157/50))

# Access the string representation directly
print(result)
# >>> 11.0[01000111101011100001]

# Perform operations
num2 = RadixNumber("1.1", base=2) # Represents 1.5 in base 10
sum_result = num + num2 # Operations default to Fraction representation
print(sum_result) # >>> 100.[10100011110101110000]
print(sum_result.to(base=10)) # >>> 4.64
```

### CLI

```sh
radixhopper 3.14 --from 10 --to 2
```

or simply

```sh
radixhopper 3.14 10 2
```

## 🌟 Contributing

We welcome contributions! Please check our [Issues](https://github.com/aarmn/radixhopper/issues) page for open tasks or suggest new features.

## 📜 License

`radixhopper` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

## 🌠 Star Gazing

```
   *  .  . *       *    .        .        .   *    ..
  .    *        .   ✨    .      .     *   .         *
    *.   *    .    .    *    .    *   .    .   *
  .   .     *     .   ✨     .        .       .     .
    .    *.      .     .    *    .    *   .    .  *
  *   .    .    .    .      .      .         .    .
    .        .    . ✨      *   .    .   *     *
  .    *     *     .     .    *    .    *   .    .
    .    .        .           .      .        .
  *     .    . *    .     *     .        .     *
```

Happy hopping! ✨🐰✨
