Skip to main content

No project description provided

Project description

Whispool

Fast in memory word frequency count, with Rust

Installation

pip install whispool

Basic usage

We assume we have n sentences, with each sentence broken into words. And each sentence is

# each sentence could have diffrent length of words
sentence = [
            ['This', 'is', 'a', 'sentence'],
            ['This', 'is', 'another', 'sentence'],
            ['This', 'is', 'a', 'third', 'sentence', 'here'],
            ...
        ]

# each info list has to be IN THE SAME LENGTH
info = list([
            ['id1', 'category1', 'sci-fi', 'movie','Jan.'],
            ['id2', 'category1', 'romance', 'movie','Jan.'],
            ['id3', 'category2', 'sci-fi', 'tv','Feb.'],
            ...
        ])

Put in data

Now we put in data

from whispool import Whispool
from pathlib import Path

whisper_multi = Whispool(
        directory=Path("test_data"), threads=2, capacity=200)

whisper_multi.consume(sentence, info)
whisper_multi.consume(sentence_batch2, info_batch2)
...
whisper_multi.consume(sentence_batchN, info_batchN)

Fetch the result data

Now we want to see the hot key words of Sci-Fi movies in January.

df = whisper_multi.final_stats(
        [None, None, 'sci-fi', 'movie', 'Jan.'],
        top_n=2)

Build from rust

maturin build --release

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

whispool-0.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

whispool-0.1.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

whispool-0.1.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (759.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

whispool-0.1.2-cp310-cp310-macosx_10_7_x86_64.whl (389.6 kB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

whispool-0.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

whispool-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (759.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

whispool-0.1.2-cp39-cp39-macosx_10_7_x86_64.whl (389.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

whispool-0.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

whispool-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (761.0 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

whispool-0.1.2-cp38-cp38-macosx_10_7_x86_64.whl (390.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

whispool-0.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

whispool-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (761.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

whispool-0.1.2-cp37-cp37m-macosx_10_7_x86_64.whl (390.5 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

whispool-0.1.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

whispool-0.1.2-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (754.9 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

whispool-0.1.2-cp36-cp36m-macosx_10_7_x86_64.whl (386.9 kB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

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