Name | plotly-football-pitch JSON |
Version |
0.0.2
JSON |
| download |
home_page | |
Summary | Package to allow creation of football pitch charts using plotly |
upload_time | 2023-02-01 22:05:13 |
maintainer | Andrew Davies |
docs_url | None |
author | Andrew Davies |
requires_python | >=3.8 |
license | This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <https://unlicense.org> |
keywords |
soccer
football
plotly
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# plotly-football-pitch
![tests](https://github.com/minimav/plotly_football_pitch/actions/workflows/test.yml/badge.svg)
This repo contains code to plot football pitches using `plotly`. Currently only horizontal pitches are supported, with the origin located at the bottom left
corner of the pitch.
## Examples
Further examples can be found in `examples/pitch.ipynb`.
```python
from plotly_football_pitch import make_pitch_figure, PitchDimensions
dimensions = PitchDimensions()
fig = make_pitch_figure(dimensions)
fig.show()
```
![basic pitch](images/basic_pitch.png)
```python
from plotly_football_pitch import (
make_pitch_figure,
PitchDimensions,
SingleColourBackground
)
dimensions = PitchDimensions()
fig = make_pitch_figure(
dimensions,
pitch_background=SingleColourBackground("#81B622"),
)
fig.show()
```
![green pitch](images/green_pitch.png)
```python
import numpy as np
from plotly_football_pitch import make_pitch_figure, PitchDimensions
dimensions = PitchDimensions()
fig = make_pitch_figure(dimensions)
# define number of grid squares for heatmap data
width_grid = 12
length_grid = 15
data = np.array([
[random.random() for _ in range(length_grid)]
for _ in range(width_grid)
])
fig = add_heatmap(fig, data)
fig.show()
```
![basic pitch with heatmp](images/basic_pitch_with_heatmap.png)
## Installation
`pip install plotly_football_pitch`
## Development installation
```bash
make setup-env
source .venv/bin/activate
make dev-install
```
Raw data
{
"_id": null,
"home_page": "",
"name": "plotly-football-pitch",
"maintainer": "Andrew Davies",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "soccer,football,plotly",
"author": "Andrew Davies",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/0c/8c/d8031c0fb00809cec9f611ff4c49ccb14cf9973a7d9c89a48fdb9a336c06/plotly_football_pitch-0.0.2.tar.gz",
"platform": null,
"description": "# plotly-football-pitch\n\n![tests](https://github.com/minimav/plotly_football_pitch/actions/workflows/test.yml/badge.svg)\n\nThis repo contains code to plot football pitches using `plotly`. Currently only horizontal pitches are supported, with the origin located at the bottom left\ncorner of the pitch.\n\n## Examples\n\nFurther examples can be found in `examples/pitch.ipynb`.\n\n```python\nfrom plotly_football_pitch import make_pitch_figure, PitchDimensions\n\n\ndimensions = PitchDimensions()\nfig = make_pitch_figure(dimensions)\nfig.show()\n```\n\n![basic pitch](images/basic_pitch.png)\n\n```python\nfrom plotly_football_pitch import (\n make_pitch_figure,\n PitchDimensions,\n SingleColourBackground\n)\n\n\ndimensions = PitchDimensions()\nfig = make_pitch_figure(\n dimensions,\n pitch_background=SingleColourBackground(\"#81B622\"),\n)\nfig.show()\n```\n\n![green pitch](images/green_pitch.png)\n\n```python\nimport numpy as np\n\nfrom plotly_football_pitch import make_pitch_figure, PitchDimensions\n\n\ndimensions = PitchDimensions()\nfig = make_pitch_figure(dimensions)\n\n# define number of grid squares for heatmap data\nwidth_grid = 12\nlength_grid = 15\n\ndata = np.array([\n [random.random() for _ in range(length_grid)]\n for _ in range(width_grid)\n])\n\nfig = add_heatmap(fig, data)\nfig.show()\n```\n\n![basic pitch with heatmp](images/basic_pitch_with_heatmap.png)\n\n## Installation\n\n`pip install plotly_football_pitch`\n\n## Development installation\n\n```bash\nmake setup-env\nsource .venv/bin/activate\nmake dev-install\n```\n",
"bugtrack_url": null,
"license": "This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <https://unlicense.org> ",
"summary": "Package to allow creation of football pitch charts using plotly",
"version": "0.0.2",
"split_keywords": [
"soccer",
"football",
"plotly"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "27d439894cdcdff602375d5639a9038923d35a78a23d7be97daf5f3c36035ac6",
"md5": "86d0f7cfd625fb02aaa0495a986353a3",
"sha256": "fd33091145dd483b3c1d6f87c3e39f2b04f4304e004c22291822213681874f19"
},
"downloads": -1,
"filename": "plotly_football_pitch-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "86d0f7cfd625fb02aaa0495a986353a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9213,
"upload_time": "2023-02-01T22:05:12",
"upload_time_iso_8601": "2023-02-01T22:05:12.009294Z",
"url": "https://files.pythonhosted.org/packages/27/d4/39894cdcdff602375d5639a9038923d35a78a23d7be97daf5f3c36035ac6/plotly_football_pitch-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0c8cd8031c0fb00809cec9f611ff4c49ccb14cf9973a7d9c89a48fdb9a336c06",
"md5": "5c6b17390d5698e2beb74993c0d1bc65",
"sha256": "3f522bd8213a3deadf8e106cfa85e225478f8c5f46f076ac9e936ae49ee00cec"
},
"downloads": -1,
"filename": "plotly_football_pitch-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "5c6b17390d5698e2beb74993c0d1bc65",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8852,
"upload_time": "2023-02-01T22:05:13",
"upload_time_iso_8601": "2023-02-01T22:05:13.566609Z",
"url": "https://files.pythonhosted.org/packages/0c/8c/d8031c0fb00809cec9f611ff4c49ccb14cf9973a7d9c89a48fdb9a336c06/plotly_football_pitch-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-01 22:05:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "plotly-football-pitch"
}