2026-02-27 12:38:21 -05:00
2026-02-27 12:37:54 -05:00
2026-02-20 13:37:37 -05:00
2026-02-25 23:21:19 -05:00
2026-02-15 09:58:31 -05:00
2026-02-14 12:41:12 -05:00
2026-02-20 13:37:37 -05:00
2026-02-14 12:41:12 -05:00
2026-02-27 12:38:21 -05:00
2026-02-25 14:09:39 -05:00

Lottery_Project

A Python project to analyze and pick lottery numbers using past draw results to predict future draws.

Draw Dates

Mega Millions drawings are held every Tuesday and Friday. Powerball drawings are held every Monday, Wednesday, and Friday. In order to conserve processing cycles, the predictor will only request new data if there is the potential for new drawings to collect and save.

Storage

The data will eventually be stored in database tables for faster execution. This will also allow for dynamic calls for more data based on the draw dates and last drawing stored locally.

Database Engine

Sqlite has been chosen for portability and ease of use.

Historical Info

The first Powerball drawing was on April 22, 1992. The first Mega Millions drawing was on September 6, 1996. The original name was "The Big Game" and was rebranded to Mega Millions in May 2002.

However, each game has undergone rule changes that have altered the pool of numbers available for the main (white) balls and their respective game balls as well. Due to this, the historical information used to analyze the draws should start at the most recent rule change date.

The most recent change for Powerball was on October 4, 2015, when the main ball pool increased from 59 to 69 numbers and the Powerball pool reduced from 35 to 26 numbers.

The most recent change for Mega Millions was on April 5, 2025, when the Megaball ball pool was decreased from 25 to 24 numbers as well as the addition of a 10x multiplier. The existing pool of 70 numbers for the main game ball pool was part of changes made on October 28, 2017.

Historical results can be scraped from the web and added to the database from the URLs below. The results must be scraped by year. Changing the year in the URLs alters the resultset displayed.

Powerball: https://www.lotto.net/powerball/numbers/1992
Mega Millions: https://www.lotto.net/mega-millions/numbers/1996

Historical Information Sources

Environment Variables

To facilitate environment variables for testing or execution, create a .env file in the root folder of the project and add the following lines to it:

DATABASE_URL="sqlite:///predictor.db"
POWERBALL_INCEPTION="1992"
MEGA_MILLIONS_INCEPTION="1996"
BASE_SCRAPE_URL="https://www.lotto.net/"
TARGET_CONTAINER="div"
TARGET_CLASS="archive-container"
BALL_CLASS="ball ball"
POWERBALL_CLASS="ball powerball"
MEGABALL_CLASS="ball mega-ball"
POWERBALL_MULTIPLIER_CLASS="ball power-play"
MEGA_MILLIONS_MULTIPLIER_CLASS="ball megaplier"
DATE_CLEAN_REGEX="r'(st|nd|rd|th)'"
DATE_INPUT_FORMAT="%B %d %Y"

TO-DOs

  1. Review standard tests for sqlalchemy objects
  2. Decide which DBE to use for data storage
  3. Continue starter code review
S
Description
A Python project to analyze and pick lottery numbers using past draw results to predict future draws.
Readme
352 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 99.1%
Mako 0.9%