Name | d3d4.pyavg JSON |
Version |
0.1.2
JSON |
| download |
home_page | None |
Summary | Average value calculation |
upload_time | 2024-11-25 07:16:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License |
keywords |
average
avg
stat
pyavg
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pyavg
`pyavg` is a Python library that provides a set of classes for calculating averages from input data using various methods. It supports both basic and specialized smoothing and filtering algorithms.
---
## Installation
You can install the library via PyPI:
```bash
pip install d3d4.pyavg
```
## Key Features
The library offers classes for different average calculation methods, including:
1. Basic Moving Average (bi_avg.Stat)
2. Cumulative Average (cumulative.Stat)
3. Exponential Smoothing (exp_smooth.Stat)
4. PID Controller-Based Average (pid.Stat)
5. Ring Buffer for Averaging (ring_buff.Stat)
6. Advanced Smoothing Algorithms (smooth.Stat)
Each class implements a common interface, making it easy to switch between methods as needed.
## Usage Examples
### Basic Moving Average
```python
from pyavg import BiAvgStat
# Create an object for moving average calculation
stat = BiAvgStat(window_size=5)
# Add values
stat.add(10)
stat.add(20)
stat.add(30)
# Get the current average
print(stat.get_average()) # -> 20.0
```
### Cumulative Average
```python
from pyavg import CumulativeStat
# Create an object for cumulative average calculation
stat = CumulativeStat()
# Add values
stat.add(10)
stat.add(20)
stat.add(30)
# Get the current average
print(stat.get_average()) # -> 20.0
```
### Exponential Smoothing
```python
from pyavg import ExpSmoothStat
# Create an object for exponential smoothing
stat = ExpSmoothStat(alpha=0.5)
# Add values
stat.add(10)
stat.add(20)
stat.add(30)
# Get the current smoothed value
print(stat.get_average()) # -> smoothed value
```
## Documentation
Each class provides the following key methods:
- `add(value: float):` adds a new value to the calculation.
- `get_average() -> float:` returns the current average.
For details on implementation and additional parameters, refer to the source code or library documentation.
## Requirements
- Python 3.6 or higher.
## License
This project is licensed under the MIT License. See the LICENSE file for more details.
## Contribution
If you’d like to contribute or add a new average calculation method, feel free to submit a Pull Request or reach out through [GitHub Issues](https://github.com/ehles/ehles.pyAvg/issues).
Raw data
{
"_id": null,
"home_page": null,
"name": "d3d4.pyavg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "average, avg, stat, pyavg",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/de/d0/a6556b6418ef46712267b1ee25c533d9e04cd478b080339f341140435d3e/d3d4_pyavg-0.1.2.tar.gz",
"platform": null,
"description": "# pyavg\n\n`pyavg` is a Python library that provides a set of classes for calculating averages from input data using various methods. It supports both basic and specialized smoothing and filtering algorithms.\n\n---\n\n## Installation\n\nYou can install the library via PyPI:\n\n```bash\npip install d3d4.pyavg\n```\n\n## Key Features\n\nThe library offers classes for different average calculation methods, including:\n\n1. Basic Moving Average (bi_avg.Stat)\n2. Cumulative Average (cumulative.Stat)\n3. Exponential Smoothing (exp_smooth.Stat)\n4. PID Controller-Based Average (pid.Stat)\n5. Ring Buffer for Averaging (ring_buff.Stat)\n6. Advanced Smoothing Algorithms (smooth.Stat)\n\nEach class implements a common interface, making it easy to switch between methods as needed.\n\n## Usage Examples\n\n### Basic Moving Average\n\n```python\nfrom pyavg import BiAvgStat\n\n# Create an object for moving average calculation\nstat = BiAvgStat(window_size=5)\n\n# Add values\nstat.add(10)\nstat.add(20)\nstat.add(30)\n\n# Get the current average\nprint(stat.get_average()) # -> 20.0\n```\n\n### Cumulative Average\n\n```python\nfrom pyavg import CumulativeStat\n\n# Create an object for cumulative average calculation\nstat = CumulativeStat()\n\n# Add values\nstat.add(10)\nstat.add(20)\nstat.add(30)\n\n# Get the current average\nprint(stat.get_average()) # -> 20.0\n```\n\n### Exponential Smoothing\n\n```python\nfrom pyavg import ExpSmoothStat\n\n# Create an object for exponential smoothing\nstat = ExpSmoothStat(alpha=0.5)\n\n# Add values\nstat.add(10)\nstat.add(20)\nstat.add(30)\n\n# Get the current smoothed value\nprint(stat.get_average()) # -> smoothed value\n```\n\n## Documentation\n\nEach class provides the following key methods:\n\n- `add(value: float):` adds a new value to the calculation.\n- `get_average() -> float:` returns the current average.\n\nFor details on implementation and additional parameters, refer to the source code or library documentation.\n\n## Requirements\n\n- Python 3.6 or higher.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\n## Contribution\n\nIf you\u2019d like to contribute or add a new average calculation method, feel free to submit a Pull Request or reach out through [GitHub Issues](https://github.com/ehles/ehles.pyAvg/issues).\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Average value calculation",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/ehles/ehles.pyavg",
"Repository": "https://github.com/ehles/ehles.pyavg.git"
},
"split_keywords": [
"average",
" avg",
" stat",
" pyavg"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6af068e865f982a0cd324fdb9f90f758e05703c5384e6c3b8f2df03a290f6b34",
"md5": "68fbaa7bd1f743d7cd7e67c13a6694d2",
"sha256": "aa1cb3416efc2ab40d5e9703f43fdb66a9386e335e71db6850a40bff11a7ec62"
},
"downloads": -1,
"filename": "d3d4.pyavg-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "68fbaa7bd1f743d7cd7e67c13a6694d2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6458,
"upload_time": "2024-11-25T07:15:58",
"upload_time_iso_8601": "2024-11-25T07:15:58.498450Z",
"url": "https://files.pythonhosted.org/packages/6a/f0/68e865f982a0cd324fdb9f90f758e05703c5384e6c3b8f2df03a290f6b34/d3d4.pyavg-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ded0a6556b6418ef46712267b1ee25c533d9e04cd478b080339f341140435d3e",
"md5": "74a45b0ddf21e7be0582ad68c5fcad65",
"sha256": "ac71ae4bd7049c885969398fa419a0c765558ba459d3a46f8091ba11c4aed8bc"
},
"downloads": -1,
"filename": "d3d4_pyavg-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "74a45b0ddf21e7be0582ad68c5fcad65",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4761,
"upload_time": "2024-11-25T07:16:00",
"upload_time_iso_8601": "2024-11-25T07:16:00.131519Z",
"url": "https://files.pythonhosted.org/packages/de/d0/a6556b6418ef46712267b1ee25c533d9e04cd478b080339f341140435d3e/d3d4_pyavg-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-25 07:16:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ehles",
"github_project": "ehles.pyavg",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "d3d4.pyavg"
}