PyJPBoatRace: Python-based Japanese boatrace tools 🚤

Overview

PyJPBoatRace: Python-based Japanese boatrace tools 🚤

GitHub top language GitHub tag (latest SemVer) GitHub GitHub last commit

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.7
  • requests>=2.25.0
  • beautifulsoup4>=4.9.3
  • selenium>=3.141.0
  • webdriver-manager>=3.2.2
  • msedge-selenium-tools

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:

      Sample
      {
        "date": "2021-08-12",
        "大村":{
          "status":"-",
          "grade":[
            "ippan",
            "rookie"
          ],
          "timeframe":"nighter",
          "title":"ルーキーシリーズ第16戦 オール進入固定レース",
          "period":[
            "2020-09-07",
            "2020-09-13"
          ],
          "day":"初日"
        },
        ...
      }
  • 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:

      Sample
      {
        "date": "2021-08-12",
        "stadium": 1,
        "1R":{
            "vote_limit":"2020-01-01 10:00:00",
            "status":"発売終了",
            "racers":{
                "boat1":{
                    "name":"Name1",
                    "class":"A1"
                },
                "boat2":{
                    "name":"Name2",
                    "class":"A2"
                },
                "boat3":{
                    "name":"Name3",
                    "class":"B1"
                },
                "boat4":{
                    "name":"Name4",
                    "class":"B2"
                },
                "boat5":{
                    "name":"Name5",
                    "class":"A1"
                },
                "boat6":{
                    "name":"Name6",
                    "class":"B1"
                }
            }
        },
        ...,
        "12R":{
            "vote_limit":"2020-01-01 15:30:00",
            "status":"発売終了",
            "racers":{
                "boat1":{
                    "name":"Name1",
                    "class":"A1"
                },
                "boat2":{
                    "name":"Name2",
                    "class":"A2"
                },
                "boat3":{
                    "name":"Name3",
                    "class":"B1"
                },
                "boat4":{
                    "name":"Name4",
                    "class":"B2"
                },
                "boat5":{
                    "name":"Name5",
                    "class":"A1"
                },
                "boat6":{
                    "name":"Name6",
                    "class":"B1"
                }
            }
        }
      }
  • To get the basic information of the race in the stadium on a day:

    • API:

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

      Sample
      {
        "date": "2021-08-12",
        "stadium": 10,
        "race": 1,
        "boat1": {
          "racerid": 9999,
          "class": "A1",
          "name": "Name1",
          "branch": "Somewhere",
          "birthplace": "Somewhere",
          "age": 40,
          "weight": 53.2,
          "F": 0,
          "L": 0,
          "aveST": 0.19,
          "global_win_pt": 6.43,
          "global_in2nd": 43.86,
          "global_in3rd": 68.42,
          "local_win_pt": 0,
          "local_in2nd": 0,
          "local_in3rd": 0,
          "motor": 42,
          "motor_in2nd": 35.48,
          "motor_in3rd": 56.13,
          "boat": 41,
          "boat_in2nd": 30.77,
          "boat_in3rd": 54.49,
          "result": [
            {
                "race": 8,
                "boat": 2,
                "course": 2,
                "ST": 0.24,
                "rank": 6
            },
            {},
            {
                "race": 4,
                "boat": 4,
                "course": 4,
                "ST": 0.28,
                "rank": 5
            },
            ...,
            {}
          ]
        },
        ...,
        "race_title": [
            "みくにあさガチ",
            "1800m"
        ]
      }
  • To get the odds of win (単勝) and place-show (複勝) of the race in the stadium on the day:

    • API:

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

      Sample
      {
        "date": "2020-10-24",
        "stadium": 14,
        "race": 1,
        "win":{
          "1": 1.0,
          "2": 6.8,
          "3": 9.3,
          "4": 41.3,
          "5": 36.1,
          "6": 72.3
        },
        "place_show":{
          "1": [1.0, 1.3],
          "2": [3.3, 5.0],
          "3": [1.5, 2.2],
          "4": [5.7, 8.9],
          "5": [1.1, 1.6],
          "6": [22.0, 33.3]
        },
        "update": "締切時オッズ"
      }
  • To get the odds of quinella place (拡連複) of the race in the stadioum on the day:

    • API:

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

      Sample
      {
        "date": "2020-10-24",
        "stadium": 14,
        "race": 1,
        "1=2": [1.2,1.4],
        "1=3": [1.3,1.8],
        ...,
        "5=6": [27.2,30.9],
        "update": "9:02"
      }
  • To get the odds of exacta (二連単) and quinella (二連複) of the race in the stadioum on the day:

    • API:

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

      Sample
      {
        "date": "2020-10-24",
        "stadium": 14,
        "race": 1,
        "exacta":{
          "1-2": 2.5,
          "1-3": 2.8,
          ...,
          "6-5": 2931.0
        },
        "quinella":{
          "1=2": 3.0,
          "1=3": 2.1,
          ...,
          "5=6": 298.3
        },
        "update": "12:30"
      }
  • To get the odds of trifecta (三連単) of the race in the stadioum on the day:

    • API:

      • PyJPBoatrace().get_odds_trifecta(d: datetime.date, stadium: int, race: int) -> Dict[str, Any]
      • PyJPBaotrace().TrifectaOdds.get(d: datetime.date, stadium: int, race: int) -> Dict[str, Any]
    • Return:

      Sample
      {
        "date": "2020-10-24",
        "stadium": 14,
        "race": 1,
        "1-2-3": 5.6,
        "1-2-4": 14.4,
        ...,
        "6-5-4": 8650.0,
        "update": "締切時オッズ"
      }
  • To get the oods of trio (三連複) of the race in the stadioum on the day:

    • API:

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

      Sample
      {
        "date": "2020-10-24",
        "stadium": 14,
        "race": 1,
        "1=2=3": "欠場",
        "1=2=4": "欠場",
        "1=2=5": "欠場",
        "1=2=6": "欠場",
        "1=3=4": "欠場",
        "2=3=4": 4.2,
        "1=3=5": "欠場",
        "2=3=5": 30,
        "1=3=6": "欠場",
        "2=3=6": 2.3,
        "1=4=5": "欠場",
        "2=4=5": 25,
        "3=4=5": 79.2,
        "1=4=6": "欠場",
        "2=4=6": 1.9,
        "3=4=6": 60,
        "1=5=6": "欠場",
        "2=5=6": 26.7,
        "3=5=6": 132.1,
        "4=5=6": 90.1,
        "update": "15:30"
      }
  • To get the just-before information, e.g. weather and start-timing, of the race in the stadioum on the day:

    • API:

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

      Sample
      {
        "date": "2020-08-25",
        "stadium": 14,
        "race": 7,
        "boat1":{
            "name":"Name1",
            "weight":55.1,
            "weight_adjustment":0.0,
            "display_time":6.87,
            "tilt":0.0,
            "propeller":"",
            "parts_exchange":[
                "リング×1",
                "シャフト"
            ],
            "previous_race":{}
        },
        ...,
        "boat6":{
            "name":"Name6",
            "weight":51.0,
            "weight_adjustment":0.0,
            "display_time":6.88,
            "tilt":-0.5,
            "propeller":"",
            "parts_exchange":[],
            "previous_race":{
                "race":3,
                "boat":3,
                "course":3,
                "ST":0.13,
                "rank":6
            }
        },
        "start_display":{
            "course1":{
                "boat":1,
                "ST":0.02
            },
            ...,
            "course6":{
                "boat":6,
                "ST":0.10
            }
        },
        "weather_information":{
            "direction":16,
            "weather":"晴",
            "temperature":31.0,
            "wind_direction":14,
            "wind_speed":5,
            "water_temperature":27.0,
            "wave_height":5,
            "time":"6R時点"
        }
      }
  • To get the race result of the race in the stadioum on the day:

    • API:

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

      Sample
      {
        "date": "2020-10-24",
        "stadium": 14,
        "race": 1,
        "result":[
            {
                "rank":1,
                "boat":1,
                "name":"WHO1",
                "racerid":9999,
                "time":"1'50\"0"
            },
            ...,
            {
                "rank":6,
                "boat":2,
                "name":"WHO6",
                "racerid":8888,
                "time":""
            }
        ],
        "kimarite":"逃げ",
        "start_information":{
            "course1":{
                "boat":1,
                "ST":0.05
            },
            ...,
            "course6":{
                "boat":6,
                "ST":0.11
            }
        },
        "payoff":{
            "trifecta":{
                "result":"1-5-6",
                "payoff":12345,
                "popularity":34
            },
            ...,
            "quinella_place":[
                {
                    "result":"1=5",
                    "payoff":220,
                    "popularity":3
                },
                ...
            ],
            ...,
        },
        "weather_information":{
            "direction":16,
            "weather":"晴",
            "temperature":17.0,
            "wind_direction":6,
            "wind_speed":5,
            "water_temperature":21.0,
            "wave_height":5
        },
        "return":[],
        "note":[]
      }

