{"id":32151579,"url":"https://github.com/miximka/mimeparser","last_synced_at":"2026-02-19T02:02:20.731Z","repository":{"id":29233445,"uuid":"113897154","full_name":"miximka/MimeParser","owner":"miximka","description":"Mime parsing in Swift | Relevant RFCs: RFC 822, RFC 2045, RFC 2046","archived":false,"fork":false,"pushed_at":"2023-06-09T06:10:52.000Z","size":117,"stargazers_count":31,"open_issues_count":4,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-01T10:47:17.214Z","etag":null,"topics":["mime","parser","parsing","rfc-822","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/miximka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T19:05:33.000Z","updated_at":"2025-12-24T10:34:51.000Z","dependencies_parsed_at":"2023-02-10T23:31:06.142Z","dependency_job_id":null,"html_url":"https://github.com/miximka/MimeParser","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/miximka/MimeParser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miximka%2FMimeParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miximka%2FMimeParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miximka%2FMimeParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miximka%2FMimeParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miximka","download_url":"https://codeload.github.com/miximka/MimeParser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miximka%2FMimeParser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29600847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"online","status_checked_at":"2026-02-19T02:00:07.702Z","response_time":117,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mime","parser","parsing","rfc-822","swift"],"created_at":"2025-10-21T10:47:46.156Z","updated_at":"2026-02-19T02:02:20.725Z","avatar_url":"https://github.com/miximka.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://app.travis-ci.com/miximka/MimeParser.svg?branch=master)](https://app.travis-ci.com/miximka/MimeParser)\n## About\n**MimeParser** is a simple MIME (Multipurpose Internet Mail Extensions) parsing library written in Swift (to learn more about mimes refer to [RFC 822](https://tools.ietf.org/html/rfc822), [RFC 2045](https://tools.ietf.org/html/rfc2045), [RFC 2046](https://tools.ietf.org/html/rfc2046))\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate **MimeParser** into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nproject '\u003cYour Project Name\u003e.xcodeproj'\nplatform :osx, '10.12'\n\ntarget 'Test' do\n  use_frameworks!\n  pod 'MimeParser', '~\u003e 0.1'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Usage\n\nImport **MimeParser** before using it:\n\n```swift\nimport MimeParser\n```\n\nCreate parser object:\n\n```swift\nlet parser = MimeParser()\n```\n\nLet this be a simplest mime to be parsed:\n\n```swift\nlet str = \"\"\"\n\tContent-Type: text/plain\n\t\n\tTest\n\t\"\"\"\n```\n\nYou are ready to parse the mime:\n\n```swift\nlet mime = try parser.parse(str)\n```\n\nReturned `mime` object is a root of the mime tree and provides access to its `header` fields and `content`:\n\n```swift\npublic enum MimeContent {\n    case body(MimeBody)\n    case mixed([Mime])\n    case alternative([Mime])\n}\n\npublic struct MimeHeader {\n    public let contentTransferEncoding: ContentTransferEncoding?\n    public let contentType: ContentType?\n    public let contentDisposition: ContentDisposition?\n    public let other: [RFC822HeaderField]\n}\n\nif let contentTypeString = mime.header.contentType?.raw {\n\tprint(\"\\(contentTypeString)\")\n\t// \"text/plain\"\n}\n\nif case .body(let body) = mime.content {\n\tprint(\"\\(body.raw)\")\n\t// \"Test\"\n}\n\n```\n\nDecoded mime's content is simply to retrieve:\n\n```swift\nlet content = try mime.decodedContentData()\n// \"Test\"\n```\n\n## License\n\n**MimeParser** is available under the MIT license. See the LICENSE file for more info.\n\n## Contribution\n\n**MimeParser** is still very simple and incomplete, so pull requests welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiximka%2Fmimeparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiximka%2Fmimeparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiximka%2Fmimeparser/lists"}