{ "info": { "author": "Lucian Cooper", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "# bbcmd\n\n[![PyPI version shields.io](https://img.shields.io/pypi/v/bbcmd.svg)](https://pypi.python.org/pypi/bbcmd/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/bbcmd.svg)](https://pypi.python.org/pypi/bbcmd/)\n[![PyPI license](https://img.shields.io/pypi/l/bbcmd.svg)](https://pypi.python.org/pypi/bbcmd/)\n\nCommand Line Baseball Data Tools. This project includes 2 command line tools for generating a variety of stats and scraping data from the web.\n\n### Contents\n* [Installation](#installation)\n* [Scraper](#scraping)\n* [Simulator Setup](#simulator_setup)\n* [Simulator Usage](#simulator_usage)\n\n\n# Installation\n\nUse `pip` via [PyPi](https://pypi.org)\n\n```bash\npip install bbcmd\n```\n\n**Or** use `git`\n\n```bash\ngit clone git://github.com/luciancooper/bbcmd.git bbcmd\ncd bbcmd\npython setup.py install\n```\n##### Install Notes\nThis project depends on [cmdprogress](https://github.com/luciancooper/cmdprogress) for command line progress bars\n\n##### Commands\nAfter installation, the `bbsim` and `bbscrape` commands should be in your systems path, via the `Scripts` directory of your Python installation\n\n# Scraper\n\nThe `bbscrape` command is a tool that scrapes data from the following websites:\n * [baseball-reference.com](baseball-reference.com)\n * [fangraphs.com](fangraphs.com)\n * [spotrac.com](spotrac.com)\n\n\n# Simulator Setup\n\n### Step 1. Download Data\n\nDownload the necessary play by play data source files that the simulator depends on to run simulations. These files are stored on github in the [bbsrc](https://github.com/luciancooper/bbsrc) repository. The data in these files is derived from the play by play data provided by [retrosheet.org](https://www.retrosheet.org/). Retrosheet is an amazing organization that has painstakingly compiled the play by play data for every MLB game dating back to 1921. Find out more about the Retrosheet project [here](https://www.retrosheet.org/about.htm).\n\n```bash\nbbsim setup --env years path\n```\n * `years` - **required**: the specified MLB seasons you wish to download play by play data for, can be a single year (`2016`), range of years (`2014-2016`) or comma separated combination of the two (`2012-2014,2016` or `2012-2014,2015-2017`, etc.)\n * `path` - **optional**: the local path in which you wish to keep store your play by play data files. You will want to remember this location, as you will have to come back later if you want to delete these files. If not specified, the current working directory will be used\n\n### Step 2. Create Data Pointer\n\n```bash\nbbsim setup --xml years path\n```\n * `years` - **required**: the specified MLB seasons you wish `bbdata.xml` to point to. Can be a single year (`2016`), range of years (`2014-2016`) or comma separated combination of the two (`2012-2014,2016` or `2012-2014,2015-2017`, etc.)\n * `path` - **optional**: the local path in which you wish to create the pointer file in. This is the directory you will be running your simulations in later, so again, remember this location. If not specified, the current working directory will be used. If you want to keep it simple, specify the same path as in the previous command\n\n\n### Step 3. Run a test\n\nIf the current path does not contain your `bbdata.xml` file, navigate to that path. Run the following command, which will simulate the games for all the seasons specified by `bbdata.xml`, without recording any of the data. \n```bash\nbbsim test game\n```\n\n# Simulator Usage\n\nThe following simulations are currently supported by this project\n\n### Gamescores\n\nThe `gamescore` command generates data grouped by mlb game. Columns include:\n> `ascore,hscore,aout,hout`\n\n```bash\nbbsim gamescore [-v] [-y YEARS]\n```\n\n\n### Generate Aggregated Stats\n\nThe `batting`, `fielding`, `pitching`, and `rbi` commands generate aggregated stats. By default, the simulator will group the outputted data by season. The following optional flags will change how the data is grouped.\n * `-l` : by league (AL and NL).\n * `-t` : by team\n * `-g` : by game\n * `-p` : by player (8 character playerid)\n * `-ph` : by player hand (batting hand or pitching hand)\n * `-phm` : by player hand matchups\n\n#### `batting` command\n\nThe `batting` command generates offensive stats. Columns include:\n> `O,E,S,D,T,HR,BB,IBB,HBP,K,I,SH,SF,GDP,R,RBI,SB,CS,PO`\n\nThe `batting` command has an additional optional flag: `-np` or `--nopitcher`. If this is included, the simulator will ignore pitchers when aggregating results.\n\n```bash\nbbsim batting [-l | -t | -g | -p | -ph | -phm] [-v] [-np] [-y YEARS]\n```\n\n#### `fielding` command\n\nThe `fielding` command generates defensive aggregated stats. Columns include:\n> `UR,TUR,P,A,E,PB`\n\n```bash\nbbsim fielding [-l | -t | -g | -p] [-v] [-y YEARS]\n```\n\n#### `pitching` command\n\nThe `pitching` command generates aggregated pitching stats. Columns include:\n> `W,L,SV,IP,BF,R,ER,S,D,T,HR,BB,HBP,IBB,K,BK,WP,PO,GDP`\n\n```bash\nbbsim pitching [-l | -t | -g | -p | -ph | -phm] [-v] [-y YEARS]\n```\n\n#### `rbi` command\n\nThe `rbi` command generates details about each event in which an RBI was credited\n> `RBI,O,E,S,D,T,HR,BB,IBB,HBP,K,I,SF,SH,GDP`\n\n```bash\nbbsim rbi [-l | -t | -g | -p | -ph | -phm] [-v] [-y YEARS]\n```\n\n### Generate Appearance Stats\n\n#### `appearance` command\n\n```bash\nbbsim appearance [normal | lahman | position | simple] [-v] [-y YEARS]\n```\n* `-v` - **optional**:\n* `-y YEARS`\n\n\n### Generate Advanced Stats\n\nCurrently two sub commands supported:\n * woba: simulates the seasonal linear weights used for calculating weighted \n```bash\nbbsim advcalc (woba | war) [-v] [-y YEARS]\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/luciancooper/bbcmd", "keywords": "baseball statistics sabermetrics", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bbcmd", "package_url": "https://pypi.org/project/bbcmd/", "platform": "", "project_url": "https://pypi.org/project/bbcmd/", "project_urls": { "Homepage": "https://github.com/luciancooper/bbcmd" }, "release_url": "https://pypi.org/project/bbcmd/1.2/", "requires_dist": [ "cmdprogress", "numpy", "pandas", "beautifulsoup4" ], "requires_python": "", "summary": "Baseball Statistics Simulator", "version": "1.2" }, "last_serial": 4633822, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "e05422900ac9ad205c5bd90bff1f249a", "sha256": "6dad54aa170b8891b5df01d65d72f40e2317c487517cbc3cc696b7043bd1c542" }, "downloads": -1, "filename": "bbcmd-1.0.tar.gz", "has_sig": false, "md5_digest": "e05422900ac9ad205c5bd90bff1f249a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40364, "upload_time": "2018-12-03T23:58:35", "url": "https://files.pythonhosted.org/packages/ea/28/072b8f6921c5e1eee73687b31e1f09181d8de9f3c6ff6c16374fea961fed/bbcmd-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "9c1b55fe85f730ee3b3e2651b02cc06d", "sha256": "dbf1dc2c2d7bd8941fdf85e76ad53b8fe0d9af457c1474befd75354e4f3007f4" }, "downloads": -1, "filename": "bbcmd-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9c1b55fe85f730ee3b3e2651b02cc06d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40395, "upload_time": "2018-12-04T00:09:11", "url": "https://files.pythonhosted.org/packages/04/7c/164447fe451b5f4c876f10f6a8aecbce7a96491a92f8cd7f63314338c7d5/bbcmd-1.0.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "31c333316616108d118d2a15d51f994d", "sha256": "11ddccaa7c429bfa392b00be0d72101b03b207fa0dac49cdc0bb5850efb32c29" }, "downloads": -1, "filename": "bbcmd-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "31c333316616108d118d2a15d51f994d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 58849, "upload_time": "2018-12-25T17:30:43", "url": "https://files.pythonhosted.org/packages/26/6f/294cdebf268af288d3e88d343599cd41c76aee28a1745af6ea374c3082ba/bbcmd-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12e451a9eeb06d1a46a1b1e7913951a1", "sha256": "f80da7ec78e663ec74d2ba1a3bdc4f93e4108c4502ae76116937f6e390e3efc5" }, "downloads": -1, "filename": "bbcmd-1.2.tar.gz", "has_sig": false, "md5_digest": "12e451a9eeb06d1a46a1b1e7913951a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43317, "upload_time": "2018-12-25T17:30:45", "url": "https://files.pythonhosted.org/packages/18/75/1a3d40f52f45b8126bccdd67e2f7e62cf4f1848d65bbe239bb5e18fda99e/bbcmd-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "31c333316616108d118d2a15d51f994d", "sha256": "11ddccaa7c429bfa392b00be0d72101b03b207fa0dac49cdc0bb5850efb32c29" }, "downloads": -1, "filename": "bbcmd-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "31c333316616108d118d2a15d51f994d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 58849, "upload_time": "2018-12-25T17:30:43", "url": "https://files.pythonhosted.org/packages/26/6f/294cdebf268af288d3e88d343599cd41c76aee28a1745af6ea374c3082ba/bbcmd-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12e451a9eeb06d1a46a1b1e7913951a1", "sha256": "f80da7ec78e663ec74d2ba1a3bdc4f93e4108c4502ae76116937f6e390e3efc5" }, "downloads": -1, "filename": "bbcmd-1.2.tar.gz", "has_sig": false, "md5_digest": "12e451a9eeb06d1a46a1b1e7913951a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43317, "upload_time": "2018-12-25T17:30:45", "url": "https://files.pythonhosted.org/packages/18/75/1a3d40f52f45b8126bccdd67e2f7e62cf4f1848d65bbe239bb5e18fda99e/bbcmd-1.2.tar.gz" } ] }