These functions return dict object.

Operations

  • To deposit money for betting (Unit: 1,000 yen):

    • API
      • PyJPBoatrace().deposit(num_of_thousands_yen: int) -> None
      • PyJPBoatrace().Deposit.do(num_of_thousands_yen: int) -> None
    • Return:
      • Nothing
  • To get the limit of betting amount, that is, your current deposit:

    • API
      • PyJPBoatrace().get_bet_limit() -> int
      • PyJPBoatrace().BettingLimitCheck.do() -> int
    • Return:
      • int: the amount of deposit
  • To withdraw your current deposit:

    • API:

      • PyJPBoatrace().withdraw() -> None
      • PyJPBoatrace().Widthdraw.do() -> None
    • Return:

      • Nothing
  • To bet some tickets.

    • API:

      • PyJPBoatrace().bet(
          stadium:int,
          race:int,
          trifecta_betting_dict: Dict[str, int],
          trio_betting_dict: Dict[str, int],
          exacta_betting_dict: Dict[str, int],
          quinela_betting_dict: Dict[str, int],
          quinellaplace_betting_dict: Dict[str, int],
          win_betting_dict: Dict[str, int],
          placeshow_betting_dict: Dict[str, int],
        ) -> bool
      • PyJPBoatrace().Bet.do(
          stadium:int,
          race:int,
          trifecta_betting_dict: Dict[str, int],
          trio_betting_dict: Dict[str, int],
          exacta_betting_dict: Dict[str, int],
          quinela_betting_dict: Dict[str, int],
          quinellaplace_betting_dict: Dict[str, int],
          win_betting_dict: Dict[str, int],
          placeshow_betting_dict: Dict[str, int],
        ) -> bool
    • Each dictionary consits of pairs of winning numbers and betting amount, e.g., {'1-2-3':100} for trifecta_betting_dict

