Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

polars-corpus

Latest version: v0.2.1

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
PyPI package Publisher: rmalouf
0 Stars
0 Forks
1 Versions
84 Downloads
Python Repo language

Scan summary

polars-corpus was last scanned on 29 Nov 2026 at version 0.2.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 29 Nov 2026.
  • Findings: No rules fired in version 0.2.1.
  • Downloads: 84 downloads.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.1 LATEST 29 Nov 2026 No rules fired

No rules fired in 0.2.1

Findings

Findings for v0.2.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

polars-corpus

Corpus linguistics functions for Polars: search, concordances, frequency lists, collocations, keywords, dispersion, and lexical diversity. The query matcher is written in Rust; the rest is Python over Polars expressions.

A corpus is a DataFrame (or LazyFrame) with one row per token. The default column names are token, pos, lemma and file_id; every function that reads one of these takes a *_column or expr argument to point it elsewhere. A LazyFrame is searched a chunk of files at a time, so the corpus does not have to fit in memory.

The package is at version 0.2.0 and the API may still change.

Documentation: https://rmalouf.github.io/polars_corpus/

Installation

pip install polars-corpus

The plotting functions need matplotlib, which is in the examples extra:

pip install "polars-corpus[examples]"

Requires Python 3.11 or later and Polars 1.36 or later, including 2.0.

Usage

import nltk
import polars as pl
import polars_corpus as plc

nltk.download("brown")
corpus = plc.from_nltk(nltk.corpus.brown)  # token, pos, sentence_tag, file_id, category

# Simple (BNCweb-style) query: "small" followed by a noun
results = plc.search(corpus, "small _{SUBST}")
results.concordance("token", window=5)

# CQP query
plc.search_cqp(corpus, '[pos="JJ"] [token="(?i)house"]').concordance(window=2)

word = pl.col("token").str.to_lowercase()

plc.frequency_list(corpus, word)
plc.collocations(plc.search(corpus, "house"), word, "logdice")
plc.keywords(
    corpus.filter(pl.col("category") == "news"),
    corpus.filter(pl.col("category") != "news"),
    word,
    "ll",
)
plc.dispersion(corpus, word, ["range", "dp"])

The same functions are available through a .corpus namespace on DataFrames, LazyFrames and expressions:

corpus.corpus.search("america").concordance("token", window=2)

Contents

  • Search: search (Simple query language) and search_cqp (CQP), with variable bindings in both. Results give KWIC concordances, hit distributions across a metadata column, and an interactive concordance viewer for Jupyter.
  • Frequency: frequency_list, ngrams, crosstab.
  • Association measures: PMI, MI3, log-Dice, t-score, z-score, log-likelihood, chi-squared, minimum sensitivity, simple maths, BIC, log ratio, %DIFF, odds ratio, Welch's t-test. Used by collocations and keywords.
  • Dispersion: range, SD, CV, Juilland's D, Gries's DP, Burch's DA.
  • Lexical diversity: TTR, MSTTR, MTLD, Yule's K, vocabulary growth, frequency spectrum.
  • Input: plain text and WLP files (gzip or zstd compressed), NLTK corpus readers, and the BNC XML edition.
  • Plots: barcode_plot, dispersion_plot, keyword_plot.

Not yet implemented: proximity operators (<<3>>, <<s>>) in the Simple query language.

Query languages

  • Simple: small _{SUBST}, ( small | little ) _N*. See docs/simple_query.md.
  • CQP: [pos="JJ"] [lemma="house"]. See docs/cqp_query.md.

Examples

Worked notebooks are in docs/notebooks/ and rendered on the documentation site: frequencies, concordances, collocations, keywords, dispersion, and vocabulary.

Development

Building from source needs a Rust toolchain and maturin:

make develop   # build the extension into the active environment
pytest

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases polars-corpus

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Frame 2085668439 (1)
Group 1261154229