Skip to main content

A package for getting lottery data from mpi.gov.tr(Turkish Lottery)

Project description

Milli Piyango Package

This is a package for getting lottery related data from Milli Piyango.

Installation

pip install milli-piyango

Usage

For most case:

from milli_piyango import MilliPiyango as mP


# Getting available game list
print(mP.GAME_LIST)

# Get available drawing dates for given games
# Available game names
# - mP.PIYANGO
# - mP.SAYISAL
# - mP.SANS_TOPU
# - mP.ON_NUMARA
# - mP.SUPER_LOTO
dates = mP().get_draw_dates(mP.ON_NUMARA)
# [ {'tarih': '20180730', 'tarihView': '30-07-2018'}, ... ]

# Get game result for given date
last_drawing_result = mP().get_result(mP.ON_NUMARA, dates[0]['tarih']) # For the last drawing result

# Winner numbers in order 
print(last_drawing_result['data']['rakamlarNumaraSirasi'])
# '08 - 11 - 15 - 16 - 17 - 18 - 20 - 25 - 28 - 30 - 34 - 39 - 40 - 43 - 48 - 53 - 59 - 64 - 66 - 67 - 71 - 79'

If you want to search a number (ticket number) is winner or not in Piyango game;

from milli_piyango import MilliPiyango as mP


mP().get_result_for_piyango("20180729", "179604") # First parameter is Date, second one is Ticket Number
# {'kazandi': True, 'tip': '$6_RAKAM', 'ikramiye': 2500000, 'kacBildi': 6, 'numara': '179604', 'biletNo': '179604'}
mP().get_result_for_piyango("20180729", "178630")
# {'kazandi': True, 'tip': 'SON_BES_RAKAM', 'ikramiye': 400, 'kacBildi': 5, 'numara': '78630', 'biletNo': '178630'}
mP().get_result_for_piyango("20180729", "189604")
# {'kazandi': True, 'tip': 'AMORTI', 'ikramiye': 24, 'kacBildi': 1, 'numara': '4', 'biletNo': '189604'}
mP().get_result_for_piyango("20180729", "123452")
# {'kazandi': False, 'biletNo': '123452'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for milli-piyango, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size milli_piyango-1.1.0-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size milli_piyango-1.1.0.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page