IMPORTANT NOTE: you must give a driver other than HTTPGetDriver to use above actions.

Demo

Demo 1 : Getting odds data

The following example is useful. Suppose that you want get the odds of trifecta of 4th race in stadium "桐生" on 2020/12/02 and dump the result into data.json.

from datetime import date
import json
from pyjpboatrace import PyJPBoatrace

# initialize
boatrace_tools = PyJPBoatrace()

# get data
dic = boatrace_tools.get_odds_trifecta(d=date(2020,12,2), stadium=1, race=4)

# dump data
with open('data.json', 'w', encoding='utf-8') as f:
    json.dump(dic, f, ensure_ascii=False)

# close (you can use 'with' statement)
boatrace_tools.close()

You can get many kinds of data as this example.

Demo 2 : Betting

Suppose it is 2020/12/02 and you want to bet 200 yen on trifecta 1-3-4 and 100 yen on trio 1=3=4 in the 2nd race in stadium "桐生" on 2020/12/02. NOTE: you need google chrome in the following example.

from datetime import date
from pyjpboatrace import PyJPBoatrace
from pyjpboatrace.drivers import create_chrome_driver
from pyjpboatrace.const import STADIUMS_MAP
from pyjpboatrace.user_information import UserInformation

# initialize
user = UserInformation(
    userid='YOUR_USER_ID',
    pin='YOUR_PIN',
    auth_pass='YOUR_AUTHENTIFICATION_PASSWORD',
    vote_pass='YOUR_BETTING_PASSWORD',
)
boatrace_tools = PyJPBoatrace(
    driver=create_chrome_driver(),
    user_information=user
)

