Liking cljdoc? Tell your friends :D

scicloj.zulipdata.narrative

Helpers for narrative-style analyses across the corpus: enriching timelines with date columns, summarising channel lifecycles, selecting channels by name or by shared user-base, and tracing newcomers' prior channels.

Operates on the anonymized timeline returned by scicloj.zulipdata.anonymize/anonymized-timeline.

Helpers for narrative-style analyses across the corpus: enriching
timelines with date columns, summarising channel lifecycles,
selecting channels by name or by shared user-base, and tracing
newcomers' prior channels.

Operates on the anonymized timeline returned by
`scicloj.zulipdata.anonymize/anonymized-timeline`.
raw docstring

channel-lifecycleclj

(channel-lifecycle timeline)

One row per channel: first-date, last-date, total messages, active months, distinct users. Sorted ascending by first-date by default.

One row per channel: first-date, last-date, total messages, active
months, distinct users. Sorted ascending by first-date by default.
sourceraw docstring

channel-monthly-activityclj

(channel-monthly-activity timeline)
(channel-monthly-activity timeline channels)

Long-form: one row per (channel, month-date) with :msgs count. Restricted to channels if supplied, else all channels.

Long-form: one row per (channel, month-date) with `:msgs` count.
Restricted to `channels` if supplied, else all channels.
sourceraw docstring

channels-by-name-patternclj

(channels-by-name-pattern timeline regex)

Channels whose name matches regex.

Channels whose name matches `regex`.
sourceraw docstring

channels-by-shared-usersclj

(channels-by-shared-users timeline
                          seed-channel
                          &
                          {:keys [share min-msgs top-n]
                           :or {share 0.4 min-msgs 30 top-n 30}})

Channels where the top-N posters of seed-channel account for at least share of messages, restricted to channels with at least min-msgs total. Returns a sorted vector of channel names.

Use to build a curated cluster around a seed channel by user-overlap rather than name patterns.

Channels where the top-N posters of `seed-channel` account for at
least `share` of messages, restricted to channels with at least
`min-msgs` total. Returns a sorted vector of channel names.

Use to build a curated cluster around a seed channel by user-overlap
rather than name patterns.
sourceraw docstring

first-posters-of-channelclj

(first-posters-of-channel timeline channel n)

First n distinct user-keys to post in channel, with their first-post date. Useful for identifying a channel's earliest contributors.

First `n` distinct user-keys to post in `channel`, with their
first-post date. Useful for identifying a channel's earliest
contributors.
sourceraw docstring

prior-channels-of-newcomersclj

(prior-channels-of-newcomers timeline channel year-month)

For users whose first-ever post in channel falls in the given year-month ("YYYY-MM"), tally the channels they had posted in before that first post. Returns one row per (prior-channel) with counts of how many newcomers passed through it.

For users whose first-ever post in `channel` falls in the given
`year-month` ("YYYY-MM"), tally the channels they had posted in
before that first post. Returns one row per (prior-channel) with
counts of how many newcomers passed through it.
sourceraw docstring

ts->month-dateclj

(ts->month-date ts)

Epoch-second -> first-of-month LocalDate (UTC).

Epoch-second -> first-of-month LocalDate (UTC).
sourceraw docstring

ts->yearclj

(ts->year ts)

Epoch-second -> integer year (UTC).

Epoch-second -> integer year (UTC).
sourceraw docstring

ts->year-monthclj

(ts->year-month ts)

Epoch-second -> "YYYY-MM" string (UTC).

Epoch-second -> "YYYY-MM" string (UTC).
sourceraw docstring

with-time-columnsclj

(with-time-columns timeline)

Add :month-date, :year-month, and :year columns to a timeline that has a :timestamp column (epoch seconds).

Add `:month-date`, `:year-month`, and `:year` columns to a timeline
that has a `:timestamp` column (epoch seconds).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close