
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Python bindings for the Rust `fst` crate, providing sets and maps backed by finite state transducers.
| |appveyor| | |travis|
| Python bindings for burntsushi's <http://burntsushi.net>
__ fst crate <https://github.com/BurntSushi/fst>
__
(rustdocs <http://burntsushi.net/rustdoc/fst/>
__)
| for FST-backed sets and maps.
| For reasons why you might want to consider using it, see BurntSushi's
great
| article on "Index[ing] 1,600,000,000 Keys with Automata and Rust" <http://blog.burntsushi.net/transducers/>
__.
tl;dr:
You will need:
rustup <https://www.rustup.rs/>
__)Clone the repository. Installation with pip install git+...
does
not work
currently
Run rustup override add nightly
to add an override for rustup to
use the
nightly channel for the repository
Run python setup.py bdist_wheel
to generate a wheel
Install the wheel with
pip install dist/rust_fst-0.1-py3-none-any.whl
The package exposes almost all functionality of the fst
crate,
except for:
search
and search_re
with
set operations.. code:: python
from rust_fst import Map, Set
# Building a set in memory
keys = ["fa", "fo", "fob", "focus", "foo", "food", "foul"]
s = Set.from_iter(keys)
# Fuzzy searches on the set
matches = list(s.search(term="foo", max_dist=1))
assert matches == ["fo", "fob", "foo", "food"]
# Searching with a regular expression
matches = list(s.search_re(r'f\w{2}'))
assert matches == ["fob", "foo"]
# Store map on disk, requiring only constant memory for querying
items = [("bruce", 1), ("clarence", 2), ("stevie", 3)]
m = Map.from_iter(items, path="/tmp/map.fst")
# Find all items whose key is greater or equal (in lexicographical sense) to
# 'clarence'
matches = dict(m['clarence':])
assert matches == {'clarence': 2, 'stevie': 3}
Head over to readthedocs.org <https://rust-fst.readthedocs.org/>
__ for
the API documentation.
| If you want to know more about performance characteristics, memory
usage
| and about the implementation details, please head over to the
| documentation for the Rust crate <https://github.com/BurntSushi/fst>
__
.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/jbaiter/python-rust-fst :target: https://ci.appveyor.com/project/jbaiter/python-rust-fst .. |travis| image:: https://travis-ci.org/jbaiter/python-rust-fst.svg :target: https://travis-ci.org/jbaiter/python-rust-fst
FAQs
Python bindings for the Rust `fst` crate, providing sets and maps backed by finite state transducers.
We found that rust-fst demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.