Skip to content

Latest commit

 

History

History
213 lines (192 loc) · 14.5 KB

readme.md

File metadata and controls

213 lines (192 loc) · 14.5 KB

Vietlot data

Data crawling from https://vietlott.vn/, results for products:

Table of content

Predictions (just for testing, not a financial advice)

These are backtest results for the strategies I have tested (just the abstract method at the moment, you can't predict lotery lol)

random strategy

predicted: 20 / day (20 tickets perday or 200,000 vnd) predicted corrected:

date result predicted

raw details 6/55 last 10 days

date id result page process_time
2024-12-21 01129 [4, 16, 29, 30, 35, 51, 48] 0 2024-12-23 16:21:56.452504
2024-12-19 01128 [13, 16, 32, 39, 49, 51, 11] 0 2024-12-23 16:21:56.452645
2024-12-17 01127 [2, 14, 27, 30, 53, 54, 16] 0 2024-12-23 16:21:56.452777
2024-12-14 01126 [3, 10, 19, 20, 21, 24, 7] 0 2024-12-16 12:55:37.831668
2024-12-12 01125 [1, 9, 12, 18, 37, 44, 11] 0 2024-12-16 12:55:37.831810
2024-12-10 01124 [11, 15, 26, 45, 52, 55, 36] 0 2024-12-16 12:55:37.831894
2024-12-07 01123 [16, 17, 22, 24, 29, 37, 54] 0 2024-12-16 12:55:37.831974
2024-12-05 01122 [16, 21, 29, 41, 42, 47, 9] 0 2024-12-16 12:55:37.832054
2024-12-03 01121 [10, 19, 33, 39, 47, 54, 16] 0 2024-12-16 12:55:37.832134
2024-11-30 01120 [1, 20, 24, 26, 38, 41, 36] 0 2024-12-16 12:55:37.832210

stats 6/55 all time

result count % - result count % - result count %
1 156 1.97 21 138 1.75 41 164 2.08
2 133 1.68 22 163 2.06 42 141 1.78
3 155 1.96 23 157 1.99 43 158 2.0
4 126 1.59 24 143 1.81 44 149 1.89
5 144 1.82 25 134 1.7 45 139 1.76
6 124 1.57 26 133 1.68 46 153 1.94
7 124 1.57 27 132 1.67 47 143 1.81
8 151 1.91 28 127 1.61 48 151 1.91
9 159 2.01 29 149 1.89 49 150 1.9
10 135 1.71 30 123 1.56 50 142 1.8
11 149 1.89 31 149 1.89 51 163 2.06
12 156 1.97 32 152 1.92 52 149 1.89
13 136 1.72 33 146 1.85 53 151 1.91
14 139 1.76 34 158 2 54 140 1.77
15 133 1.68 35 149 1.89 55 143 1.81
16 133 1.68 36 135 1.71
17 131 1.66 37 127 1.61
18 145 1.83 38 136 1.72
19 141 1.78 39 134 1.7
20 156 1.97 40 155 1.96

stats 6/55 -15d

result count % - result count % - result count %
1 3 3.57 24 4 4.76 48 1 1.19
2 1 1.19 26 2 2.38 49 1 1.19
3 1 1.19 27 1 1.19 51 2 2.38
4 1 1.19 28 1 1.19 52 1 1.19
7 1 1.19 29 3 3.57 53 2 2.38
8 1 1.19 30 2 2.38 54 3 3.57
9 3 3.57 32 2 2.38 55 1 1.19
10 2 2.38 33 1 1.19
11 4 4.76 35 1 1.19
12 2 2.38 36 2 2.38
13 1 1.19 37 2 2.38
14 1 1.19 38 2 2.38
15 1 1.19 39 2 2.38
16 8 9.52 40 1 1.19
17 1 1.19 41 2 2.38
18 1 1.19 42 1 1.19
19 2 2.38 43 1 1.19
20 2 2.38 44 1 1.19
21 2 2.38 45 1 1.19
22 1 1.19 47 2 2.38

stats 6/55 -30d

result count % - result count % - result count %
1 3 3.57 24 4 4.76 48 1 1.19
2 1 1.19 26 2 2.38 49 1 1.19
3 1 1.19 27 1 1.19 51 2 2.38
4 1 1.19 28 1 1.19 52 1 1.19
7 1 1.19 29 3 3.57 53 2 2.38
8 1 1.19 30 2 2.38 54 3 3.57
9 3 3.57 32 2 2.38 55 1 1.19
10 2 2.38 33 1 1.19
11 4 4.76 35 1 1.19
12 2 2.38 36 2 2.38
13 1 1.19 37 2 2.38
14 1 1.19 38 2 2.38
15 1 1.19 39 2 2.38
16 8 9.52 40 1 1.19
17 1 1.19 41 2 2.38
18 1 1.19 42 1 1.19
19 2 2.38 43 1 1.19
20 2 2.38 44 1 1.19
21 2 2.38 45 1 1.19
22 1 1.19 47 2 2.38

stats 6/55 -60d

result count % - result count % - result count %
1 4 2.29 21 3 1.71 42 3 1.71
2 2 1.14 22 3 1.71 43 2 1.14
3 1 0.57 24 5 2.86 44 1 0.57
4 2 1.14 25 2 1.14 45 3 1.71
5 2 1.14 26 5 2.86 46 1 0.57
6 2 1.14 27 2 1.14 47 4 2.29
7 2 1.14 28 2 1.14 48 3 1.71
8 1 0.57 29 6 3.43 49 3 1.71
9 6 3.43 30 3 1.71 50 1 0.57
10 3 1.71 31 5 2.86 51 8 4.57
11 5 2.86 32 2 1.14 52 2 1.14
12 4 2.29 33 3 1.71 53 2 1.14
13 1 0.57 34 3 1.71 54 6 3.43
14 3 1.71 35 2 1.14 55 2 1.14
15 2 1.14 36 3 1.71
16 10 5.71 37 4 2.29
17 3 1.71 38 2 1.14
18 1 0.57 39 6 3.43
19 5 2.86 40 5 2.86
20 5 2.86 41 4 2.29

stats 6/55 -90d

result count % - result count % - result count %
1 4 1.5 21 5 1.88 41 9 3.38
2 4 1.5 22 5 1.88 42 5 1.88
3 5 1.88 23 1 0.38 43 5 1.88
4 4 1.5 24 5 1.88 44 3 1.13
5 4 1.5 25 5 1.88 45 3 1.13
6 3 1.13 26 7 2.63 46 4 1.5
7 3 1.13 27 3 1.13 47 4 1.5
8 1 0.38 28 2 0.75 48 5 1.88
9 7 2.63 29 9 3.38 49 4 1.5
10 4 1.5 30 3 1.13 50 4 1.5
11 7 2.63 31 8 3.01 51 10 3.76
12 5 1.88 32 4 1.5 52 4 1.5
13 2 0.75 33 4 1.5 53 5 1.88
14 5 1.88 34 5 1.88 54 6 2.26
15 5 1.88 35 4 1.5 55 2 0.75
16 10 3.76 36 3 1.13
17 6 2.26 37 5 1.88
18 5 1.88 38 4 1.5
19 6 2.26 39 9 3.38
20 5 1.88 40 7 2.63

How project works

Since there are many people asked, I write this section.

Schedule

The project is schedule automatically via Github Actions, run a script, fetch data and auto commit to Github. No server is required, I don't need to do anything. Details in workflow file

How crawling works

I just inspected network packages sent between browser and server to find out how data is fetched and replicated that in Python code.

Install

via pip

pip install -i https://test.pypi.org/simple/ vietlott-data==0.1.3

cli

project provides two cli

crawl

Usage: vietlott-crawl [OPTIONS] PRODUCT

  crawl a product with a given run date or from/to index page 

Options:
  --run-date TEXT
  --index_from INTEGER  page index from run since we crawl by pagination the
                        pages
  --index_to INTEGER    page index from run since we crawl by pagination the
                        pages
  --help                Show this message and exit.

Backfill missing data

Usage: vietlott-missing [OPTIONS] PRODUCT

  detect_missing_data and run if needed :param ctx: context :param product:
  product to run :param limit: number of pages to run :return:

Options:
  --limit INTEGER
  --help           Show this message and exit.