hanke0 / python-ctools

A collection of useful data structures and functions written in C for Python.

Home Page:https://python-ctools.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ctools build status on Travis CI license version implementation python version wheel

CTools is a collection of useful data structures and functions written in C for Python.

Install:

Install and update using pip: pip install -U ctools.

If you can't build, and the error contains message of error: 'for' loop initial declarations are only allowed in C99 mode, please use the following command:

export CFLAGS="--std=c99"
pip install -U ctools

It provides:

  • Jump consistent hash. Find description here .
  • fnv1a, fnv1, djb2, and murmur string hash method.
  • A LFU (least frequently used) cache mapping class.
  • A TTL cache mapping class that all key expire after specific seconds.
  • A channel class support sending and receiving objects.
  • A SortedMap class based on red-black tree .

How To Test:

Simple, type make test and take a sip of coffee. Also can use make benchmark to run the benchmark test.

More:

What's important is free.

About

A collection of useful data structures and functions written in C for Python.

https://python-ctools.readthedocs.io

License:Apache License 2.0


Languages

Language:C 58.2%Language:Python 36.4%Language:Shell 2.9%Language:Makefile 0.9%Language:Dockerfile 0.8%Language:C++ 0.5%Language:CMake 0.3%