semvec/pypi-packages huggingface dataset:
bignumx 1.0.0
A small, easy-to-use wrapper around Python's Decimal with configurable precision and rounding.
License: MIT
Requires Python: >=3.7

# bignumx — Arbitrary-Precision Decimal Numbers for Python

`bignumx` is a tiny wrapper around Python’s built-in [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html) type.

It gives you:

- Easy, consistent handling of **big numbers** (money, crypto, prices, etc.)
- **Configurable precision** (`DP`) and **rounding mode** (`RM`)

Perfect when `float` is too imprecise and you want something safer but still easy to use.

---

## Features

- ✅ Arbitrary-precision decimal arithmetic  
- ✅ Global defaults for decimal places (`DP`) and rounding mode (`RM`)  
- ✅ Minimal, focused API  
- ✅ Works with `str`, `int`, `float`, `Decimal`, and `Big` values  

---

## Installation

If you’ve published this as a package:

```bash
pip install bignumx
```

## Quick Start

```python
from bignumx import Big

# Basic construction
a = Big("0.1")
b = Big("0.2")

# Addition
c = a + b
print(c)           # -> 0.3

# Or using methods, if you added them:
# c = a.add(b)

# Multiplication
d = Big("1.23") * Big("4")
print(d)           # -> 4.92
```

Because Big uses Decimal under the hood, you don’t get the usual floating-point surprises:

```python
from bignumx import Big

print(0.1 + 0.2)        # 0.30000000000000004 (float)
print(Big("0.1") + Big("0.2"))  # 0.3 (Big)
```

## Configuration

`Big` exposes two important global settings:

```python
from bignumx import Big

# Maximum decimal places for division, sqrt, etc.
Big.DP = 20    # default: 20

# Rounding mode (like big.js)
# 0: ROUND_DOWN
# 1: ROUND_HALF_UP      (default)
# 2: ROUND_HALF_EVEN
# 3: ROUND_UP
Big.RM = 1
```

Internally, these map to decimal’s rounding modes via _ROUND_MAP.

You can also use decimal.localcontext() for temporary precision overrides inside your own code, but for most use cases, setting Big.DP and Big.RM is enough.

## Creating Big Numbers

```python
from bignumx import Big
from decimal import Decimal

Big("1.2345")         # from string
Big(12345)            # from int
Big(1.2345)           # from float (not recommended for exact finance values)
Big(Decimal("1.2345"))# from Decimal
Big(Big("1.2345"))    # from another Big
```

Under the hood, the constructor converts the value to a Decimal and stores it as self._d.

## Arithmetic

The exact API here depends on how you implemented `Big`.

Below is a typical pattern using operator overloading.

### Addition

```python
x = Big("1.1")
y = Big("2.2")
print(x + y)      # -> 3.3
```

### Subtraction

```python
x = Big("5")
y = Big("2.5")
print(x - y)      # -> 2.5
```

### Multiplication

```python
x = Big("1.5")
y = Big("3")
print(x * y)      # -> 4.5
```

### Division

Division respects Big.DP and Big.RM:

```python
from bignumx import Big

Big.DP = 10
Big.RM = 1  # ROUND_HALF_UP

x = Big("1")
y = Big("3")

print(x / y)  # -> 0.3333333333  (10 decimal places)
```

## License

MIT License

Copyright (c) 2026 Jack Dolan
speXtra 0.43.1
Tool to manage and manipulate astronomical spectra.
License: MIT
Requires Python: <3.15,>=3.10
Keywords: astronomy

<img src="https://raw.githubusercontent.com/AstarVienna/spextra/main/docs/_static/images/speXtra_logo.png" width="400pt">

# SpeXtra

[![Tests](https://github.com/AstarVienna/speXtra/actions/workflows/tests.yml/badge.svg)](https://github.com/AstarVienna/speXtra/actions/workflows/tests.yml)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
![dev version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FAstarVienna%2FspeXtra%2Fmain%2Fpyproject.toml&query=%24.project.version&label=dev%20version&color=teal)
![GitHub Release Date](https://img.shields.io/github/release-date/AstarVienna/speXtra)

[![Documentation Status](https://readthedocs.org/projects/spextra/badge/?version=latest)](https://speXtra.readthedocs.io/en/latest)
[![codecov](https://codecov.io/gh/AstarVienna/speXtra/graph/badge.svg)](https://codecov.io/gh/AstarVienna/speXtra)
[![PyPI - Version](https://img.shields.io/pypi/v/speXtra)](https://pypi.org/project/speXtra/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/speXtra)

![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

A python tool to manage and manipulate astronomical spectra


## Description

``speXtra`` is a python tool to download, load, display and manipulate spectra of astronomical sources.
It has developed to provide spectral sources to [ScopeSim](https://scopesim.readthedocs.io/en/latest/) but it may be helpful for other purposes too.

speXtra stands in the shoulder of giants: [synphot](https://synphot.readthedocs.io/en/latest/) and [astropy](https://www.astropy.org/).

To install ``spextra`` simply run:

```bash
pip install spextra
```

## Functionalities

``speXtra`` is able to:

- Download spectra from a database and return it in format compatible with ``synphot`` format.

```python
from spextra import Spextrum
sp = Spextrum("kc96/s0")
```

and it will load the S0 galaxy template of the Kinney-Calzetti spectral library. To quickly
plot the resulting spectra, simply type

```python
sp.plot()
```
<img src="https://raw.githubusercontent.com/AstarVienna/spextra/main/docs/_static/images/kc96_S0.png" width="400pt">