Skip to main content

Krovetz Stemmer

Project description

Build Status

Py Krovetz

This is a Python wrapper for Krovetz Stemmer C++ library. It uses Cython to build a wrapper and allow access to the cpp object in python.


import krovetz
ks = krovetz.PyKrovetzStemmer()




All the requirements are handled automatic. However, tests have been made on Linux GNU and OSX using Python 3.5-3.6. Notice that using python 3.5 and macos might not work as some compilation of python 3.5 are linked to older versions of OpenSSL. This affects the communication of pip and PyPI website when retrieving libraries. If you plan to use this combination, make sure that Python is linked to an updated version of OpenSSL.

python -c 'import ssl; print(ssl.OPENSSL_VERSION)'

Version should be 1.*.*

C++ compiler

The original code of the stemmer is written in C++. Thus, a C++ compiler is needed when building yourself. If this is your decision, make sure you have a C++ compiler installed. We have tested gcc in Linux system and clang in MacOS. Regardless of this, other combinations and compilers might also work.



PyPI provides a ready-to-go version (wheel) for different systems and Python versions.

pip install -i krovetz

If you want to force binary version:

pip install -i --only-binary=krovetz krovetz

Currently, we support distributions for Python 3.5 - 3.7 in Linux and Python 3.6 in macOS >= 10.9.

Compiling yourself

If you prefer to compile your own package, you can do it using the following command.

pip3 install -i --no-binary=krovetz krovetz

Using your own Cython

You can use your own Cython to generate the c++ source. Our git repo only includes cython files (.pxd) and not the files generated by Cython. Therefore, if you plan to install from here, you need to have Cython installed in order to generate C++ files.

pip install cython

Then just do:

pip install git+


We are using pipenv to handle the development environment. This tool is very handy to manage different python versions and configurations.


First, import the project in your machine

git clone

Environment setup

You can install the environment needed just using the following command

pipenv install

Have a look on files Pipfile and Pipfile.lock in order to check the versions of the dependencies used in our development machine.


Test can be run using the environment defined by pipenv.

pienv run python test

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

krovetz-1.0.2.tar.gz (137.6 kB view hashes)

Uploaded source

Built Distributions

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page