Python bindings for decancer.

Overview

decancer_py

Python bindings for decancer.

Installation

You can get started with decancer_py by installing from PyPI:

pip install -U decancer-py

Usage

decancer_py can be used to turn sketchy text strings into their more basic counterparts.

Two functions are exported from decancer_py:

  • parse - Parse a jank string to a normal string.
  • contains - Check if some string contains some other string.

The contains API is altered a bit from the decancer crate.

The result from parse will always be in ALL LOWERCASE.

By default contains will attempt to parse the string and then see if the string is contained. Pass parse=False to skip the parsing step.

To be clear, using "s" in "string" is going to be more performant than calling contains due to the overhead of the FFI. The main use case is if you want to check if some regular string is in some jank string.

from decancer_py import parse


parsed = parse("𝔂EE𝓣")
assert parsed == "yeet"
from decancer_py import contains


assert contains("yeet", "ye")
assert contains("𝔂EE𝓣", "ye")
assert not contains("𝔂EE𝓣", "ye", parse=False)

License

decancer_py is licensed under the MIT License.

You might also like...
Rust implementation of Python command line progress bar tool tqdm.
Rust implementation of Python command line progress bar tool tqdm.

tqdm Rust implementation of Python command line progress bar tool tqdm. From original documentation: tqdm derives from the Arabic word taqaddum (تقدّم

Python/Rust implementations and notes from Proofs Arguments and Zero Knowledge study group

What is this? This is where I'll be collecting resources related to the Study Group on Dr. Justin Thaler's Proofs Arguments And Zero Knowledge Book. T

🐎 A fast implementation of the Aho-Corasick algorithm using the compact double-array data structure. (Python wrapper for daachorse)

python-daachorse daachorse is a fast implementation of the Aho-Corasick algorithm using the compact double-array data structure. This is a Python wrap

A Command-line tool to create, manage and deploy your python projects

PPM A Command-line tool to create, manage and deploy your python projects Table of Contents PPM Main Features Create a Project project.ini file Projec

Fuzzy Index for Python, written in Rust. Works like error-tolerant dict, keyed by a human input.

FuzzDex FuzzDex is a fast Python library, written in Rust. It implements an in-memory fuzzy index that works like an error-tolerant dictionary keyed b

PyOxidizer is a utility for producing binaries that embed Python

PyOxidizer is a utility for producing binaries that embed Python. The over-arching goal of PyOxidizer is to make complex packaging and distribution problems simple so application maintainers can focus on building applications instead of toiling with build systems and packaging tools.

A fast python geohash library created by wrapping rust.

Pygeohash-Fast A Fast geohasher for python. Created by wrapping the rust geohash crate with pyo3. Huge shout out to the georust community :) Currently

Python PEP-440 Version Parsing

PyVer (WIP) Python PEP-440 Version Parsing This package allows for parsing Python PEP-440 version numbers and comparisons between PEP-440 Versions Usa

Python PEP-440 Version Parsing

PyVer Python PEP-440 Version Parser This package allows for parsing Python PEP-440 version numbers and for comparisons between PEP-440 version numbers

Comments
  • *: rewrite the package, and make it use decancer v1.5.2

    *: rewrite the package, and make it use decancer v1.5.2

    THANK YOU ❤️❤️❤️ for supporting decancer, even labeling it as a "Sweet lib that does all the work for us"!!! ❤️❤️❤️

    i've listed your package as the unofficial Python package for decancer in the main project's README since version 1.5.1. THANK YOU for supporting this project!

    this pull request intends to:

    • rewrite most of the package to use the currently latest decancer release (this WILL be a major breaking update, note that!)
    • add rustfmt.toml for styling purposes
    • remove rust tests, since those are already covered in the main project, so a cargo test is not required

    if you have any issues with this pull request, feel free to let me know!

    opened by null8626 3
Releases(v0.2.1)
  • v0.2.1(Dec 27, 2022)

    This release just updates the README examples, but wanted to get it onto PyPI.

    Full Changelog: https://github.com/Jonxslays/decancer_py/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Dec 27, 2022)

    This release bumps the decancer crate to v1.5.2 and exposes the new API.

    Breaking Changes

    • Top level contains function was removed.

    Additions

    • CuredString class which is now returned from the parse function and can be used for comparisons.

    CuredString has the following methods made available:

    • starts_with
    • ends_with
    • contains
    • __eq__
    • __ne__
    • __contains__
    • __bool__
    • __str__
    • __repr__

    New Contributors

    • @null8626 made their first contribution in https://github.com/Jonxslays/decancer_py/pull/2

    Full Changelog: https://github.com/Jonxslays/decancer_py/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jul 28, 2022)

Owner
Jonxslays
Curious Python developer. Trying to re-write it in Rust. We can do this without a loop right?
Jonxslays
Songbird bindings for python

Songbird-Py Songbird bindings for python. The goal is to provide an easy to use alternitive to Lavalink. Its written with rust-bindings to Songbird. S

null 0 Jul 23, 2022
⚡️ Python bindings for a rust implementation of aapleby's MurMurHash.

?? murmurh ?? ⚡️ Python bindings for a rust implementation of aapleby's MurMurHash. ?? Contributing Contributions are welcome! Please feel free to ope

Paul Leydier 6 Jan 14, 2023
PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining.

?? ⛓️ ?? Pyskani PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining. ??️ Overview

Martin Larralde 13 Mar 21, 2023
pyrevm Blazing-fast Python bindings to revm

pyrevm Blazing-fast Python bindings to revm Quickstart make install make test Example Usage Here we show how you can fork from Ethereum mainnet and s

Georgios Konstantopoulos 97 Apr 14, 2023
Pollard's p - 1, in rust, with python bindings

Pollard's p - 1 algorithm for factorization Written in rust, using pyo3 to provide python bindings and primesieve for fast prime enumeration. libprime

Robin Jadoul 4 Sep 26, 2023
RocksDB-based queue with python bindings

RocksQ An inproc RocksDB-based queue with Python bindings. It is implemented in Rust. Features: max capacity limit in number of elements; size calcula

In-Sight 4 Oct 17, 2023
My solutions for the Advent of Code 2021 in Scala, Python, Haskell and Rust.

Advent of Code 2021 These are my Advent of Code 2021 solutions written in Scala 3, Haskell, Python and Rust. Day Title L1 L2 L3 L4 01 Sonar Sweep Scal

Axel Suárez 2 Oct 14, 2022
Fast DNA manipulation for Python, written in Rust.

quickdna Quickdna is a simple, fast library for working with DNA sequences. It is up to 100x faster than Biopython for some translation tasks, in part

Secure DNA 22 Dec 31, 2022
A toy example showing how to run Rust code in Python for speed and progress.

PoC: Integrating Rust in Python A toy example showing how to run Rust code in Python for speed and progress. Requirements Python 3.6+ Rust 1.44+ Cargo

Emil Thorenfeldt 2 Feb 7, 2022
This is a simple command line application to convert bibtex to json written in Rust and Python

bibtex-to-json This is a simple command line application to convert bibtex to json written in Rust and Python. Why? To enable you to convert very big

null 3 Mar 23, 2022