Confidence Interval Library
A Python library for calculating and visualizing confidence intervals.
Installation
pip install confidence_interval
Features
- Calculate confidence intervals for means
- Calculate confidence intervals for proportions using:
- Wilson score method (recommended for small sample sizes)
- Normal approximation method (for large sample sizes)
- Visualize confidence intervals with customizable plots
- Support for both list and numpy array inputs
- Comprehensive error checking and validation
Usage
Mean Confidence Interval
from confidence_interval.core import mean_confidence_interval
import numpy as np
data = np.random.normal(100, 15, size=50)
ci = mean_confidence_interval(data, confidence=0.95)
print(f"Mean: {ci.estimate:.2f}")
print(f"95% CI: ({ci.lower_bound:.2f}, {ci.upper_bound:.2f})")
Proportion Confidence Interval
from confidence_interval.core import proportion_confidence_interval
successes = 45
total = 100
ci = proportion_confidence_interval(successes, total, confidence=0.95, method='wilson')
print(f"Proportion: {ci.estimate:.2f}")
print(f"95% CI: ({ci.lower_bound:.2f}, {ci.upper_bound:.2f})")
Development
This project uses GitHub Actions for automated testing and deployment. The workflow includes:
- Automated tests on Python versions 3.8-3.12
- Automatic releases when tags are pushed
- Automated PyPI publishing
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
pytest tests/) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Release Process
The release process is automated through GitHub Actions:
- Update version in
setup.py - Add entry to
CHANGELOG.md - Commit changes
- Create and push a tag:
git tag -a v0.x.x -m "Release version 0.x.x" git push origin v0.x.x
- GitHub Actions will automatically:
- Create a GitHub release
- Run tests
- Publish to PyPI
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a list of changes and version history.
Metadata
Release files for stats-confidence-intervals 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stats_confidence_intervals-0.2.3.tar.gz | 16.2 kB | Without provenance | Details for stats_confidence_intervals-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stats_confidence_intervals-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for stats_confidence_intervals-0.2.3-py3-none-any.whl |
Total release size: 20.6 kB
Release files / stats_confidence_intervals-0.2.3.tar.gz
| Download URL | stats_confidence_intervals-0.2.3.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52ae5e0d38041d47c6979ee592c8b98adcc485eb434ff2b4000d07caf6202660
|
|
BLAKE2b-256 checksum How to use checksums |
ddfd672f4b3eb0c54f7cf0fc337567e14b17212dbcac4d63c6293fd7c5a12764
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / stats_confidence_intervals-0.2.3-py3-none-any.whl
| Download URL | stats_confidence_intervals-0.2.3-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4932fc9b3c7536b1aa7896786ba6251a72bac38aac4211f96a112bf4dbd60eec
|
|
BLAKE2b-256 checksum How to use checksums |
3a2b994fbdc9489e6ea88e18055e1dd522fe86a81f9dfc2912965aa6b83687b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for stats-confidence-intervals 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.