polars-corpus
Corpus linguistics tools for Polars DataFrames.
⚠️ Early Stage: This project is under active development. The API and query language will change as we refine the design. Feedback and contributions are welcome!
Installation
pip install polars-corpus
Usage
import polars as pl
import polars_corpus as plc
# Load your corpus as a DataFrame with token and POS columns
corpus = pl.read_parquet("brown.parquet")
# Search for patterns
results = plc.search(corpus, "small _{SUBST}", pos_column="tag")
# Generate concordances
results.concordance("token", window=5)
# Or use the .corpus namespace
corpus.corpus.search("america").concordance("token", window=2)
Query Syntax
Supports two query languages:
- Simple (BNCweb-style):
small _{SUBST},( small | little ) _N* - CQP: Standard CQP syntax for corpus queries
Features
- Pattern search and concordancing
- Frequency distributions and collocations
- Keywords and statistical measures
- Handles 100M+ word corpora on 16GB memory
Examples
See the examples/ directory for notebooks covering:
- Concordance generation
- Collocation analysis
- Frequency analysis
- Keyword extraction
- Stylometry
Requirements
- Python 3.11+
- Polars 1.35+
License
MIT
Metadata
Release files for polars-corpus 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| polars_corpus-0.2.0.tar.gz | 181.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| polars_corpus-0.2.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| polars_corpus-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| polars_corpus-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| polars_corpus-0.2.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
| polars_corpus-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 32.1 MB
Release files / polars_corpus-0.2.0.tar.gz
| Download URL | polars_corpus-0.2.0.tar.gz |
|---|---|
| Size | 181.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9aeb0c2d18e7016fe4ad2ede11124ce7da7f5883413e819f0b742f514cbbac7
|
|
BLAKE2b-256 checksum How to use checksums |
6e9cd64fb02d77b24d29f8751204c0d7cd5fe4ae1ea6032d4773bf3623147a17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / polars_corpus-0.2.0-cp311-abi3-win_amd64.whl
| Download URL | polars_corpus-0.2.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d330d25465e6ec2c50a8d8ef1675663fb3dc7741b5c0d3316e9a5c895a804d60
|
|
BLAKE2b-256 checksum How to use checksums |
cbdd7fc2a87960e821e27c547f271836519411e9add2e54c8732b82327dbaebe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / polars_corpus-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | polars_corpus-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
aa41aab80e8fa15f74a1b8e73be3380315640515dbb5ca844ec47b10646b3bd2
|
|
BLAKE2b-256 checksum How to use checksums |
ee2ea78774784f0a4c6d3da49668ab2852d565e7aa7c98c21083dd83b3425da4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / polars_corpus-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | polars_corpus-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d92748fd6c673565bb7527941019500d82905703541bd9f525889fc00600f29c
|
|
BLAKE2b-256 checksum How to use checksums |
aa8cb73735da730f3fe1b6ab850a4eb995559b78930b517027a67ec7469faece
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / polars_corpus-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | polars_corpus-0.2.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c7373680d122a9d17c308c2b376621520c9d681b121629d5c5b24c6ebfae8bf2
|
|
BLAKE2b-256 checksum How to use checksums |
4e575d0d396d92d6d2e5402ae376a7c5e7b9eea9e55197c6868ec8acc9b8ae98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / polars_corpus-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | polars_corpus-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
37514d1564cdd71ab2ff8a1625f82396bc8ac016db86aa8454b942e2c4668d98
|
|
BLAKE2b-256 checksum How to use checksums |
46ea7b2bd5511e32a9d550a18e033b8aa77b59aecb7157e4204300847bea0835
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log