https://github.com/inverse/python-premium-bond-checker
Simple premium bond checker library
https://github.com/inverse/python-premium-bond-checker
library premium-bond python
Last synced: 8 months ago
JSON representation
Simple premium bond checker library
- Host: GitHub
- URL: https://github.com/inverse/python-premium-bond-checker
- Owner: inverse
- License: other
- Created: 2022-06-28T19:54:22.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T13:14:39.000Z (over 1 year ago)
- Last Synced: 2025-02-03T14:24:38.628Z (over 1 year ago)
- Topics: library, premium-bond, python
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Premium Bond Checker

[](https://badge.fury.io/py/premium-bond-checker)

[](LICENSE)
[](https://github.com/astral-sh/ruff)
[](https://codecov.io/github/inverse/python-premium-bond-checker)
Simple premium bond checker library that is built against [Nsandi](https://www.nsandi.com/).
## Usage
### Check the next draw date
You can check the next draw date, which is calculated from the first working day of the month.
```python
from premium_bond_checker.client import Client
print(f"Next draw: {Client.next_draw()}")
```
### Check the next draw date revealed by
Results are not always revealed when the results are drawn. It can take upto 3 additional days for this to happen.
```python
from premium_bond_checker.client import Client
print(f"Next draw reveal by: {Client.next_draw_results_reveal_by()}")
```
### Check results
Results can be checked either granular or on all data points.
```python
from premium_bond_checker.client import Client
premium_bond_number = 'your bond number'
client = Client()
# Check if you've won
result = client.check(premium_bond_number)
print(f"Winning: {result.has_won()}")
# More granular breakdown
result_this_month = client.check_this_month(premium_bond_number)
print(f"This Month Winning: {result_this_month.won}")
print(f"This Month Header: {result_this_month.header}")
print(f"This Month Tagline: {result_this_month.tagline}")
result_last_six_months = client.check_last_six_months(premium_bond_number)
print(f"This Month Winning: {result_last_six_months.won}")
print(f"This Month Header: {result_last_six_months.header}")
print(f"This Month Tagline: {result_last_six_months.tagline}")
result_check_unclaimed = client.check_unclaimed(premium_bond_number)
print(f"This Month Winning: {result_check_unclaimed.won}")
print(f"This Month Header: {result_check_unclaimed.header}")
print(f"This Month Tagline: {result_check_unclaimed.tagline}")
```
## License
MIT