Skip to main content
What is Caterpillar?
====================

.. image:: https://img.shields.io/travis/Kapiche/caterpillar.svg?style=flat-square
:target: https://travis-ci.org/Kapiche/caterpillar
.. image:: https://img.shields.io/coveralls/Kapiche/caterpillar.svg?style=flat-square
:target: https://coveralls.io/r/Kapiche/caterpillar

Caterpillar is a pure Python text indexing and analytics library. It is aimed at supporting advanced text and other semi-structured analytics applications that bridge Natural Language Processing (NLP), Information Retrieval and Topic Modelling.

Some features include:

* pluggable key/value object store for storage (currently only implementation is SQLite)
* transaction layer for reading/writing (along with associated locking semantics)
* supports searching indexes with some built in scoring algorithm implementations (including TF/IDF)
* stores additional data structures for analytics above and beyond traditional information retrieval data structures
* has a plugin architecture for quickly accessing the data structures and performing custom analytics
* has 100% test coverage


Quick Example
=============
Quick example of using caterpillar below::

import os
import tempfile

from caterpillar.processing.index import IndexWriter, IndexConfig
from caterpillar.processing.schema import TEXT, Schema, NUMERIC
from caterpillar.storage.sqlite import SqliteStorage

index_dir = os.path.join(tempfile.mkdtemp(), "examples")
with open('caterpillar/test_resources/moby.txt', 'r') as f:
data = f.read()
with IndexWriter(index_dir, IndexConfig(SqliteStorage, Schema(text=TEXT, some_number=NUMERIC))) as writer:
writer.add_document(text=data, some_number=1)

Installation
============
.. code::

pip install caterpillar

Documentation
=============
The documentation can be found `here <http://caterpillar.readthedocs.org/en/latest/>`_.

Roadmap
=======
Caterpillar is currently in a volatile state, and the next releases are likely to undergo substantial changes in the API.

In particular we plan to:

* Revamp schema and field design, in order to:
- better merge the core text indexing with extraction of structured information. For example, integrating and indexing documents by both their textual context and entities identified by a named entity extraction approach
- integrate the serialisation of schemas within the transactional lifetimes of IndexWriter objects
* Improve locking to allow better support for concurrency when indexing large collections
* Support more languages, in particular to allow multilingual indexes with appropriate markup and representation of different languages
* Remove the NLTK dependency (great library, but only used for tokenisation)
* Better API for completely customising what and how data is extracted from documents


Python Version
==============
Caterpillar now targets Python 3 only. It is intended to support the two most recent releases of Python for new features. Currently this means we aim to support Python 3.5 and 3.6 only.

BDFLs
=====
* `Kris Rogers <https://github.com/krisrogers/>`_
* `Ryan Stuart <https://github.com/rstuart85/>`_
* `Sam Hames <https://github.com/SamHames/>`_

Contributors
============
Anyone who is willing! In other words none yet, but we are more then accepting of contributions.

Contributing
============
No code will be merged unless it has 100% test coverage and passes the flake8 linting. We code with a line length of 120 characters (see tox.ini [pep8] section) and we use `py.test <http://pytest.org/>`_ for testing. Tests are in a *test*sub-folder in each package. Tox is configured to run the test suite, reporting unit test passes, coverage and linting
automatically.

.. code::

# Run the whole test suite:
tox

# Run just the linting checks by specifying a specific test environment:
tox -e flake8

# Pass some arguments to py.test through the tox runner (in this case run only a specific set of tests)
tox -e py35 -- -k test_index

Copyright and License
=====================
Caterpillar is copyright © 2013 - 2015 Kapiche Limited. It is licensed under the GNU Affero General Public License.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The copyright holders grant you an additional permission under Section 7 of the GNU Affero General Public License, version 3, exempting you from the requirement in Section 6 of the GNU General Public License, version 3, to accompany Corresponding Source with Installation Information for the Program or any work based on the Program. You are still required to comply with all other Section 6 requirements to provide Corresponding Source.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.


Release files for caterpillar 0.15.10

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

Source distribution (sdist)

Source distribution for caterpillar 0.15.10
File Size Uploaded
caterpillar-0.15.10.tar.gz 2.6 MB Details

Built distribution (wheel)

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

Total release size: 2.7 MB

Release files / caterpillar-0.15.10.tar.gz

Download URL caterpillar-0.15.10.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
0498f0f989d0edbea5914d621658b3cceda67849846c294c4631b07bbd8e000a
BLAKE2b-256 checksum
How to use checksums
34a56b2d56050736a959f7a7fd32775feacbe0a645db04bcc2d547a8f7983e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3

Release files / caterpillar-0.15.10-py3-none-any.whl

Download URL caterpillar-0.15.10-py3-none-any.whl
Size 71.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bb647a52ddde69792a2bd6cc4f12627999d95f08f1b58274ac614e763d2aa41
BLAKE2b-256 checksum
How to use checksums
89cd7c98953bcec6a1a179c75abd7ae55c520df85920bc52066a9d5c943dafaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3
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