MIT License

项目介绍

panzarino/mlbgame 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 551 个 Star、108 次 Fork。

仓库全名
panzarino/mlbgame
开源许可证
MIT License
Star 数
551
Fork 数
108
未关闭 Issue
24

README 摘要

mlbgame mlbgame is a Python API to retrieve and read MLB GameDay data. mlbgame works with real time data, getting information as games are being played. mlbgame uses the same data that MLB GameDay uses, and therefore is updated as soon as something happens in a game. mlbgame documentation mlbgame on Github (Source Code) If you have a question or need help, the quickest way to get a response is to file an issue on…

完整内容见 GitHub 原始 README 或本页 。

常见问题

mlbgame 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 551 个 Star。

mlbgame 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 mlbgame 的源码?

可以直接克隆仓库:git clone https://github.com/panzarino/mlbgame.git,默认分支为 master;安装与运行步骤见仓库 README。

mlbgame 最近还在维护吗?

仓库最近一次更新为 2022年1月30日,当前有 24 个未关闭 Issue;Star 数为 551,可作为社区活跃度的参考。

关于

A Python API to retrieve and read MLB GameDay data

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
822
价值分
367
活跃状态
活跃

语言占比

Python

Release

README

mlbgame

Build Status Code Climate Coverage Status

Join Slack

mlbgame is a Python API to retrieve and read MLB GameDay data. mlbgame works with real time data, getting information as games are being played.

mlbgame uses the same data that MLB GameDay uses, and therefore is updated as soon as something happens in a game.

mlbgame documentation

mlbgame on Github (Source Code)

If you have a question or need help, the quickest way to get a response is to file an issue on the Github issue tracker

mlbgame’s submodules should not really be used other than as used by the main functions of the package (in __init__.py).

Use of mlbgame must follow the terms stated in the license and on mlb.com.

Installation

mlbgame is in the Python Package Index (PyPI). Installing with pip is recommended for all systems.

mlbgame can be installed by running:

pip install mlbgame

Alternatively, the latest release of mlbgame can be downloaded as a zip or tarball. If you do not install with pip, you must also install lxml as specified in setup.py.

If you want to help develop mlbgame, you must also install the dev dependencies, which can be done by running pip install -e .[dev] from within the directory.

Examples

Here is a quick teaser to find the scores of all home Mets games for the month of June, 2015:

from __future__ import print_function
import mlbgame

month = mlbgame.games(2015, 6, home='Mets')
games = mlbgame.combine_games(month)
for game in games:
    print(game)

And the output is:

Giants (5) at Mets (0)
Giants (8) at Mets (5)
Giants (4) at Mets (5)
Braves (3) at Mets (5)
Braves (5) at Mets (3)
Braves (8) at Mets (10)
Blue Jays (3) at Mets (4)
Blue Jays (2) at Mets (3)
Reds (1) at Mets (2)
Reds (1) at Mets (2)
Reds (1) at Mets (2)
Reds (2) at Mets (7)
Cubs (1) at Mets (0)

Maybe you want to know the pitchers for the Royals game on April 30th, 2015:

from __future__ import print_function
import mlbgame

day = mlbgame.day(2015, 4, 12, home='Royals', away='Royals')
game = day[0]
output = 'Winning pitcher: %s (%s) - Losing Pitcher: %s (%s)'
print(output % (game.w_pitcher, game.w_team, game.l_pitcher, game.l_team))

And the output is:

Winning pitcher: Y. Ventura (Royals) - Losing Pitcher: C. Wilson (Angels)

You can easily print a list of the Mets batters in the final game of the 2015 World Series:

from __future__ import print_function
import mlbgame

game = mlbgame.day(2015, 11, 1, home='Mets')[0]
stats = mlbgame.player_stats(game.game_id)
for player in stats.home_batting:
    print(player)

And the output is:

Curtis Granderson (RF)
David Wright (3B)
Daniel Murphy (2B)
Yoenis Cespedes (CF)
Juan Lagares (CF)
Lucas Duda (1B)
Travis d'Arnaud (C)
Michael Conforto (LF)
Wilmer Flores (SS)
Matt Harvey (P)
Jeurys Familia (P)
Kelly Johnson (PH)
Jonathon Niese (P)
Addison Reed (P)
Bartolo Colon (P)

评论

暂无评论