# deposit 1,000 yen
boatrace_tools.deposit(1)

# bet
stadium = {s:i for i,s in STADIUMS_MAP}.get("桐生")
race = 2
boatrace_tools.bet(
    stadium=stadium,
    race=race,
    trifecta_betting_dict={'1-3-4':200},
    trio_betting_dict={'1=3=4':100}
)

# waiting for the race result ...

# withdraw
boatrace_tools.withdraw()

# close (you can use 'with' statement)
boatrace_tools.close()

NOTE

The map between integers and stadiums is given by STADIUMS_MAP in pyjpboatrace.const.

Contribution Guide

Requirement

  • Python >= 3.7
  • Pipenv (You can install pipenv by pip install pipenv)
  • Chrome
  • Firefox
  • bash
  • curl

Issues

  • For any bugs, use BUG REPORT to create an issue.

  • For any enhancement, use FEATURE REQUEST to create an issue.

  • For other topics, create an issue with a clear and concise description.

Pull Request

  1. Fork (https://github.com/hmasdev/pyjpboatrace/fork);
  2. Create your feature branch (git checkout -b feautre/xxxx);
  3. Test codes according to Test Subsection;
  4. Commit your changes (git commit -am 'Add xxxx feature);
  5. Push to the branch (git push origin feature/xxxx);
  6. Create new Pull Request

Test

You can do unit tests and integration tests as follows:

$ ./download_html_for_test.sh  # Only 1 time
$ pipenv run pytest -m "not integrate and not spending_money" # unit tests
$ pipenv run pytest  # unit tests and integration tests

pipenv run pytest does not test depositing, withdrawing or betting. If you want to test them, make .secrets.json at first:

{
  "userid": "YOUR_USER_ID",
  "pin": "YOUR_PIN",
  "auth_pass": "YOUR_AUTHENTIFICATION_PASSWORD",
  "vote_pass": "YOUR_BETTING_PASSWORD"
}

Then, run

$ pipenv run pytest -m "spending_money"

WARNING: Tests with spending_money spend 700 yen.

LICENSE

MIT

Authors

hmasdev

Comments
  • [BUG] Scheduled tests failed for stadiums, race_info and just_before_info scrapers

    [BUG] Scheduled tests failed for stadiums, race_info and just_before_info scrapers

    Describe the bug

    Pytest failed.

    Environment

    • github actions (See https://github.com/hmasdev/pyjpboatrace/actions/runs/1766385345)
    • Python Version: 3.7, 3.8 and 3.9

    To Reproduce

    I have confirmed that the following test fails in my environment as well:

    $ pipenv install --dev
    $ ./download_html_for_test.sh
    $ pipenv run pytest
    

    Screenshots or codes

    See https://github.com/hmasdev/pyjpboatrace/actions/runs/1938733501

    Expected behavior

    The test should pass.

    Problems

    Reasons (Optional)

    TBD

    bug 
    opened by hmasdev 3
  • [BUG] PyPI workflow in actions does not work

    [BUG] PyPI workflow in actions does not work

    Describe the bug

    PyPI workflow in actions, which runs when released, returns exit code 1 during uploading .whl and .tar.gz with twine.

    https://github.com/hmasdev/pyjpboatrace/actions/runs/1103843756

    Environment

    To Reproduce (Probabily)

    Steps to reproduce the behavior:

    1. Go to https://github.com/hmasdev/pyjpboatrace/releases
    2. Click on "Draft a new release"
    3. Input tag version, title and description.
    4. Click on "Publish release", which triggers PyPI workflow.
    5. Error during PyPI workflow in Upload step as follows:
      Traceback (most recent call last):
         File "/home/runner/.local/share/virtualenvs/pyjpboatrace-cg8vEFYy/bin/twine", line 5, in <module>
           from twine.__main__ import main
         File "/home/runner/.local/share/virtualenvs/pyjpboatrace-cg8vEFYy/lib/python3.8/site-packages/twine/__init__.py", line 27, in <module>
           import importlib_metadata
      ModuleNotFoundError: No module named 'importlib_metadata'
      Error: Process completed with exit code 1.
      

    Expected behavior

    Twine succeeds in uploading .whl and .tar.gz to pypi server.

    Uploading distributions to https://upload.pypi.org/legacy/
    Uploading pyjpboatrace-0.2.0-py3-none-any.whl
    100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 63.5k/63.5k [00:02<00:00, 24.2kB/s]
    Uploading pyjpboatrace-0.2.0.tar.gz
    100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50.3k/50.3k [00:01<00:00, 31.2kB/s] 
    
    View at:
    https://pypi.org/project/pyjpboatrace/0.2.0/
    

    Problems

    If this bug is not fixed, we can not upload this package to pypi automatically, that is, manual operation is required when uploading.

    Reasons (Optional)

    Checking the log, I found pipenv uses python 3.8.10 as follows:

    Creating a virtualenv for this project...
    Pipfile: /home/runner/work/pyjpboatrace/pyjpboatrace/Pipfile
    Using /usr/bin/python3.8 (3.8.10) to create virtualenv...
    created virtual environment CPython3.8.10.final.0-64 in 694ms
    

    This is probably a reason for this bug.

    See https://stackoverflow.com/a/59734959/16567832

    bug 
    opened by hmasdev 2
  • [BUG] If grade is SG, parsing fails.

    [BUG] If grade is SG, parsing fails.

    If grade is SG, parsing fails. https://www.boatrace.jp/owpc/pc/race/index?hd=20221030

    from datetime import date
    import json
    from pyjpboatrace import PyJPBoatrace
    boatrace_tools = PyJPBoatrace()
    dic = boatrace_tools.get_stadiums(d=date(2022,10,30))
    with open('data.json', 'w', encoding='utf-8') as f:
        json.dump(dic, f, ensure_ascii=False)
    boatrace_tools.close()
    

    ... 'Always': {'status': '-', 'grade': ['[FailedToParse]is-SGa'], 'timeframe': '', 'title': 'The 69th Boat Race Derby', 'period': ['2022-10-25', '2022-10-30'], 'day': 'Last day'}, ...

    bug 
    opened by miyamamoto 1
  • Add timestamp to the responses from odds scrapers

    Add timestamp to the responses from odds scrapers

    Abstract

    The response dictionaries from odds scrapers, like get_odds_trifecta (TrifectaOddsScraper.get), should contain the timestamp when odds number are updated.

    AsIs: Background

    Odds scrapers for a race return the final odds after the race is over. However, they return uncertain odds before the race is not over.

    The numbers varies depending on when the scrapers are called. For example, get_odds_trifecta returns one-min-ahead trifecta odds when you call get_odds_trifecta one minute before the deadline. On the other hand, it returns five-min-ahead trifecta odds when you call get_odds_trifecta five minutes before the deadline. The problem is that you can not find the timestamp when odds have been updated in the reponse from the scraper.

    The following is an example:

    from datetime import date, datetime
    import json
    from pyjpboatrace import PyJPBoatrace
    
    # initialize
    boatrace_tools = PyJPBoatrace()
    
    # get data
    d=date(2020,12,2)
    stadium=1
    race=4
    timestamp = datetime.now()
    response = boatrace_tools.get_odds_trifecta(d=d, stadium=stadium, race=race)
    
    # add timestamp to response
    # because response is a dictionary like {"1-2-3": 7.0, ..., "6-5-4": 9999}
    response["timestamp"] = timestamp
    
    # close (you can use 'with' statement)
    boatrace_tools.close()
    

    ToBe: Describe the solution you'd like

    I want odds scrapers to response the timestamp in addition to odds values. Altanatively, I want odds scrapers to scrape the update timestamp from the target website, because odds pages in pyjpboatrace.jp contain a timestamp when the odds are updated.

    enhancement 
    opened by hmasdev 1
  • Add arguments (date, stadium and race) to response dictionary

    Add arguments (date, stadium and race) to response dictionary

    Abstract

    The response dictionaries from scraping functions e.g. get_stadiums (StadiumsScraper.get) and get_odds_trifecta (TrifectaOddsScraper.get), should contain the arguments: date, stadium number and race number.

    AsIs: Background

    A use case of pyjpboatrace is to use pyjpboatrace scrapers to create boatrace database, where date, stadium number and race number are likely to be primary keys. However, the response dictionaries from scraping functions don't contain the arguments, so it is required to add the arguments, like date, stadium number and race number, to the response dictionaries after scraping.

    The following is an example:

    from datetime import date
    import json
    from pyjpboatrace import PyJPBoatrace
    
    # initialize
    boatrace_tools = PyJPBoatrace()
    
    # get data
    d=date(2020,12,2)
    stadium=1
    race=4
    response = boatrace_tools.get_odds_trifecta(d=d, stadium=stadium, race=race)
    
    # add date, stadium and race to response
    # because response is a dictionary like {"1-2-3": 7.0, ..., "6-5-4": 9999}
    response["date"] = d
    response["stadium"] = stadium
    response["race"] = race
    
    # close (you can use 'with' statement)
    boatrace_tools.close()
    

    ToBe: Describe the solution you'd like

    I want the response dictionaries from pyjpboatrace's scrapers to contain the arugments like date, stadium number and race number. For example, the reponse from get_odds_trifecta should be like

    {
      "date": date(2020, 1, 1),  # This is a new element.
      "stadium": 1,    # This is a new element.
      "race": 1,    # This is a new element.
      "1-2-3": 5.6,
      "1-2-4": 14.4,
      ...,
      "6-5-4": 8650.0
    }
    
    enhancement 
    opened by hmasdev 1
  • すべての選手がフライングだった際のget_race_resultのエラーについて

    すべての選手がフライングだった際のget_race_resultのエラーについて

    すべての選手がフライングだった際においてget_race_resultがエラーを吐く様子です。 https://www.boatrace.jp/owpc/pc/race/raceresult?rno=3&jcd=21&hd=20180101

    dic = boatrace_tools.get_race_result(d=date(2018,1,1), stadium=21, race=3)
    
    bug 
    opened by miyamamoto 1
  • Feature/update readme

    Feature/update readme

    Abstract

    Update output samples and add a note of get_race_result in README.md

    Objective

    • output samples are outdated;

    Type of change

    • Documentation update

    What you did

    • transformed output samples to python codes;
    • added a note of get_race_result
    opened by hmasdev 0
  • fix a bug in parse_html_index during parsing SG

    fix a bug in parse_html_index during parsing SG

    Abstract

    Fix codes for #64

    Objective

    To fix parsers even when grade is SG.

    Type of change

    • Bug fix (non-breaking change which fixes an issue)

    What you did

    • Fixed parsers.

    Impacts

    • When using PyJPBoatrace.get_stadiums, the grade is correctly parsed even when the grade is SG.
      • AsIs: the grade is parsed as "[FailedToParse]is-SGa" when the grade is SG;
      • ToBe: the grade is parsed as "SG" when the grade is SG.
    opened by hmasdev 0
  • Feature/add test case for multiple results

    Feature/add test case for multiple results

    Abstract

    Add test cases for #60

    Objective

    To test the api to get the result of a race where a tie occurred.

    Type of change

    • [o] Bug fix (non-breaking change which fixes an issue)

    What you did

    • [o] what you did;
      • add tests
    opened by hmasdev 0
  • Update setup.cfg

    Update setup.cfg

    Abstract

    Update setup.cfg with adding python 3.10 to classifiers

    Objective

    To indicate that it can be used in a Python 3.10 environment.

    Type of change

    Update setup.cfg

    What you did

    • Add python 3.10 to classifiers

    Operation check

    • To check whether python 3.10 is added appropriately to classifiers
    opened by hmasdev 0
  • add python 3.10 to pytest.yaml

    add python 3.10 to pytest.yaml

    Abstract

    Add test with python 3.10 to pytest.yaml

    Objective

    To test pyjpboatrace with python 3.10 in addition to python 3.7, python 3.8 and python 3.9.

    Type of change

    Update github actions

    What you did

    • Add test with python 3.10 to pytest.yaml

    Operation check

    • To check whether the tests in github actions pass
    opened by hmasdev 0
  • Request to automate updates to README.md.

    Request to automate updates to README.md.

    Abstract

    Request to automate updates to README.md.

    AsIs: Background

    The current README.md contains the PyJPBoatrace API specifications and sample output. However, when changes are made to the code, especially when there are updates to the output of each API, the sample output must be obtained manually and the README.md updated.

    ToBe: Describe the solution you'd like

    If there are updates to the output of each API, the sample output updates in README.md are automatically committed to the main branch when the corresponding pull request is merged into the main branch.

    Additional context

    • Step.1: to add a script to use the current code to update sample outputs;
    • Step.2: to create a workflow to execute the script above to update README.md and commit the change to main.

    MEMO

    This problem because apparent in https://github.com/hmasdev/pyjpboatrace/pull/61#issuecomment-1304954123

    enhancement 
    opened by hmasdev 0
Releases(v0.2.3a)
  • v0.2.3a(Dec 4, 2022)

    What's Changed

    • add python 3.10 to pytest.yaml by @hmasdev in https://github.com/hmasdev/pyjpboatrace/pull/58
    • Update setup.cfg by @hmasdev in https://github.com/hmasdev/pyjpboatrace/pull/59
    • Fixed to take multiple results when ties exist by @miyamamoto in https://github.com/hmasdev/pyjpboatrace/pull/61
    • Feature/add test case for multiple results by @hmasdev in https://github.com/hmasdev/pyjpboatrace/pull/62
    • fix a bug in parse_html_index during parsing SG by @hmasdev in https://github.com/hmasdev/pyjpboatrace/pull/65
    • Feature/update readme by @hmasdev in https://github.com/hmasdev/pyjpboatrace/pull/66

    New Contributors

    • @miyamamoto made their first contribution in https://github.com/hmasdev/pyjpboatrace/pull/61

    Full Changelog: https://github.com/hmasdev/pyjpboatrace/compare/v0.2.2a...v0.2.3a

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2a(Mar 9, 2022)

  • v0.2.1a(Aug 12, 2021)

    • Add the timestamp when odds are updated to responses from odds scraper, like PyJPBoatrace.get_odds_trifecta and PyJPBoatrace.TrifectaOdds.get;
    • Add date, stadium and race to responses.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0a(Aug 6, 2021)

  • v0.1.0a(Dec 28, 2020)

  • v0.0.0a(Dec 5, 2020)

Bu Chatbot, Konya Bilim Merkezi Yen için tasarlanmış olan bir projedir.

chatbot Bu Chatbot, Konya Bilim Merkezi Yeni Ufuklar Sergisi için 2021 Yılında tasarlanmış olan bir projedir. Chatbot Python ortamında yazılmıştır. Sö

Emre Özkul 1 Feb 23, 2022
Simple and efficient RevNet-Library with DeepSpeed support

RevLib Simple and efficient RevNet-Library with DeepSpeed support Features Half the constant memory usage and faster than RevNet libraries Less memory

Lucas Nestler 112 Dec 05, 2022
Uses Google's gTTS module to easily create robo text readin' on command.

Tool to convert text to speech, creating files for later use. TTRS uses Google's gTTS module to easily create robo text readin' on command.

0 Jun 20, 2021
Built for cleaning purposes in military institutions

Ferramenta do AL Construído para fins de limpeza em instituições militares. Instalação Requer python = 3.2 pip install -r requirements.txt Usagem Exe

0 Aug 13, 2022
Chinese Grammatical Error Diagnosis

nlp-CGED Chinese Grammatical Error Diagnosis 中文语法纠错研究 基于序列标注的方法 所需环境 Python==3.6 tensorflow==1.14.0 keras==2.3.1 bert4keras==0.10.6 笔者使用了开源的bert4keras

12 Nov 25, 2022
Simple NLP based project without any use of AI

Simple NLP based project without any use of AI

Shripad Rao 1 Apr 26, 2022
GraphNLI: A Graph-based Natural Language Inference Model for Polarity Prediction in Online Debates

GraphNLI: A Graph-based Natural Language Inference Model for Polarity Prediction in Online Debates Vibhor Agarwal, Sagar Joglekar, Anthony P. Young an

Vibhor Agarwal 2 Jun 30, 2022
Pytorch-Named-Entity-Recognition-with-BERT

BERT NER Use google BERT to do CoNLL-2003 NER ! Train model using Python and Inference using C++ ALBERT-TF2.0 BERT-NER-TENSORFLOW-2.0 BERT-SQuAD Requi

Kamal Raj 1.1k Dec 25, 2022
A library for finding knowledge neurons in pretrained transformer models.

knowledge-neurons An open source repository replicating the 2021 paper Knowledge Neurons in Pretrained Transformers by Dai et al., and extending the t

EleutherAI 96 Dec 21, 2022
Fuzzy String Matching in Python

FuzzyWuzzy Fuzzy string matching like a boss. It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package.

SeatGeek 8.8k Jan 01, 2023
TPlinker for NER 中文/英文命名实体识别

本项目是参考 TPLinker 中HandshakingTagging思想,将TPLinker由原来的关系抽取(RE)模型修改为命名实体识别(NER)模型。

GodK 113 Dec 28, 2022
Binaural Speech Synthesis

Binaural Speech Synthesis This repository contains code to train a mono-to-binaural neural sound renderer. If you use this code or the provided datase

Facebook Research 135 Dec 18, 2022
A natural language modeling framework based on PyTorch

Overview PyText is a deep-learning based NLP modeling framework built on PyTorch. PyText addresses the often-conflicting requirements of enabling rapi

Meta Research 6.4k Jan 08, 2023
小布助手对话短文本语义匹配的一个baseline

oppo-text-match 小布助手对话短文本语义匹配的一个baseline 模型 参考:https://kexue.fm/archives/8213 base版本线下大概0.952,线上0.866(单模型,没做K-flod融合)。 训练 测试环境:tensorflow 1.15 + keras

苏剑林(Jianlin Su) 132 Dec 14, 2022
CredData is a set of files including credentials in open source projects

CredData is a set of files including credentials in open source projects. CredData includes suspicious lines with manual review results and more information such as credential types for each suspicio

Samsung 19 Sep 07, 2022
Sequence Modeling with Structured State Spaces

Structured State Spaces for Sequence Modeling This repository provides implementations and experiments for the following papers. S4 Efficiently Modeli

HazyResearch 902 Jan 06, 2023
A website which allows you to play with the GPT-2 transformer

transformers A website which allows you to play with the GPT-2 model Built with ❤️ by raphtlw Table of contents Model Setup About Contributors Model T

raphtlw 2 Jan 27, 2022
Persian Bert For Long-Range Sequences

ParsBigBird: Persian Bert For Long-Range Sequences The Bert and ParsBert algorithms can handle texts with token lengths of up to 512, however, many ta

Sajjad Ayoubi 63 Dec 14, 2022
Code for the Findings of NAACL 2022(Long Paper): AdapterBias: Parameter-efficient Token-dependent Representation Shift for Adapters in NLP Tasks

AdapterBias: Parameter-efficient Token-dependent Representation Shift for Adapters in NLP Tasks arXiv link: upcoming To be published in Findings of NA

Allen 16 Nov 12, 2022
Code for Editing Factual Knowledge in Language Models

KnowledgeEditor Code for Editing Factual Knowledge in Language Models (https://arxiv.org/abs/2104.08164). @inproceedings{decao2021editing, title={Ed

Nicola De Cao 86 Nov 28, 2022