Coder Social home page Coder Social logo

pyball's Introduction

PyBall - A MLB.com Stats API Python Client

Build Status codecov

API Documentation:

http://statsapi.mlb.com/docs/#

If anyone has any connection to MLB and can get access to the API documentation I would really appreciate it.

import pyball

def main():
    pb = pyball.PyBall()
    kluber = pb.get_player(446372)
    print(kluber.fullName)
    print(kluber.pitchHand.description)
    print(kluber.batSide.description)


if __name__ == '__main__':
    main()
This is very much in beta alpha.

Logging

This library uses logging to alert when the current version of this library does not match the MLB.com API. All loggers use PyBall. as a naming prefix. Use this to disable logging if you do not desire these alerts.

pyball's People

Contributors

a-hacker avatar bradleyhurley avatar reddigari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyball's Issues

No check for extra fields

The check in base_model.py for extra fields was removed in commit 91d653b when converted to dataclass. This makes changes in api harder to track.

get_teams() fails because of this 'allStartStatus' new field in API

There is at least a new field in the that is now bieng expected by the Team class
this is 'allStartStatus'

Traceback (most recent call last):
  File "main.py", line 40, in <module>
    main()
  File "main.py", line 12, in main
    teams = pb.get_teams()
  File "/home/omar/projects/saberman-env/lib/python3.7/site-packages/pyball/pyball.py", line 170, in get_teams
    return [Team(**team) for team in results['teams']]
  File "/home/omar/projects/saberman-env/lib/python3.7/site-packages/pyball/pyball.py", line 170, in <listcomp>
    return [Team(**team) for team in results['teams']]
TypeError: __init__() got an unexpected keyword argument 'allStarStatus'

What is the current state of this?

This looks to be the only promising mlbstats api python implementation, however it seems there is a lot to be done to get even basic stats. Are currently implemented? Like hits,ERA, avg on a team or player granularity? Perhaps I am just being a bit dense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.