Factories for randomised AFL data sets for testing purposes
Project description
candystore
Factories for randomised AFL data sets, selling candy to your unit tests.
The shape and content of the data is based on what's returned by the R package fitzRoy
, which gets most of its data from the sites Footywire and AFLTables. The column names are converted to snake_case
for convenience.
Data is randomised as much as is reasonably possible, with the following exceptions intended to make the data realistic:
- Teams are all real, using the naming conventions of AFLTables.
- Venues are all real, using the naming conventions of AFLTables.
- Seasons can range from 1897 to the current year (inclusive).
- Matches take place from 15th March to 30th September (inclusive), starting no earlier than 12pm and no later than 8pm.
- There's one round per week, and it lasts from Wednesday to Tuesday (inclusive).
- Each team only plays once per round.
Installation
pip3 install candystore
import candystore
Usage
All functions for generating data accept a seasons
argument for defining which years to use.
- An integer indicates the number of seasons to build, but permits them to start in any valid year (all seasons will still be sequential).
- A tuple of two integers indicates the specific range of years for which to build seasons.
Fixtures
candystore.generate_fixtures(seasons=1)
[
{
'date': '1967-03-16 12:37:19',
'season': 1967,
'season_game': 1,
'round': 1,
'home_team': 'Melbourne',
'away_team': 'Brisbane Lions',
'venue': 'Sydney Showground'
},
...
{
'date': '1967-09-26 18:06:32',
'season': 1967,
'season_game': 280,
'round': 28,
'home_team': 'University',
'away_team': 'Brisbane Lions',
'venue': 'Brunswick St'
}
]
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
candystore-0.1.0.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for candystore-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21fdc14cedf566c5145063071bf42d3b962f2f6f39e473f320d1238484755b46 |
|
MD5 | e420d72b78b0f0e53cbe701ad2006b17 |
|
BLAKE2b-256 | 8ec2ef0608f336bbbc9db4300e52629e4656525a66d72f18aa8b9857c9db65c9 |