{ "info": { "author": "Juan-Pablo Scaletti", "author_email": "juanpablo@jpscaletti.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# TextEditor\n\nProgrammatically open the system's editor from your Python program (like [webbrowser](https://docs.python.org/3.7/library/webbrowser.html) but for text editors).\n\nUnlike other libraries, *TextEditor* makes an effort to find the text editor the users really prefer, specially for those that doesn't know what an `EDITOR` environment variable is.\n\n```python\nimport texteditor\n\ntext = texteditor.open('This is the starting content')\n```\n\nOpens a temporary file with some content to edit, and returns the new content when\nthe user closes the editor.\n\n```python\ntext = texteditor.open(filename='README.md')\n\n# text = texteditor.open(\"This will be used instead of the file content\", filename='README.md')\n```\n\nYou can also edit an existing text file. If the file cannot be opened, an `OSError` is raised.\n\n\n## Installation\n\nUsing `pip` of course!\n\n```\npip install text-editor\n```\n\n*Note that [the name of the library in PyPi has a dash: text**-**editor](https://github.com/pypa/warehouse/issues/5376).*\n\n## Usage\n\n*texteditor*.**open**(text=None, filename=None, extension='txt', encoding=None)\n\nOpens `filename` or a new temporary file in the default editor.\n\n- *text*:\n The starting content for the edited file. This will also be used instead of the\n original contents of `filename` if one is also defined.\n\n- *filename*:\n Edit this file instead of a new temporary one.\n\n- *extension*:\n When editing a new temporary file, this will help the editor recognize the\n intended filetype, so syntax highlighting and custom settings for that\n filetype can be used. Examples: `txt`, `md`, `ini`.\n Ignored if `filename` is used.\n\n- *encoding*:\n To encode the content and decode the result, `texteditor.open()` uses the default\n encoding for the platform, but you can use an `encoding` argument to specify\n any text encoding supported by Python.\n\n\n## How it Works\n\n`texteditor.open()` first looks for the `$EDITOR` environment variable. If set, it uses\nthe value as-is, including any command-line argument, without fallbacks.\n\nIf no `$EDITOR` is set, it will try to guess.\n\nOn MacOS, it calls the system default for *editing* that file extension.\n\nIn other operating systems, the function will search through a *very short* list of known editors, and use the\nfirst one that founds.\n\nYou might notice that vim and Emacs are not in that short list, that's because:\n\n1. If you are using it, you know what the `EDITOR` variable is, and you probably has set it already.\n2. If you aren't using it, finding yourself in their UI for the first time is going to be super confusing.\n In fact \"How to exit vim\" is a common Stack Overflow question. Having to google how to set an EDITOR\n variable is a less scary alternative.\n\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/jpscaletti/texteditor", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "text-editor", "package_url": "https://pypi.org/project/text-editor/", "platform": "", "project_url": "https://pypi.org/project/text-editor/", "project_urls": { "Homepage": "https://github.com/jpscaletti/texteditor" }, "release_url": "https://pypi.org/project/text-editor/1.0.5/", "requires_dist": null, "requires_python": ">=3.5,<4.0", "summary": "Like webbrowser, but for the text editor.", "version": "1.0.5" }, "last_serial": 5136722, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "370f9b0d4f0badf5fec447a76b7f6f17", "sha256": "d4b4f0b48526db5d23ed8860591efc567e9e53d67f54d4325558ca956271ac0d" }, "downloads": -1, "filename": "Text_Editor-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "370f9b0d4f0badf5fec447a76b7f6f17", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 7720, "upload_time": "2019-02-01T04:26:44", "url": "https://files.pythonhosted.org/packages/b3/16/e110a6499cdd78e6d66e2b364f02321e6c2bcd00064434594c3e63fab7ca/Text_Editor-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "44848efc1d6043352ff4cc952b16b599", "sha256": "56783d767b6a4eaf477525902a51cc36ccc0dd2bfb7f2edea4e2cfc90bed1243" }, "downloads": -1, "filename": "Text-Editor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "44848efc1d6043352ff4cc952b16b599", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4705, "upload_time": "2019-02-01T04:26:42", "url": "https://files.pythonhosted.org/packages/11/e5/b6d42223c9ce4643f50d16d22a4f30e8282f192ddb44cbc166d99bebc07f/Text-Editor-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2a975e7810c72550545025812148ae74", "sha256": "3d7da0e333753a6b777bfa8afb67f2f553e2c0ca14f97c48d3412ecc8b9d5b9b" }, "downloads": -1, "filename": "Text_Editor-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2a975e7810c72550545025812148ae74", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 7704, "upload_time": "2019-02-01T14:47:44", "url": "https://files.pythonhosted.org/packages/56/97/642109026d7102ee4e24b569cefac05815e8ee6d4541b65c9f2fdf41369f/Text_Editor-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d12de9ef085c8d8ee2d789d62e7cf86", "sha256": "c4ddcf9355582b11cfc758189e5e38dbe3c93f61c80b1fac0c3e89aa3bd94ad1" }, "downloads": -1, "filename": "Text-Editor-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1d12de9ef085c8d8ee2d789d62e7cf86", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4693, "upload_time": "2019-02-01T14:47:42", "url": "https://files.pythonhosted.org/packages/58/33/9c0b17968083569ed2c7f037803e833f0a8c04acb6e931d2868ad309321c/Text-Editor-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "d28569e39c7aba9ea64af779fc2b2214", "sha256": "5d93635adae5e5fab8d01485f670bf74fe380007ad1add850080569c745aecc5" }, "downloads": -1, "filename": "Text_Editor-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d28569e39c7aba9ea64af779fc2b2214", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 7974, "upload_time": "2019-02-04T15:27:57", "url": "https://files.pythonhosted.org/packages/1e/3e/7847651a189f500195c78c02f0d6a6af77ebd565ba327d5f0a1fc35fa114/Text_Editor-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19ac6ce1d83be53d68a5a432247d9969", "sha256": "3489438a6a7c3bb4ccbd9ec0750defcbfa5f9756fb57795377f7a4849c5c09ab" }, "downloads": -1, "filename": "Text-Editor-1.0.2.tar.gz", "has_sig": false, "md5_digest": "19ac6ce1d83be53d68a5a432247d9969", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4841, "upload_time": "2019-02-04T15:27:56", "url": "https://files.pythonhosted.org/packages/7d/6b/4e449f5f26dc82b8ffcb8df73195ec00a7d1b81709a83231df7060ffb8a6/Text-Editor-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "c15d69781b9e04b8f515ab18e32220ec", "sha256": "6f56b4bc9154bb1334ba6ebfd00d7764aeb33a81cb212cc36ffb4efc462eb585" }, "downloads": -1, "filename": "Text_Editor-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "c15d69781b9e04b8f515ab18e32220ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 7613, "upload_time": "2019-02-11T17:30:15", "url": "https://files.pythonhosted.org/packages/a7/15/ca140dda0f91cb5a73040d04ef83e932b4ba7fe9628144e24f33d0017853/Text_Editor-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91973d2928eb5c555ec770d8f08c2765", "sha256": "9e23b33e93368f9cc183ad46ddef09a7c6dee6f464d667b35772a117ecb00773" }, "downloads": -1, "filename": "Text-Editor-1.0.3.tar.gz", "has_sig": false, "md5_digest": "91973d2928eb5c555ec770d8f08c2765", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4771, "upload_time": "2019-02-11T17:30:13", "url": "https://files.pythonhosted.org/packages/4b/40/ff9baa674b19da69a0cd609b3af8e30a6d4f3fa0ac06e795d0ed53116364/Text-Editor-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "1f87f146231f106f137585f2a31811cc", "sha256": "3f41a6d0178efd339ec155ab20a81f7d367d3fe173a0d7ba4feafe5f9c02a65b" }, "downloads": -1, "filename": "text_editor-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "1f87f146231f106f137585f2a31811cc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 5255, "upload_time": "2019-04-13T02:10:33", "url": "https://files.pythonhosted.org/packages/89/f8/1f4c98c8f5a9c4a3c27c20129811dd2e01439ae8e21905578072e5ea3b68/text_editor-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c34d88b0de636e5701849ff4dd7013a5", "sha256": "95f440a9e2a6e0d1a396a4fa9402a563eee00a7c2f59b00275ea61c3e76b8041" }, "downloads": -1, "filename": "text-editor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "c34d88b0de636e5701849ff4dd7013a5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4252, "upload_time": "2019-04-13T02:10:35", "url": "https://files.pythonhosted.org/packages/3f/dd/73b47f3b4e5dc6557fb5928f36b1ae6e7619e2b23228e2b6c3ae2976cfac/text-editor-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "764ab843c151afb0e6ec648761cdd660", "sha256": "7ff7964ceb9a2fc12064fef7aeb58c927ee6d31c5b5c80bb3fb0d5309f09c2ee" }, "downloads": -1, "filename": "text_editor-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "764ab843c151afb0e6ec648761cdd660", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 5634, "upload_time": "2019-04-13T03:37:58", "url": "https://files.pythonhosted.org/packages/48/0f/a9c7365de4ba92711cfb3d5dbf6b06d80d4a9684a167fbfd6acd78819fec/text_editor-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "868bd7b86108dcbde71be3bc75305973", "sha256": "07258ab8912d04e08facdba6fa71431d010a4858d8e9f18065920c22ce8be9e2" }, "downloads": -1, "filename": "text-editor-1.0.5.tar.gz", "has_sig": false, "md5_digest": "868bd7b86108dcbde71be3bc75305973", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4276, "upload_time": "2019-04-13T03:38:00", "url": "https://files.pythonhosted.org/packages/6c/86/a03adb168b2eeca48ee42861ef0756ea458841b4fbeda185e07e9b90d665/text-editor-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "764ab843c151afb0e6ec648761cdd660", "sha256": "7ff7964ceb9a2fc12064fef7aeb58c927ee6d31c5b5c80bb3fb0d5309f09c2ee" }, "downloads": -1, "filename": "text_editor-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "764ab843c151afb0e6ec648761cdd660", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 5634, "upload_time": "2019-04-13T03:37:58", "url": "https://files.pythonhosted.org/packages/48/0f/a9c7365de4ba92711cfb3d5dbf6b06d80d4a9684a167fbfd6acd78819fec/text_editor-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "868bd7b86108dcbde71be3bc75305973", "sha256": "07258ab8912d04e08facdba6fa71431d010a4858d8e9f18065920c22ce8be9e2" }, "downloads": -1, "filename": "text-editor-1.0.5.tar.gz", "has_sig": false, "md5_digest": "868bd7b86108dcbde71be3bc75305973", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 4276, "upload_time": "2019-04-13T03:38:00", "url": "https://files.pythonhosted.org/packages/6c/86/a03adb168b2eeca48ee42861ef0756ea458841b4fbeda185e07e9b90d665/text-editor-1.0.5.tar.gz" } ] }