https://github.com/bhftbootcamp/gmime.jl
Julia wrapper for GMime to parse email messages
https://github.com/bhftbootcamp/gmime.jl
email gmime imap mime mime-parser
Last synced: about 2 months ago
JSON representation
Julia wrapper for GMime to parse email messages
- Host: GitHub
- URL: https://github.com/bhftbootcamp/gmime.jl
- Owner: bhftbootcamp
- License: mit
- Created: 2024-10-07T17:41:03.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-11-19T05:17:11.000Z (11 months ago)
- Last Synced: 2025-02-25T21:11:23.092Z (7 months ago)
- Topics: email, gmime, imap, mime, mime-parser
- Language: Julia
- Homepage:
- Size: 4.88 MB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# GMime.jl
[](https://bhftbootcamp.github.io/GMime.jl/stable/)
[](https://bhftbootcamp.github.io/GMime.jl/dev/)
[](https://github.com/bhftbootcamp/GMime.jl/actions/workflows/CI.yml?query=branch%3Amaster)
[](https://codecov.io/gh/bhftbootcamp/GMime.jl)
[](https://github.com/JuliaRegistries/General)GMime is a convenient wrapper around the [GMime](https://github.com/jstedfast/gmime) library for parsing email messages in Julia. It can extract sender, recipient, date, body text, attachments and other email information.
## Installation
To install GMime, simply use the Julia package manager:
```julia
] add GMime
```## Usage
Here's a small example of how to parse content from an email body:
```julia
using GMime
using EasyCurl# Fetch the email data from an IMAP server
response = imap_request(
"imaps://imap.gmail.com:993",
get(ENV, "IMAP_USER", ""),
get(ENV, "IMAP_PASSWORD", ""),
mailbox = "INBOX",
path = "MAILINDEX=993"
)# Extract the raw email body
data = imap_body(response)# Parse the email using GMime
julia> email = parse_email(data)
π§ Email:
π€ From: Broker Support
π₯ To: Portfolio Manager
π Date: 2024-08-06T17:34:04
π Attachments:
1. π Attachment:
π Name: CashFlowReport_Q3_2024.pdf
π οΈ Encoding: base64
π· Mime type: application/pdf
π Size: 18000 bytes2. π Attachment:
π Name: ClosedPositions_Summary_2024-08-06.csv
π οΈ Encoding: base64
π· Mime type: text/csv
π Size: 250000 bytes3. π Attachment:
π Name: DailyTransaction_2024-08-06.csv
π οΈ Encoding: base64
π· Mime type: text/csv
π Size: 12800 bytes
```## Useful Links
- [gmime](https://github.com/jstedfast/gmime) β Official library repository.
- [gmime_jll.jl](https://github.com/JuliaBinaryWrappers/gmime_jll.jl) β Julia wrapper for gmime.
- Enable IMAP support in your email providerβs settings. See this [Gmail guide](https://support.getmailbird.com/hc/en-us/articles/220106527-Enabling-IMAP-for-Gmail).
- Generate an app-specific password for your email account. See details [here](https://support.google.com/accounts/answer/185833?hl=en).## Contributing
Contributions to GMime are welcome! If you encounter a bug, have a feature request, or would like to contribute code, please open an issue or a pull request on GitHub.