Metadata-Version: 2.4
Name: numberdividend
Version: 0.1.2
Summary: A tool for dividend distribution analysis.
Home-page: https://github.com/SaboIch/NumberDividend
Author: Sabolch
Author-email: sabolch.dev@gmail.com
License: MIT
Keywords: dividend distribution analysis
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.0.0
Requires-Dist: matplotlib>=3.0.0
Requires-Dist: numpy>=1.0.0
Requires-Dist: argparse>=1.4.0
Requires-Dist: typing>=3.6.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# NumberDividend

A simple Python package to split a list of numbers so that their sum matches a target value.

## Installation
```bash
pip install numberdividend
```
## Usage
You can use it as a module:
```python
from numberdividend import NumberCore

array = [1, 2, 3, 5, 6]

div = NumberCore.dividend(array, 900, 3, 5)
NumberCore.display(div)
```
___
```python
NumberCore.dividend(array, target_sum, limit, decimal)
```
Calculate the dividend distribution of an array.
| Value | Type | Description |
|--|--|--|
| array | List[float] | List of float numbers to be distributed. |
| target_sum | float | Target sum for the distribution. |
| limit | int, optional | Maximum number of elements to consider from the array. |
| decimal | int, optional | Number of decimal places for the output. |
| return | List[Tuple[float, float]] | List of tuples containing the index and the dividend value |
___
```python
NumberCore.display(array)
```
Display the dividend distribution using matplotlib.
| Value | Type | Description |
|--|--|--|
| array | List[float] | List of dividend values to be displayed. |
___
### CLI Usage
```bash
python -m numberdividend C:\User\path\...\input.csv 300 C:\User\path\...\output.csv --limit 30 --display
```
⚠️ Only `.csv` files are supported as input.
Structure of `input.csv`:
| No column name |
|--|
| 1 |
| 2 |
| 3 |
| 5 |
| 9 |
___
Command struct
| Value | Type | Description |
|--|--|--|
| path | str | Input file path |
| target | int | Value of sum the array |
| save | str | Output file path |
| --limit | int | Optional limit on the number of elements considered |
| --display | none | Optional displays the processed array |
### License
MIT
### Author
Sabolch - [Github profile](https://github.com/SaboIch)
