{"id":23344387,"url":"https://github.com/rec/editor","last_synced_at":"2025-06-18T12:34:46.373Z","repository":{"id":54286279,"uuid":"281635340","full_name":"rec/editor","owner":"rec","description":"🖋 Open the default text editor 🖋","archived":false,"fork":false,"pushed_at":"2024-03-20T18:25:21.000Z","size":650,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T04:04:06.122Z","etag":null,"topics":["editor","python","text-editor"],"latest_commit_sha":null,"homepage":"https://rec.github.io/editor/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"rec"}},"created_at":"2020-07-22T09:35:03.000Z","updated_at":"2024-08-12T20:04:00.000Z","dependencies_parsed_at":"2022-08-13T11:00:49.295Z","dependency_job_id":"76a03aef-c90a-4b0d-9f11-2d223d49256d","html_url":"https://github.com/rec/editor","commit_stats":{"total_commits":57,"total_committers":3,"mean_commits":19.0,"dds":0.03508771929824561,"last_synced_commit":"41662065bb2f51dae29b36322f41f497beb8050a"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Feditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Feditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Feditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Feditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rec","download_url":"https://codeload.github.com/rec/editor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144296,"owners_count":21054904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editor","python","text-editor"],"created_at":"2024-12-21T06:26:30.062Z","updated_at":"2025-04-10T02:32:50.650Z","avatar_url":"https://github.com/rec.png","language":"Python","funding_links":["https://github.com/sponsors/rec"],"categories":[],"sub_categories":[],"readme":"# 🖋 editor - Open a text editor 🖋\n\n`editor` opens the default text editor or your favorite editor to edit an existing file,\na new file, or a tempfile, blocks while the user edits text, then returns the contents\nof the file.\n\nYou can pass a parameter `editor=` to specify an editor or leave it empty, in which\ncase the editor is:\n\n* The contents of the environment variable `VISUAL`, if it's set, otherwise:\n* The the contents of the environment variable `EDITOR`, if it's set, otherwise:\n* The string `'Notepad'`, if the code is running on Windows, otherwise:\n* The string `'vim'`\n\n### Example 1: Using a temporary file\n\nIf no filename is provided, a temporary file gets edited, and its contents\nreturned.\n\n    import editor\n\n    comments = editor.editor(text='Comments here\\n\\n')\n    # Pop up the default editor with a tempfile containing \"Comments here\",\n    # then return the contents and delete the tempfile.\n\n### Example 2: Using a named file\n\nIf a filename is provided, then that file gets edited.\n\n    import os\n\n    FILE = 'file.txt'\n    assert not os.path.exists(FILE)\n\n    comments = editor.editor(text=MESSAGE, filename=FILE)\n    # Pop up an editor for a new FILE containing MESSAGE, user edits\n    # This file is saved when the user exits the editor.\n\n    assert os.path.exists(FILE)\n\n    # You can edit an existing file too, and select your own editor.\n    comments2 = editor.editor(filename=FILE, editor='emacs -nw')\n\n### [API Documentation](https://rec.github.io/editor#editor--api-documentation)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frec%2Feditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frec%2Feditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frec%2Feditor/lists"}