SkillAgentSearch skills...

Pyjpboatrace

pyjpboatrace :speedboat: provides you with useful tools for data analysis and auto-betting for boatrace.

Install / Use

/learn @hmasdev/Pyjpboatrace
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PyJPBoatRace: Python-based Japanese boatrace tools :speedboat:

GitHub top language GitHub tag (latest SemVer) GitHub GitHub last commit PyPI version Scheduled Test

Japanese boat race is extremely exciting sports. It is also fun to predict the results of races. Prediction like machine learning method requires data. Thus, this package provides you with useful tools for data analysis and auto-betting for boatrace.

Installation

Requirements

If you want to deposit, withdraw and betting with pyjpboatrace, one of the following browers is required at least:

  • Chrome
  • Firefox
  • Edge

Dependencies

  • python >= 3.9
  • requests>=2.28.1
  • beautifulsoup4>=4.11.1
  • selenium>=4.6

User installation

pip install -U pyjpboatrace

How to use

  1. (optional) create an instance of UserInformation;
  2. (optional) create a selenium driver;
  3. create an instance of PyJPBoatrace;
  4. execute scraping and operating.

NOTE: you must create a UserInformation instance and a selenium driver to order to deposit, withdraw or bet.

UserInformation

  • pyjpboatrace.user_information.UserInformation(userid:str, pin:str, auth_pass:str, vote_pass:str, json_file:str)

NOTE: If you use a json file to create an instance of UserInformation, the json file should contain the following keys: userid, pin, auth_pass and vote_pass.

Selenium Driver

You can use the following functions to create selenium drivers:

  • pyjpboatrace.drivers.create_chrome_driver()
  • pyjpboatrace.drivers.create_firefox_driver()
  • pyjpboatrace.drivers.create_edge_driver()
  • pyjpboatrace.drivers.create_httpget_driver()

NOTE 1: you can use your own selenium driver.

NOTE 2: If you use create_httpget_driver, you cannot execute the following operations, deposit, withdraw or bet.

Scraping and Operating

PyJPBoatrace provides 2 main functions: scraping and operating.

The former is scraping race information, odds and so on; the latter is betting, depositing and withdrawing.

