0.1.2 • Published 4 years ago

cull-email-pore v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

pore for cull

An email data analysis library.

Installation

npm install cull-email-pore

Usage

Generate analytical collections from email envelopes (see cull-email-imap).

Origin

Analyze sender data to identify distinct senders, addresses and domains. Also, generate a collection of nodes (computing the number of emails for each distinct value) and links connecting the three for use with a data visualization library like d3-sankey.

import { Origin } from 'cull-email-pore';

// envelopes retrieved from a `cull-email-imap` Client
let envelopes = [];

let analysis = new Origin(envelopes);

// optionally apply filters
analysis.filter([datum => datum.from.domain === 'cull.email']);

let senders = [...analysis.senders]; // distinct senders
let addresses = [...analysis.addresses]; // distinct addresses
let domains = [...analysis.domains]; // distinct domains
let sankey = analysis.sankey(); // generate nodes and links

Also, see tests.

Chronology

Analyze chronological data to bucket data by date, hour, day of week and a nested computation by day of week and then by hour.

import { Chronology } from 'cull-email-pore';

// envelopes retrieved from a `cull-email-imap` Client
let envelopes = [];

let analysis = new Chronology(envelopes);

// optionally apply filters
analysis.filter([datum => datum.from.domain === 'cull.email']);

let byDate = [...analysis.byDate];
let byHour = [...analysis.byHour];
let byWeekday = [...analysis.byWeekday];
let byHourByWeekday = [...analysis.byHourByWeekday];

Also, see tests.

Development

makefile codifies directives for building, testing, linting and other development oriented tasks.