pyo3/examples/word-count/README.md

27 lines
467 B
Markdown
Raw Normal View History

2017-07-23 05:32:18 +00:00
# word-count
2018-07-30 20:52:22 +00:00
Demonstrates searching for a file in plain python, with rust singlethreaded and with rust multithreaded.
2017-07-23 05:32:18 +00:00
## Build
2018-07-30 20:52:22 +00:00
```shell
2017-07-23 05:32:18 +00:00
python setup.py install
```
## Usage
```python
2018-07-30 20:52:22 +00:00
from word_count import search_py, WordCounter
2017-07-23 05:32:18 +00:00
2018-07-30 20:52:22 +00:00
search_py("path/to/file", "word")
WordCounter("path/to/file").search("word")
WordCounter("path/to/file").search_sequential("word")
2017-07-23 05:32:18 +00:00
```
2018-07-30 20:52:22 +00:00
## Benchmark
There is a benchmark in `tests/test_word_count.py`:
```shell
pytest -v tests
```