Library / SDK
MAIF/melusine avatar
MAIF/melusine

Melusine: a Python library for email qualification pipelines

📧 Melusine: Use python to automatize your email processing workflow

363 stars59 forksPythonNOASSERTION

At a glance

What is it?
Melusine is an Apache-2.0 Python library from MAIF that turns raw emails into structured, qualified data. It is a good fit when you already know your email-processing rules and want the plumbing handled.
Who is it for?
Adopt Melusine if you have a Python 3.10+ stack and a recurring need to segment, tag and qualify email at volume, and you are willing to write your own qualification logic inside its pipeline abstraction. Do not adopt it if you only need to send mail or read a single mailbox; a plain IMAP client or an email-sending library is a smaller dependency.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 83 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • MAIF/melusine363 ★ · +0
Star history
Repository2026-09-172026-11-23
MAIF/melusine363363

0 Stars in the last 67 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What Melusine does that a mail parser does not

Most email libraries stop at parsing. You get headers, a body, maybe an attachment list, and then you write the same twenty lines of glue in every project: split a thread into messages, strip the quoted reply, guess where the signature starts, run a model, write a flag back to a DataFrame.

Melusine is aimed at that second layer. Its description calls it a "high-level library for emails processing", and the README frames the target as a full email qualification workflow that combines deep learning frameworks (HuggingFace, Pytorch, Tensorflow) with deterministic rules such as regex, keywords and heuristics. The intended user is a data scientist or backend engineer who has a labelled email corpus and wants to move from notebook experiments to a repeatable pipeline without rebuilding the text-handling scaffolding each time.

The project is maintained by MAIF and the README states it is "proven in the MAIF production environment". That is a claim about the maintainer's own deployment, not an independent benchmark, and the register of the repository (Development Status :: 4 - Beta in pyproject.toml) is worth keeping in mind when you read it.

The pipeline abstraction and what flows through it

The central object is MelusinePipeline. You build one from a named configuration with MelusinePipeline.from_config("demo_pipeline") and call transform on a pandas DataFrame. Dependencies listed in pyproject.toml are pandas, scikit-learn, arrow, tqdm and omegaconf, which tells you the shape of the thing: a tabular pipeline configured through OmegaConf, not a message queue and not a service.

Two pre-packaged steps are named in the README. The first segments an email conversation into individual messages, separating them on transition patterns, and then tags each line of each message. The README lists the tags as email body, signatures and footers, and it notes that transferred email handling is included. The second produces qualification output; the README's example result columns are messages, a list of the individual messages in each email, and emergency_result, a flag identifying urgent emails.

The design intent behind the segmentation step is stated plainly: segmenting and tagging earlier "can later be leveraged to enhance the performance of machine learning models". In other words, Melusine is not itself the classifier. It is the layer that decides which characters belong to which message and which region, so that whatever model you attach downstream sees cleaner input.

The configuration format itself is not shown in the README. The tutorials under maif.github.io/melusine/tutorials/00_GettingStarted/ are where the pipeline definitions live, and you should read them before designing your own, because the set of valid step names is defined there and not in the top-level README.

Installing Melusine and running the demo pipeline

Installation is a single pip command against PyPI, as given in the README. Python 3.10 or later is required; pyproject.toml declares requires-python = ">=3.10" and classifies the package for 3.10 through 3.13.

bash
pip install melusine

The README's minimal example loads a bundled dataset, loads a named pipeline and transforms the DataFrame. Every name below is copied from that example.

python
from melusine.data import load_email_data
from melusine.pipeline import MelusinePipeline

# Load an email dataset
df = load_email_data()

# Load a pipeline
pipeline = MelusinePipeline.from_config("demo_pipeline")

# Run the pipeline
df = pipeline.transform(df)

After this runs, the README says the returned dataset contains columns including messages and emergency_result. If your DataFrame does not gain those columns, the pipeline did not execute the steps you expected, and the first thing to check is whether the configuration name resolved at all.

For development against a checkout rather than the released package, the Makefile provides the usual targets: make test runs py.test, make test-all runs tox across Python versions, make lint runs flake8 melusine tests, and make pytest-coverage runs pytest with --cov=melusine --cov-report term-missing. Those four targets are the ones to use if you intend to patch the library rather than only consume it.

Where Melusine is the wrong tool

Melusine does not send email, does not connect to a mailbox, and does not schedule anything. Nothing in the README or pyproject.toml mentions SMTP, IMAP or a background worker. It operates on a DataFrame you already have. If your problem is "fetch new mail every five minutes and reply", this library solves none of it, and you will pull in pandas, scikit-learn and omegaconf for nothing.

The pipeline is also a batch abstraction. transform takes a DataFrame and returns a DataFrame. There is no documented streaming or incremental mode, so a mailbox with continuous arrival needs an external component to batch messages before Melusine sees them. The README does not document how to handle a single message at a time.

