Perform Analysis, Create summary table and charts from cricsheet data
Project description
cricsummary
cricsummary is built for performing cricket analysis on data provided by cricsheet.org. by converting the data in DataFrames or csv files that are better suited for analysis.
- Convert json file to csv.
- Creates DataFrames team-wise.
- Vizualise or Perform your own transformations/analysis on the DataFrames.
- Save the converted file (json to csv)
- Plot Manhattan and Worm charts
This is a useful tool to get started with cricket analysis.
Installation
cricsummary requires python 3.5+ to run.
$ pip install cricsummary
How to Use
Download the data from cricsheet Use the txt file in downloaded folder to check name of the match you want to analyse
>>> from cricsummary import Duranz
>>> match = Duranz('12345.json')
### BUILT IN METHODS FOR ANAYSIS
# team parameter represent innings, team=1 for data of team batted in 1st inning
>>> match.scorecard(team=1)
>>> match.plot_worm()
>>> match.plot_manhattan(team=2)
>>> match.match_info()
>>> match.extras(team=1)
>>> match.fall_of_wickets(team=2)
Do your Analysis
- Access separate DataFrames of teams and do your Operations/Analysis
# returns dict of dataframe where keys are team name with _<innings> suffix
match = Duranz('123.json')
>>> df_dict = match.teams_df
### CONVERT JSON TO CSV
>>> from cricsummary import json_to_csv
# this will save the files of the innings <teamname>_<innings>.csv
>>> json_to_csv('123.json', output_file=True)
Development
Want to contribute? Great! pull request on https://github.com/KunalDuran/cricsummary
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cricsummary-2.0.2.tar.gz
.
File metadata
- Download URL: cricsummary-2.0.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52a1e3bc54cb58b641ba46c6530461f3c6245008ccdd6978694a6c2a0fe8a306 |
|
MD5 | 1e7ec0bd0ee2fee2f299310709ad2fbd |
|
BLAKE2b-256 | 7549ede0d57709d303e4529ec0e3cd19d9666e297430c6560a79b311ab6033df |
File details
Details for the file cricsummary-2.0.2-py3-none-any.whl
.
File metadata
- Download URL: cricsummary-2.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11a5d08768b30c365fbcf8ea4781a383486015bd06dd8e60d53c438cac62dc88 |
|
MD5 | f70d1332fb1173c58f050948e98a1190 |
|
BLAKE2b-256 | e5a79895a9aaefd6bde32496419e768813c2dde03d8d8f6dc7a5dc51516b496e |