中華民國財政部統一發票
Project description
invoice-python-lib
中華民國財政部統一發票 - Python
簡介
本程式主要用於取得中華民國財政部統一發票號碼,並用於發票號碼兌獎。
安裝
本地端安裝
git clone git@github.com:as209099/invoice-python-lib.git
python3 -m setup.py install
Pip PyPI安裝
pip install invoice
使用方法
# 初始化時會自動下載當期與上期統一發票之資料
>>> from invoice import Invoice
>>> invoice = Invoice()
# 取得當期民國年與月份
>>> invoice.get_years_and_months()
'111年05-06月'
# 取得當期的開獎發票號碼
>>> invoice.get_numbers()
[['特別獎', '46438476'],
['特獎', '54769852'],
['頭獎', '17858097'],
...]
# 也能取得上期的民國年與月份
>>> invoice.get_previous_years_and_months()
'111年03-04月'
# 以及上期的開獎發票號碼
>>> invoice.get_previous_numbers()
[['特別獎', '32220402'],
['特獎', '99194290'],
...,
['頭獎', '27854976']]
# 兌獎
>>> invoice_list = invoice.get_numbers()
>>> my_numbers = [
'12345678',
'12345677',
...,
'123'
]
>>> prize_list = invoice.redeem(invoice_list, my_numbers)
>>> print(prize_list)
[
['12345678', None],
['12345677', '六獎'],
...,
['123', '格式有誤']
]
使用之Library
enjoy coding!
授權
採用MIT授權條款,可以自行運用,也可以發起Issue或Pull Request給我。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
invoice-1.0.1.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file invoice-1.0.1.tar.gz
.
File metadata
- Download URL: invoice-1.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b937944b239e788f34872f0b2e25a399710aa3b8ca5469b1561a7d4eeeecb710 |
|
MD5 | 62b7e61474d545b7cbf5f6b21545b0c1 |
|
BLAKE2b-256 | 9170aae34b6ce62ed482a2ac5b55f7f99c62db17b8f6efab251e84df6120a74b |
File details
Details for the file invoice-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: invoice-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0299d8c84b5edfa0c908e048a48d45c4332a2e8831b4f1fa0b3cf010c1d57a0e |
|
MD5 | 3ad1c90de7ffdebe0e9cb6cb580da029 |
|
BLAKE2b-256 | 97ff1e12ff434c6936853f596331de4115604f57c3befddc4fbb50e591fa5184 |