A Python library that reproduces and extends text analysis tools from the Lexos web app. Designed for entry-level students and researchers in the Humanities, with language-agnostic support for historical and under-resourced languages.
Project description
The Lexos Python Library
The Lexos Python library reproduces and extends most of the text analysis tools in the Lexos web app. Lexos is designed to implement many common text analysis procedures in a way that saves the user having to re-invent the wheel or figure out how to combine multiple Python packages to achieve a given result. It is intended to be used as a library in other projects to build backend functions for applications, but it can be used in standalone scripts or in Jupyter notebooks. As with the original web app, it is designed to accessible to entry-level users whilst offering power functionality for students and researchers, particularly in the Humanities. It is also designed to be as language-agnostic as possible so that it can be used for a wide variety of historical and under-resourced languages.
📖 Documentation
A full discussion of the use of the API can be found on the website Documentation website.
⭐️ Major Features
- Loads texts from a variety of sources into a common data structure.
- Manages a corpus of texts and generates stastics about the corpus.
- Performs text pre-processing ("scrubbing") and splitting ("cutting").
- Performs tokenization and trains language models using spaCy.
- Creates assorted visualizations of term vectors.
- Performs hierarchical and kmeans clustering.
- Generates topic models and topic model visualizations using MALLET and DFR Browser 2.
And more!
⏳ Installation
pip install lexos
To update to the latest version, use
pip install -U lexos
Or, if you are using uv:
uv add lexos
Lexos uses spaCy language models to obtain language-specific information about texts. By default, it comes with spaCy's multi-language model xx_sent_ud_sm and its small English-language en_core_web_sm.
If you are working in another language or need a larger language model, you can download instructions for additional models from the spaCy models page. Use the following command:
python -m spacy download en_core_web_md # Replace with the name of your model
🚦Project Status
The Lexos API is currently in beta. Most of the core functionality of the Lexos web app, along with new features, has been implemented and documented. As of January 2026, the API is considered feature complete and stable for general use, but some rough edges remain. Feedback is welcome.
I will continue to fix bugs and improve the documentation as issues arise, but no major new features are planned at this time. The beta release coincides with at a time when the landscape of digital tools is rapidly evolving and AI-assisted coding is becoming more prevalent. I am waiting to see whether there is significant adoption of the Lexos library before investing more time in developing new features. If you like Lexos, you can help by requesting new features in the GitHub issues (labelled as "enhancement") or contributing them yourself.
💝 Contribute
- If are looking for help using Lexos, please post you question on the GitHub Discussions board.
- Bug reports and feature requests: Please use GitHub issues.
- For other types of contributions see the Documentation website.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📝 Citation Information
Kleinman, S., (2026). Lexos. v0.1.0b3 https://github.com/scottkleinman/lexos. doi:10.5281/zenodo.1403869.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lexos-0.1.0b31.tar.gz.
File metadata
- Download URL: lexos-0.1.0b31.tar.gz
- Upload date:
- Size: 20.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
268bb6fcc759d9d192b465818d01b9f4768ad028919a110f1743e157da60a32b
|
|
| MD5 |
a94274f312e33bae8871adef262cee36
|
|
| BLAKE2b-256 |
969f1c778bdb984c5696f8aecd29a2b0af5da691d7e2f239e1acb16496676c68
|
File details
Details for the file lexos-0.1.0b31-py3-none-any.whl.
File metadata
- Download URL: lexos-0.1.0b31-py3-none-any.whl
- Upload date:
- Size: 399.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e801eac24f61c3494212af5c65f681d54e0fcc4f3d7ef5eb8b46d64b86d4c792
|
|
| MD5 |
7d9227cedd4c2d14525ce88bf3edeff5
|
|
| BLAKE2b-256 |
a06ea31e7ea6e420977a0b330b46aa49e3d9eac1a1ffd250d738a00769984173
|