{"id":17241972,"url":"https://github.com/mtkennerly/clingy","last_synced_at":"2025-03-26T03:21:30.180Z","repository":{"id":43808379,"uuid":"85929604","full_name":"mtkennerly/clingy","owner":"mtkennerly","description":"Clingy lets you save attachments from plain text emails.","archived":false,"fork":false,"pushed_at":"2024-03-17T03:10:02.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T00:20:11.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mtkennerly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2017-03-23T09:14:31.000Z","updated_at":"2022-07-07T20:49:13.000Z","dependencies_parsed_at":"2024-12-03T22:41:46.482Z","dependency_job_id":"fa4c3574-7d00-402b-b2d2-83679dde0cc2","html_url":"https://github.com/mtkennerly/clingy","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"eaea69c5771f1a44e6aa345ab1911f652e6cbed6"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtkennerly%2Fclingy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtkennerly%2Fclingy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtkennerly%2Fclingy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtkennerly%2Fclingy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtkennerly","download_url":"https://codeload.github.com/mtkennerly/clingy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245580380,"owners_count":20638791,"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":[],"created_at":"2024-10-15T06:11:55.844Z","updated_at":"2025-03-26T03:21:30.157Z","avatar_url":"https://github.com/mtkennerly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clingy\nClingy lets you save attachments from plain text emails.\n\nFrom the command line, you can use it like this:\n\n```\nclingy email1.txt email2.txt email3.txt\n```\n\nBy default, the attachments will be saved into the current directory.\nYou can specify a different directory using `-d` or `--directory` like so,\nand the directory will be created if it does not exist:\n\n```\nclingy email.txt -d out\n```\n\nYou can save specific attachments using glob patterns (`-g` or `--glob`)\nand regular expressions (`-r` or `--regex`):\n\n```\nclingy email.txt -g \"*.txt\"\nclingy email.txt -r \"^.+\\.txt$\"\n```\n\nWhen you `pip install clingy`, Python will create a platform-appropriate\nexecutable in the Python Scripts directory. Assuming you have that directory\nin your path, you can just run `clingy` from the console.\n\nYou can also use it as a library:\n\n```python\nimport clingy\n\n# List all attachments from an email file\nclingy.find(\"email.txt\")\n\n# List all attachments from an email string\nwith open(\"email.txt\") as file:\n    clingy.find(file.read())\n\n# Save all attachments by filename\nclingy.save(\"email.txt\")\n\n# Save all attachments by string\nwith open(\"email.txt\") as file:\n    clingy.save(file.read())\n\n# Save single attachment from email.message.Message object\nattachments = clingy.find(\"email.txt\")\nclingy.save(attachments[0])\n\n# Find all TXT files via glob pattern:\nclingy.find(\"email.txt\", glob=\"*.txt\")\n\n# Save all TXT files via regular expression:\nclingy.save(\"email.txt\", regex=r\"^.+\\.txt$\")\n```\n\nThe combo glob/regex matcher is also available for good measure:\n\n```python\nimport clingy\n\nclingy.match(\"foo.txt\", glob=\"*.txt\")\nclingy.match(\"foo.txt\", regex=\"\\.txt$\")\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtkennerly%2Fclingy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtkennerly%2Fclingy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtkennerly%2Fclingy/lists"}