What is this?
A Python API and script for the retrieval and storage of Play Whe results from the National Lotteries Control Board (NLCB) website.
Why was this written?
- Short answer:
Because it can be written.
- Slightly longer answer:
Because I was looking for a small Python project to work on for practice.
Which version do I have?
Version 0.7.1.
After installing the package you can also check the version number by issuing the following command at a shell prompt.
$ playwhe.py --version
What has changed from version 0.6 to 0.7?
The NLCB website occasionally has incorrect results. More often than not the draw numbers are the culprit. However, if we order the data by date, then by period and then by draw number we can mitigate any ill effects this bad data causes. This version attempts to fix the problem by doing just that.
What has changed from version 0.5 to 0.6?
On July 6th, 2015 the NLCB started drawing Play Whe 4 times per day. The script was changed to correctly scrape the 4:00 PM draw.
Also, previously the “period” stored with the results was changed from a numeric format “(1, 2, 3)” to a string format “(‘EM’, ‘AM’, ‘AN’, ‘PM’)”.
What has changed from version 0.4 to 0.5?
Around February 21st, 2015 the NLCB took down their website to redesign and rebuild it. They changed the service URL along with the format of the HTML results. This required an update to the parser to ensure that the results could still be retrieved in the future.
What has changed from version 0.3 to 0.4?
On November 21st, 2011 the NLCB started drawing Play Whe 3 times per day. Due to this change the display format of the results retrieved via their website was changed. Since this program simply scrapes the HTML off their results page, I needed to update the script to work with the new format.
Hence, the logic for retrieving and storing the Play Whe results have changed. However, the interface to perform these operations have not.
How do I install it?
$ tar xvzf playwhe-0.7.1.tar.gz $ cd playwhe-0.7.1 $ sudo python setup.py install
What are some of the things it can do?
You can get Play Whe results directly from NLCB using the playwhe module.
import playwhe p = playwhe.PlayWhe() # retrieve and display all the results for the month of April in the year 2011 print "\n\n".join(map(lambda r: r.prettyprint(), p.results_for_month(2011, 4))) # retrieve and display the results for April 2nd, 2011 print "\n\n".join(map(lambda r: r.prettyprint(), p.results_for_day(2011, 4, 2))) # retrieve and display the three most recent results print "\n\n".join(map(lambda r: r.prettyprint(), p.results()))
You can get Play Whe results directly from NLCB using the playwhe.py script.
$ echo Retrieve and display the results for the month of April in the year 2011 $ playwhe.py --pretty-print --date=2011-04 $ playwhe.py -p -d 2011-04 $ echo Retrieve and display the results for April 2nd, 2011 $ playwhe.py --pretty-print --date=2011-04-02 $ playwhe.py -p -d 2011-04-02 $ echo Retrieve and display the three most recent results $ playwhe.py --pretty-print $ playwhe.py -p
You can keep a local copy of previous Play Whe results in an SQLite database.
$ echo Create and initialize a Play Whe database $ playwhe.py --createdb="/home/<username>/playwhe.db" $ playwhe.py -c "/home/<username>/playwhe.db" $ echo Update the Play Whe database $ playwhe.py --updatedb="/home/<username>/playwhe.db" $ playwhe.py -u "/home/<username>/playwhe.db" $ echo Update the Play Whe database and keep a log $ playwhe.py -u "/home/<username>/playwhe.db" 2>> "/home/<username>/playwhe.log"
Where can I get the latest development version of this project?
This project is hosted on GitHub at https://github.com/dwayne/playwhe.
$ git clone git://github.com/dwayne/playwhe.git
What liscense does this project use?
This project is in the public domain. Do with it whatever you want.
Where can I get help?
> import playwhe > help(playwhe) $ playwhe.py --help
You can also get help, report bugs, make suggestions or ask thoughtful questions by contacting Dwayne R. Crooks via email at <me at dwaynecrooks dot com>.
Metadata
Release files for playwhe 0.7.1
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 |
|---|---|---|---|---|
| playwhe-0.7.1.tar.gz | 7.0 kB | Without provenance | Details for playwhe-0.7.1.tar.gz |
Release files / playwhe-0.7.1.tar.gz
| Download URL | playwhe-0.7.1.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1149fadd7b54797ba8279e0a89ae1dcd5c21d751c453b90e191739d53672f8a8
|
|
BLAKE2b-256 checksum How to use checksums |
7d4752fbd03ceda7854fd2b1b674ef0ec1b6e5345c22c998119d15f985195c94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for playwhe 0.7.1
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.