{ "info": { "author": "Axel Juraske", "author_email": "axel.juraske@short-report.de", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "==========\ncode2image\n==========\n\n.. image:: https://img.shields.io/pypi/v/code2image.svg\n :target: https://pypi.python.org/pypi/code2image\n\nCreate code snippet with pygments and pillow.\n\n\n\nInstall\n-------\n.. code-block:: shell\n\n $ pip install code2image\n\nBasic uses\n----------\n.. code-block:: shell\n\n $ python examples/shadow.py\n\n.. image:: https://raw.githubusercontent.com/axju/code2image/master/examples/shadow.png\n :align: center\n\nThis package was developed to automate some boring image creation process. But\nit has also a script for some command line fun.\n\n.. code-block:: shell\n\n $ code2image --help\n usage: code2image [-h] [--kind {simple,shadow,background}]\n [--imagename IMAGENAME] [--code CODE]\n [--background BACKGROUND] [--font-size FONT_SIZE]\n [--font-name FONT_NAME] [--line_pad LINE_PAD]\n [--line-numbers] [--shadow-color SHADOW_COLOR]\n [--shadow-dt SHADOW_DT] [--offset OFFSET] [--blur BLUR]\n [--epilog EPILOG]\n codefile\n\n Create nice code snippets\n\n positional arguments:\n codefile The code file\n\n optional arguments:\n -h, --help show this help message and exit\n --kind {simple,shadow,background}\n Change the result\n --imagename IMAGENAME\n The output image\n --code CODE Code background color\n --background BACKGROUND\n Image background color\n --font-size FONT_SIZE\n font size\n --font-name FONT_NAME\n font name\n --line_pad LINE_PAD line pad\n --line-numbers line numbers\n --shadow-color SHADOW_COLOR\n Shadow color\n --shadow-dt SHADOW_DT\n Shadow offset\n --offset OFFSET Border width\n --blur BLUR Shadow blur\n --scale SCALE A scale\n --epilog EPILOG A epilog\n\nTo create nice images for instagram:\n\n.. code-block:: shell\n\n $ code2image --kind background --scale 1 /pathe/to/code/file\n\nPython examples\n---------------\n\n.. code-block:: python\n\n from code2image.cls import Code2Image\n\n c2i = Code2Image()\n\n # load the source code from this file\n with open(__file__) as f:\n code = f.read()\n\n # create the image with highlighted code\n img = c2i.highlight(code)\n\n # save the image\n img.save('simple.png')\n\nSee the \"examples\" folder for more.\n\n\nDevelopment\n-----------\nClone repo\n\n.. code-block:: shell\n\n $ git clone https://github.com/axju/code2image.git\n\nCreate virtual environment for linux\n\n.. code-block:: shell\n\n $ python3 -m venv venv\n $ source venv/bin/activate\n\nor create virtual environment for windows\n\n.. code-block:: shell\n\n $ python -m venv venv\n $ venv/Scripts/activate\n\nupdate dev-tools\n\n.. code-block:: shell\n\n $ python -m pip install --upgrade wheel pip setuptools twine tox flake8\n\nInstall local\n\n.. code-block:: shell\n\n $ pip install -e .\n\nPublish the packages\n\n.. code-block:: shell\n\n $ python setup.py sdist bdist_wheel\n $ twine upload dist/*\n\nRun some tests\n\n.. code-block:: shell\n\n $ flake8 code2image\n $ python setup.py test\n $ python -m unittest discover -v\n $ tox\n\nI do not know why, but tox will fail :(\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/axju/code2image", "keywords": "pillow image pygments code snippets", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "code2image", "package_url": "https://pypi.org/project/code2image/", "platform": "", "project_url": "https://pypi.org/project/code2image/", "project_urls": { "Homepage": "https://github.com/axju/code2image" }, "release_url": "https://pypi.org/project/code2image/0.0.3/", "requires_dist": [ "pygments", "pillow" ], "requires_python": "", "summary": "Create code snippet with pygments and pillow", "version": "0.0.3" }, "last_serial": 4899705, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c7ec2647a46a81b72359f7c48018cf85", "sha256": "e7ee1296f1e883fbf4725a83213698fa19dceaf0aa55c69dbf56c5edecfc4abd" }, "downloads": -1, "filename": "code2image-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c7ec2647a46a81b72359f7c48018cf85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6304, "upload_time": "2019-03-02T12:09:04", "url": "https://files.pythonhosted.org/packages/83/67/e46b9e51cd313637d55f3b449d7e9d0d56eb06777b92bd5224c234459329/code2image-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f931ecd2e66936e786bf5411c0ed8782", "sha256": "bba09b929970705c0f4984e705c14bf2e504b8cd6bc1613ce5d64fa706b9cd80" }, "downloads": -1, "filename": "code2image-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f931ecd2e66936e786bf5411c0ed8782", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4104, "upload_time": "2019-03-02T12:09:06", "url": "https://files.pythonhosted.org/packages/0c/28/42977ac3b5aea6f8b95f367adc76f9bcd0fd19933d12bc22021daa296390/code2image-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "bdb4fa69d34a4e7f9bae9224fe05b46a", "sha256": "e8f53824755da299262bad742ce699ed5c4e2c7b4d358ad4b4436797dd8b6245" }, "downloads": -1, "filename": "code2image-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bdb4fa69d34a4e7f9bae9224fe05b46a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7430, "upload_time": "2019-03-05T10:09:05", "url": "https://files.pythonhosted.org/packages/c0/4e/5cb6ae2a7e06646d6ee3296998d33a1cad6d2af51e8c8627f94d92a8c900/code2image-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c69179244a62bb3afee4c3a504a0bc8c", "sha256": "93946cd9643c73b702cc0b90baed796ac33c6969e08a857d5923fe91bbd84e55" }, "downloads": -1, "filename": "code2image-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c69179244a62bb3afee4c3a504a0bc8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5258, "upload_time": "2019-03-05T10:09:06", "url": "https://files.pythonhosted.org/packages/fd/31/9eaf96329a5498c7fa9a074ea43c154dd64c596654e70c2d27f684844ae5/code2image-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "30641c0cb5c302a526f536c88bb1871b", "sha256": "86c6fcd4edda20abf1d66d5b5a7c48cf18cb2eb90374be9853732c6b8c696b84" }, "downloads": -1, "filename": "code2image-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "30641c0cb5c302a526f536c88bb1871b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7564, "upload_time": "2019-03-05T13:40:00", "url": "https://files.pythonhosted.org/packages/fa/64/57d2275574a9b36cd3ab51fb1e3fccf121f98cca38abcc76b0314fc85f91/code2image-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a0e3fb991d43b9b118aa4e8f786e5f2", "sha256": "7fff19e988f8d08ace6ab104bd85a0fc213b530a70a768028bc08f1a26870324" }, "downloads": -1, "filename": "code2image-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5a0e3fb991d43b9b118aa4e8f786e5f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5400, "upload_time": "2019-03-05T13:40:02", "url": "https://files.pythonhosted.org/packages/a9/98/5ff1dd36e8962e2bb3efe5baf029fc7a1111c8bda3f9afe86b290ed6e5d5/code2image-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "30641c0cb5c302a526f536c88bb1871b", "sha256": "86c6fcd4edda20abf1d66d5b5a7c48cf18cb2eb90374be9853732c6b8c696b84" }, "downloads": -1, "filename": "code2image-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "30641c0cb5c302a526f536c88bb1871b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7564, "upload_time": "2019-03-05T13:40:00", "url": "https://files.pythonhosted.org/packages/fa/64/57d2275574a9b36cd3ab51fb1e3fccf121f98cca38abcc76b0314fc85f91/code2image-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a0e3fb991d43b9b118aa4e8f786e5f2", "sha256": "7fff19e988f8d08ace6ab104bd85a0fc213b530a70a768028bc08f1a26870324" }, "downloads": -1, "filename": "code2image-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5a0e3fb991d43b9b118aa4e8f786e5f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5400, "upload_time": "2019-03-05T13:40:02", "url": "https://files.pythonhosted.org/packages/a9/98/5ff1dd36e8962e2bb3efe5baf029fc7a1111c8bda3f9afe86b290ed6e5d5/code2image-0.0.3.tar.gz" } ] }