There is a subtler cost. The README claims Melusine handles the boilerplate and lets you "focus on the core email qualification logic", but the qualification logic is still yours to write. The demo pipeline ships an emergency_result column, and the tutorials show how pipelines are assembled, yet the README does not describe a library of pre-trained models you can drop in for a new domain. Expect to bring your own labels.

Finally, the packaging metadata is inconsistent. pyproject.toml declares license = {text = "Apache Software License 2.0"} and the README badge says Apache 2.0, while the repository metadata reported for this project says NOASSERTION. That is a metadata artefact rather than a legal position, but if your organisation requires a machine-readable licence identifier in a dependency scan, this will show up as a finding and someone will have to resolve it. This is not legal advice; read the LICENSE file in the repository and take your own counsel's view.

Melusine compared with writing the pipeline yourself

The obvious alternative is not another library. It is a few hundred lines of your own code: an email parser, a regex for quoted replies, a signature heuristic, and a scikit-learn model behind them. That approach is entirely reasonable for one narrow use case, and it has no version churn to track.

The difference in approach is where the effort sits. A hand-rolled script encodes the segmentation rules inline, so every new email client that formats replies differently becomes a patch to your script. Melusine puts segmentation and line tagging behind a pipeline step, which means the rules live in configuration and the same transform call applies them consistently across a corpus. The trade is that you now depend on the library's notion of what a message boundary is, and if your corpus disagrees with it, you are working around the abstraction rather than through it.

A second alternative is a general NLP pipeline framework. Those give you orchestration and model management but no email-specific concepts; you would still write the thread splitting and signature detection yourself. Melusine's value is precisely that it ships those two things. If you do not need them, its remaining surface is a thin wrapper over pandas.

Maintenance, releases and upgrade cost

The repository is not archived. The last push was on 2026-09-01, the same date as the v3.4.0 release, which followed v3.3.4 on 2026-06-24 and v3.3.3 on 2026-02-26. That is a steady cadence of small releases rather than long silences.

The README header for the current line reads "Release 3.3 : Drop sklearn inheritance, update debug mode activation and automate backend selection". Dropping sklearn inheritance is the kind of change that can break subclasses written against earlier versions, because anything that inherited from a Melusine estimator and relied on scikit-learn's inherited methods would need review. If you are upgrading from a 3.2 line, read the release notes for 3.3.x before you bump, and check whether your custom steps subclass anything from the library.

The dependency floor is pandas >= 2.0.0 and scikit-learn >= 1.0.0, with arrow, tqdm and omegaconf. Those are broad ranges, so Melusine will not usually be the constraint that pins your environment, but it also means the library is tested against a moving target. The tox configuration and the make test-all target exist for exactly that reason.

Upgrade cost in normal use should be low, since the public surface shown in the README is three names: load_email_data, MelusinePipeline and transform. Cost concentrates in custom pipeline steps and in any configuration schema you have written, and the README does not document a configuration migration path. The tutorials are the place to check what changed.

Editorial conclusion

Adopt Melusine if you have a Python 3.10+ stack and a recurring need to segment, tag and qualify email at volume, and you are willing to write your own qualification logic inside its pipeline abstraction. Do not adopt it if you only need to send mail or read a single mailbox; a plain IMAP client or an email-sending library is a smaller dependency. Before committing, verify that the default demo pipeline's output columns match what your downstream models expect, and check the LICENSE file in the repository, since the metadata says NOASSERTION while pyproject.toml and the README both state Apache Software License 2.0.

Frequently asked questions

What is Melusine?

Melusine is an Apache-2.0 Python library from MAIF for email processing workflows. It segments email conversations into individual messages, tags message parts such as body, signatures and footers, and runs qualification pipelines over a pandas DataFrame.

How to use Melusine in a Python project?

Install it with pip install melusine, then load a dataset and a named pipeline and call transform, as the README's minimal example does with load_email_data(), MelusinePipeline.from_config("demo_pipeline") and pipeline.transform(df). The result is a DataFrame with columns such as messages and emergency_result.

What Python version does Melusine require?

pyproject.toml declares requires-python = ">=3.10" and classifies the package for Python 3.10 through 3.13. The README badge states python 3.10+.

Does Melusine send or fetch email?

The README and pyproject.toml describe a library that operates on a DataFrame of emails you already have. No SMTP, IMAP or scheduling component is mentioned.

How do you run Melusine's tests from a source checkout?

The Makefile provides make test for py.test, make test-all for tox across Python versions, and make lint for flake8 melusine tests. Coverage is available with make pytest-coverage or make coverage.

Official sources

  1. Issues
  2. MAIF/melusine on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/maif-melusine.svg)](https://hysenlabs.com/projects/maif-melusine)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/maif-melusine.svg)](https://hysenlabs.com/projects/maif-melusine)

Was this useful?