# fastgif
Python package for creating a gif utilizing multiprocessing to speed up the process.
The individual plots are saved in a temp directory and are afterwards cleaned.
This takes into account keyboard interrupts as well.
## Usage
```python
import fastgif
import matplotlib.pyplot as plt
import numpy as np
def get_fig(idx):
x_space = np.linspace(0, 10, 30) + (idx / 20)
fig, ax = plt.subplots(dpi=150)
ax.plot(x_space, np.sin(x_space))
ax.grid()
ax.set_ylim(-1.2, 1.2)
ax.set_xlabel('x')
ax.set_ylabel('sin(x)')
fig.suptitle(f'Sine wave gif')
return fig
fastgif.make_gif(get_fig, 100, 'images/sine.gif', show_progress=True, writer_kwargs={'duration': 0.01})
```
Creates the following gif:
![sine.gif](https://github.com/matejmurin01/fastgif/blob/main/images/sine.gif)
Raw data
{
"_id": null,
"home_page": "https://github.com/matejmurin01/fastgif",
"name": "fastgif",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.12",
"maintainer_email": "",
"keywords": "gif,gifs,animation,matplotlib",
"author": "Matej Mur\u00edn",
"author_email": "matejmurin01@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b4/a5/96f76bc6311d8f181bc1d8d2cd498672917bdac06445ca323c80ef12ce4a/fastgif-2.1.tar.gz",
"platform": null,
"description": "# fastgif\nPython package for creating a gif utilizing multiprocessing to speed up the process.\nThe individual plots are saved in a temp directory and are afterwards cleaned.\nThis takes into account keyboard interrupts as well.\n\n## Usage\n\n```python\nimport fastgif\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef get_fig(idx):\n x_space = np.linspace(0, 10, 30) + (idx / 20)\n\n fig, ax = plt.subplots(dpi=150)\n\n ax.plot(x_space, np.sin(x_space))\n ax.grid()\n ax.set_ylim(-1.2, 1.2)\n ax.set_xlabel('x')\n ax.set_ylabel('sin(x)')\n fig.suptitle(f'Sine wave gif')\n\n return fig\n\n\nfastgif.make_gif(get_fig, 100, 'images/sine.gif', show_progress=True, writer_kwargs={'duration': 0.01})\n```\n\nCreates the following gif:\n\n![sine.gif](https://github.com/matejmurin01/fastgif/blob/main/images/sine.gif)\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Matplotlib GIF maker",
"version": "2.1",
"split_keywords": [
"gif",
"gifs",
"animation",
"matplotlib"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b4a596f76bc6311d8f181bc1d8d2cd498672917bdac06445ca323c80ef12ce4a",
"md5": "bcc9505be507a6d6289ce27e7c77417e",
"sha256": "7973902427e12e524022c00f79e7be81283272e707522d3ba774dc2a72c28393"
},
"downloads": -1,
"filename": "fastgif-2.1.tar.gz",
"has_sig": false,
"md5_digest": "bcc9505be507a6d6289ce27e7c77417e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.12",
"size": 7512,
"upload_time": "2023-03-15T13:26:18",
"upload_time_iso_8601": "2023-03-15T13:26:18.710002Z",
"url": "https://files.pythonhosted.org/packages/b4/a5/96f76bc6311d8f181bc1d8d2cd498672917bdac06445ca323c80ef12ce4a/fastgif-2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-15 13:26:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "matejmurin01",
"github_project": "fastgif",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fastgif"
}