Skip to main content

functionwordsets

Comprehensive multilingual function-word datasets with a simple Python API

DOI


Overview

functionwordsets ships ready-to-use function-word lists for many languages and time-periods.
Each dataset is a tiny Python module located in functionwordsets/datasets/ and is loaded on demand through a minimal API.

Supported out of the box :

ID Language / period Entries*
fr_21c French – 21st century 688
en_21c English – 21st century 390
sp_21c Spanish – 21st century 481
it_21c Italian – 21st century 495
nl_21c Dutch – 21st century 287
gr_5cbc Ancient Greek – 5th-4th c. BCE 264
oc_13c Old Occitan – 12th-13th c. 360
la_1cbc Classical Latin – 1st c. BCE 353

*Number of distinct word-forms in the union of all categories.

You can also add or fork your own datasets: just drop a <id>.py file following the template shown below.


💡 Supported grammatical categories

(summary unchanged – see below for details)


Installation

pip install functionwordsets         # from PyPI
# or, from a cloned repo
pip install -e .

Python ≥ 3.8 – zero runtime dependencies – wheel < 20 kB zipped.


Quick start

import functionwordsets as fw

# List available datasets
print(fw.available_ids())            # ['fr_21c', 'en_21c', …]

# Load one set (defaults to fr_21c)
fr = fw.load()                       # same as fw.load('fr_21c')
print(fr.name, len(fr.all))          # French – 21st century 688

# Membership test
if 'ne' in fr.all:
    ...

# Build a custom stop-set: only articles + prepositions
stops = fr.subset(['articles', 'prepositions'])

Command-line helpers

# List dataset IDs
fw-list

# Export every French function word to a text file
fw-export fr_21c -o fr.txt

# Export only conjunctions & negations from Spanish as JSON
fw-export sp_21c --include coord_conj subord_conj negations -o sp_stop.json

Dataset layout

Internally each dataset is defined as a small Python dictionary:

data = {
    "name": "English – 21st century",
    "language": "en",
    "period": "21c",
    "categories": {
        "articles": [...],
        "prepositions": [...],
        # …
    }
}

functionwordsets treats the object as read-only, so feel free to edit or extend it in your fork.


Notes on auxiliary categories

Keys for auxiliary verbs follow the pattern aux_<lemma> (e.g. aux_être, aux_be, aux_ser). They vary by language; see each dataset file for the exact key.


Enjoy !

Metadata

Release files for functionwordsets 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for functionwordsets 1.2.1
File Size Uploaded Provenance Actions
functionwordsets-1.2.1.tar.gz 33.5 kB With provenance Details for functionwordsets-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for functionwordsets 1.2.1
File Interpreter ABI Platform Actions
functionwordsets-1.2.1-py3-none-any.whl Python 3 none any Details for functionwordsets-1.2.1-py3-none-any.whl

Total release size: 69.3 kB

Release files / functionwordsets-1.2.1.tar.gz

Download URL functionwordsets-1.2.1.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
91c435dd60a2163f3434e69159b4be97f4ee95d488fafd7c9ae652e6df565986
BLAKE2b-256 checksum
How to use checksums
dacadb0bb3dccb3cbd57d6e605121f5d1118fe8adaf3e07a2f352b204cb5563c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 14, 2025.

Transparency log

Release files / functionwordsets-1.2.1-py3-none-any.whl

Download URL functionwordsets-1.2.1-py3-none-any.whl
Size 35.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fba1e1fec8458ac997ca28650f08d0257606629de38898a5973d21f5f984237
BLAKE2b-256 checksum
How to use checksums
afd2212650853c3bd6369e5b5aa65b62a3114ba671a4f05b7a4932f445931953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 14, 2025.

Transparency log

Security for functionwordsets 1.2.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for functionwordsets-1.2.1.tar.gz

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 Jul 14, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page