{ "info": { "author": "Patrick Steinmann", "author_email": "patrick.steinmann@wur.nl", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# aul\n\nExport [NetLogo](https://ccl.northwestern.edu/netlogo/) model runs as GIF or MP4 using Python.\n\n## Purpose\nThe purpose of this project is to provide a simple and reliable way of capturing/exporting NetLogo model runs in moving image file formats.\nCurrently, MP4 and GIF are supported. These formats are suitable for sharing on social media or instant messager, or embedding in presentations or\ndocuments.\n\n## Installation\n\nThis library was tested on Python 3.6. Requirements are:\n* [pyNetLogo](http://pynetlogo.readthedocs.io/en/latest/)\n* [imageio](http://imageio.github.io/)\n* [imageio-ffmpeg](https://github.com/imageio/imageio-ffmpeg) (if you want MP4 export)\n\nThese packages also have their own requirements, notably [pyNetLogo's jpype dependency](https://pynetlogo.readthedocs.io/en/latest/install.html).\n\nInstall using:\n\n```\npip install aul\n```\n\n## Usage\n\nThe two main functions in the package are `export_gif(...)` and `export_mp4(...)`. Both can take a variety of arguments, but also have useful default behavior. \nTwo parameters are required: the NetLogo model name (must be in same folder as Python file), and the ticks to be exported. The generated file will be saved to\nthe same folder as the model.\n\n### Terminology\n\nThe terms *tick* and *frame* may be confusing. I use the term *tick* to refer to a single iteration step in the NetLogo model. Ticks are unique and sequentially numbered.\n*Frames* are individual images inside a GIF or MP4 (both of which are series of images). You can specify which ticks become frames with the `ticks` argument.\n\n### Basics\n\nExport first 30 ticks of NetLogo run to GIF...\n\n```py\nimport aul\n\naul.export_gif('Fire.nlogo', 30)\n\n```\n\nor MP4.\n\n```py\nimport aul\n\naul.export_mp4('Fire.nlogo', 30)\n\n```\n\n### Ticks\n\nYou can specify ticks (see Terminology) in four ways - as an integer (see Basics), as a two- or three-element list of Python `range()` parameters, or as an explicit list of ticks:\n\n```py\nimport aul\n\n#ticks 0 to 24\naul.export_gif('Fire.nlogo', [0,25])\n\n```\n\nif you don't want every tick:\n\n```py\nimport aul\n\n#every tenth tick from 0 to 190\naul.export_gif('Fire.nlogo', [0,200,10])\n\n```\n\nfor specific ticks:\n\n```py\nimport aul\n\n#specific ticks only\naul.export_gif('Fire.nlogo', [0,1,2,3,4,5,7,8,9,12,22])\n\n```\n\n### General Arguments\nNetLogo runs will normally be instantiated with the input parameter values saved in the NetLogo model's sliders, switches, etc.\nYou can override these values directly from Python by passing a dictionary of keys (NetLogo global variable name) and values to `params`:\n\n```py\nimport aul\n\nfire_params = {\n \"density\":90,\n \"probability-of-spread\":60\n}\n\naul.export_gif('Fire Simple Extension 1.nlogo', 45, params = fire_params)\n\n```\n\nBy default, the generated file will have the same pixel dimensions as the NetLogo world. You can adjust this with `scale`:\n\n```py\nimport aul\n\n#GIF file will be twice as large as NetLogo world\naul.export_gif('Fire.nlogo', 45, scale = 2.0)\n\n```\n\nYou can also fade the last few frames of the run to black (to emphasize it is terminating) with `fade`:\n\n```py\nimport aul\n\n#GIF will fade to black over last 30% of runtime\naul.export_gif('Fire.nlogo', 45, fade = 0.3)\n\n```\n\nYou can set the name of the output file with `name`. \nThis is useful if you to export multiple runs (e.g. with different random seeds) through a loop.\n\n```py\nimport aul\n\n#GIF will be saved as \"custom-fire.gif\"\naul.export_gif('Fire.nlogo', 45, name = \"custom-fire\")\n\n```\n\nPer NetLogo conventions, the initialization and iteration procedures are expected to be named *setup* and *go*. Override these\ndefaults with the `setup` and `go` parameters. \n\n```py\nimport aul\n\n#Some custom model with unconventional procedure names\naul.export_gif('Custom.nlogo', 45, setup='init', go='run')\n\n```\n\nAdjust the playback speed of the output file with `fps` (frames per second).\n\n```py\nimport aul\n\n#Save for playback at 8 frames per second\naul.export_gif('Fire.nlogo', 45, fps = 8)\n\n```\n\n### GIF-specific Arguments\n\nYou can reduce GIF file size by settings `subrectangles = True`.\n\n```py\nimport aul\n\n#compress file\naul.export_gif('Fire.nlogo', 45, subrectangles = True)\n\n```\n\nYou can override the `fps` parameter and specify frame durations instead with `duration`. This can be either as a global value\n(time per frame), or as a specific value for each individual frame.\n\n```py\nimport aul\n\n#show first 15 frames in Fibonacci time\naul.export_gif('Fibonacci.nlogo', 15, duration = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610])\n\n```\n\n### MP4-specific Arguments\n\nYou can reduce MP4 file size with the `quality` argument. Range from 0 to 10, 10 being default and best quality.\n\n```py\nimport aul\n\n#compress file\naul.export_mp4('Fire.nlogo', 45, quality = 3)\n\n```\n\n## Contact\nPlease get in touch if you have questions or suggestions, either through an issue or on: \n* Twitter - [@steipatr](https://twitter.com/steipatr)\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/steipatr/aul", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "aul", "package_url": "https://pypi.org/project/aul/", "platform": "", "project_url": "https://pypi.org/project/aul/", "project_urls": { "Homepage": "https://github.com/steipatr/aul" }, "release_url": "https://pypi.org/project/aul/0.1.2/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A package to export NetLogo model runs in GIF or MP4 formats", "version": "0.1.2" }, "last_serial": 5871996, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "df532fa15c778870e8408b60a1a89884", "sha256": "038c992c87ca87eb346840258622fd8992b389bd12310fcf037a0211db939aa4" }, "downloads": -1, "filename": "aul-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "df532fa15c778870e8408b60a1a89884", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6248, "upload_time": "2019-09-16T07:46:55", "url": "https://files.pythonhosted.org/packages/bc/a1/266eb6c2df2111f32f9e6da262f078cc42fc91a1e89cb346db7127a63807/aul-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d94dbc6975091ec447eb7766616ba9a1", "sha256": "3d2e78c16d83ebae7148f3313b1fe568f1c75bbc31e22c0e44aef119126c5518" }, "downloads": -1, "filename": "aul-0.1.tar.gz", "has_sig": false, "md5_digest": "d94dbc6975091ec447eb7766616ba9a1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5135, "upload_time": "2019-09-16T07:46:58", "url": "https://files.pythonhosted.org/packages/0c/f5/0430dfad4cbe6cc41a626303076f9fe723c07b040c9e4bea7ecc3beb1c11/aul-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "047e42d250d36eb83a575957b2187654", "sha256": "edc1de7c10fcfed500e2bc5b5edb6093c931784b029a86e2686cee9eaa8c76a8" }, "downloads": -1, "filename": "aul-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "047e42d250d36eb83a575957b2187654", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6336, "upload_time": "2019-09-16T13:42:31", "url": "https://files.pythonhosted.org/packages/0f/9c/463f02b88b30a52ea51de02a5daa5dc1f151a1c10a2f399dc8577b805e4a/aul-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a6ca6c93b676d36c253ef50f18bda8b", "sha256": "7600afe05b3b2888e261bb2a090db2caf7eeb2c0f6caedd6844df0e308dc90eb" }, "downloads": -1, "filename": "aul-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2a6ca6c93b676d36c253ef50f18bda8b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5222, "upload_time": "2019-09-16T13:42:33", "url": "https://files.pythonhosted.org/packages/79/d1/169e25291311896d856d362404bbbd68b5b5996c4a4ba31697f1fdd360f1/aul-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "61fce692e5fab843c9b059300009c7e7", "sha256": "8fa60cbda7b3f8763dcf322188b2fbbed17983a0a71f9e3556faf74b83863c5d" }, "downloads": -1, "filename": "aul-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "61fce692e5fab843c9b059300009c7e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6888, "upload_time": "2019-09-23T07:33:01", "url": "https://files.pythonhosted.org/packages/8d/05/f1bc512e342e9777bdf5dae3612ff2d875c8a6caceb40c6a82dbe8f8f35c/aul-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e81802788f7a0dc720aa4343a3952d2", "sha256": "6afa9627e51f15826ac14dcf3183c870b4da97458427c006e88f36c1e66719f1" }, "downloads": -1, "filename": "aul-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7e81802788f7a0dc720aa4343a3952d2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5841, "upload_time": "2019-09-23T07:33:03", "url": "https://files.pythonhosted.org/packages/6d/9a/9e891cffaa17f971852ee91bbd1cd6b2808a2ac600091a356d858da36db6/aul-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "61fce692e5fab843c9b059300009c7e7", "sha256": "8fa60cbda7b3f8763dcf322188b2fbbed17983a0a71f9e3556faf74b83863c5d" }, "downloads": -1, "filename": "aul-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "61fce692e5fab843c9b059300009c7e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6888, "upload_time": "2019-09-23T07:33:01", "url": "https://files.pythonhosted.org/packages/8d/05/f1bc512e342e9777bdf5dae3612ff2d875c8a6caceb40c6a82dbe8f8f35c/aul-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e81802788f7a0dc720aa4343a3952d2", "sha256": "6afa9627e51f15826ac14dcf3183c870b4da97458427c006e88f36c1e66719f1" }, "downloads": -1, "filename": "aul-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7e81802788f7a0dc720aa4343a3952d2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5841, "upload_time": "2019-09-23T07:33:03", "url": "https://files.pythonhosted.org/packages/6d/9a/9e891cffaa17f971852ee91bbd1cd6b2808a2ac600091a356d858da36db6/aul-0.1.2.tar.gz" } ] }