Scraping

  • Get a list of stadiums which hold races on the given day:

    • API:

      • PyJPBoatrace().get_stadiums(d: datetime.date) -> Dict[str, Any]
        
      • PyJPBoatrace().Stadiums.get(d: datetime.date) -> Dict[str, Any]
        
    • Return:

      <details> <summary> Sample </summary>
      >>> from pyjpboatrace import PyJPBoatrace
      >>> from datetime import date
      >>> from pprint import pprint
      >>> pprint(PyJPBoatrace().get_stadiums(date(2021, 8, 12)))
      {'date': '2021-08-12',
       'びわこ': {'day': '3日目',
               'grade': ['ippan'],
               'period': ['2021-08-10', '2021-08-15'],
               'status': '-',
               'timeframe': '',
               'title': '滋賀県知事杯争奪第26回びわこカップ'},
       '三国': {'day': '2日目',
              'grade': ['ippan'],
              'period': ['2021-08-11', '2021-08-16'],
              'status': '-',
              'timeframe': 'morning',
              'title': '第49回しぶき賞'},
       '下関': {'day': '最終日',
              'grade': ['ippan'],
              'period': ['2021-08-06', '2021-08-12'],
              'status': '-',
              'timeframe': 'nighter',
              'title': 'Hayashikane杯'},
       '唐津': {'day': '最終日',
              'grade': ['ippan'],
              'period': ['2021-08-07', '2021-08-12'],
              'status': '-',
              'timeframe': 'morning',
              'title': '唐津大賞がばい王者決定戦'},
       '多摩川': {'day': '最終日',
               'grade': ['ippan'],
               'period': ['2021-08-08', '2021-08-12'],
               'status': '-',
               'timeframe': 'summer',
               'title': '第59回スポーツニッポン賞'},
       '宮島': {'day': '最終日',
              'grade': ['ippan'],
              'period': ['2021-08-07', '2021-08-12'],
              'status': '-',
              'timeframe': '',
              'title': '第51回スポーツニッポン杯'},
       '尼崎': {'day': '4日目',
              'grade': ['ippan'],
              'period': ['2021-08-09', '2021-08-14'],
              'status': '-',
              'timeframe': '',
              'title': '日本財団会長杯争奪第49回オール兵庫王座決定戦'},
       '常滑': {'day': '2日目',
              'grade': ['ippan'],
              'period': ['2021-08-11', '2021-08-16'],
              'status': '-',
              'timeframe': '',
              'title': '名鉄杯争奪2021納涼お盆レース'},
       '平和島': {'day': '3日目',
               'grade': ['ippan'],
               'period': ['2021-08-10', '2021-08-15'],
               'status': '-',
               'timeframe': 'summer',
               'title': '第61回デイリースポーツサマーカップ'},
       '戸田': {'day': '初日',
              'grade': ['ippan'],
              'period': ['2021-08-12', '2021-08-17'],
              'status': '-',
              'timeframe': '',
              'title': '第44回戸田ボート大賞・サンケイスポーツ杯'},
       '桐生': {'day': '3日目',
              'grade': ['ippan'],
              'period': ['2021-08-10', '2021-08-15'],
              'status': '-',
              'timeframe': 'nighter',
              'title': '第55回報知新聞社杯\u3000お盆レース'},
       '若松': {'day': '4日目',
              'grade': ['ippan'],
              'period': ['2021-08-08', '2021-08-13'],
              'status': '-',
              'timeframe': 'nighter',
              'title': '日刊スポーツ杯お盆特選競走'},
       '蒲郡': {'day': '初日',
              'grade': ['ippan'],
              'period': ['2021-08-12', '2021-08-17'],
              'status': '-',
              'timeframe': 'nighter',
              'title': '日刊スポーツ杯争奪\u3000納涼しぶきお盆特別選抜戦'},
       '鳴門': {'day': '4日目',
              'grade': ['ippan'],
              'period': ['2021-08-09', '2021-08-14'],
              'status': '-',
              'timeframe': 'morning',
              'title': '第54回渦王杯競走'}}
      
      </details>
  • To get 12 races held in the given stadium on the given day:

    • API:

      • PyJPBoatrace().get_12races(d: datetime.date, stadium: int) -> Dict[str, Any]
        
      • PyJPBoatrace().Races.get(d: datetime.date, stadium: int) -> Dict[str, Any]
        
    • Return:

      <details> <summary> Sample </summary>
      >>> from pyjpboatrace import PyJPBoatrace
      >>> from datetime import date
      >>> from pprint import pprint
      >>> pprint(PyJPBoatrace().get_12races(date(2021, 8, 12), 1))
      {'10R': {'racers': {'boat1': {'class': 'B1', 'name': '佐藤航'},
                          'boat2': {'class': 'A1', 'name': '大澤普司'},
                          'boat3': {'class': 'A2', 'name': '橋本久和'},
                          'boat4': {'class': 'A1', 'name': '江口晃生'},
                          'boat5': {'class': 'B1', 'name': '土屋太朗'},
                          'boat6': {'class': 'A2', 'name': '加瀬智宏'}},
               'status': '発売終了',
               'vote_limit': '2021-08-12 19:43:00'},
       '11R': {'racers': {'boat1': {'class': 'A2', 'name': '藤生雄人'},
                          'boat2': {'class': 'A1', 'name': '毒島誠'},
                          'boat3': {'class': 'A2', 'name': '長谷川充'},
                          'boat4': {'class': 'A1', 'name': '上村純一'},
                          'boat5': {'class': 'B1', 'name': '津久井拓也'},
                          'boat6': {'class': 'B1', 'name': '松本純平'}},
               'status': '発売終了',
               'vote_limit': '2021-08-12 20:14:00'},
       '12R': {'racers': {'boat1': {'class': 'A1', 'name': '久田敏之'},
                          'boat2': {'class': 'A1', 'name': '金子拓矢'},
                          'boat3': {'class': 'A2', 'name': '木村浩士'},
                          'boat4': {'class': 'A1', 'name': '椎名豊'},
                          'boat5': {'class': 'A2', 'name': '本橋克洋'},
                          'boat6': {'class': 'A2', 'name': '野村誠'}},
               'status': '発売終了',
               'vote_limit': '2021-08-12 20:45:00'},
       '1R': {'racers': {'boat1': {'class': 'B1', 'name': '渡辺史之'},
                         'boat2': {'class': 'B1', 'name': '島倉都'},
                         'boat3': {'class': 'A2', 'name': '鳥居塚孝博'},
                         'boat4': {'class': 'B1', 'name': '松本純平'},
                         'boat5': {'class': 'A2', 'name': '橋本久和'},
                         'boat6': {'class': 'B2', 'name': '宮崎安奈'}},
              'status': '発売終了',
              'vote_limit': '2021-08-12 15:22:00'},
       '2R': {'racers': {'boat1': {'class': 'B1', 'name': '佐口達也'},
                         'boat2': {'class': 'A2', 'name': '本橋克洋'},
                         'boat3': {'class': 'B1', 'name': '寺本昇平'},
                         'boat4': {'class': 'B1', 'name': '津久井拓也'},
                         'boat5': {'class': 'B1', 'name': '久保原秀人'},
                         'boat6': {'class': 'A2', 'name': '中里英夫'}},
              'status': '発売終了',
              'vote_limit': '2021-08-12 15:49:00'},
       '3R': {'racers': {'boat1': {'class': 'B1', 'name': '小川時光'},
                         'boat2': {'class': 'A2', 'name': '野村誠'},
                         'boat3': {'class': 'B2', 'name': '黄金井裕子'},
                         'boat4': {'class': 'A2', 'name': '藤生雄人'},
                         'boat5': {'class': 'B1', 'name': '高山秀雄'},
                         'boat6': {'class': 'A1', 'name': '関浩哉'}},
              'status': '発売終了',
              'vote_limit': '2021-08-12 16:16:00'},
       '4R': {'racers': {'boat1': {'class': 'B1', 'name': '栗原謙治'},
                         'boat2': {'class': 'A2', 'name': '金子賢志'},
                         'boat3': {'class': 'B1', 'name': '関根彰人'},
                         'boat4': {'class': 'A1', 'name': '金子拓矢'},
                         'boat5': {'class': 'B2', 'name': '大久保佑香'},
                         'boat6': {'class': 'B1', 'name': '土屋太朗'}},
              'status': '発売終了',
              'vote_limit': '2021-08-12 16:45:00'},
       '5R': {'racers': {'boat1': {'class': 'B1', 'name': '原加央理'},
                         'boat2': {'class': 'B1', 'name': '佐藤航'},
      

Related Skills

View on GitHub
GitHub Stars15
CategoryData
Updated2d ago
Forks10

Languages

Python

Security Score

95/100

Audited on Apr 4, 2026

No findings