/rustpy-tools

A useful tool Python module implement in rust-lang.

Primary LanguageRustBSD 2-Clause "Simplified" LicenseBSD-2-Clause

rustpy-tools

AppVeyor

A useful tool Python module implement in rust-lang.

Installation

pip install rustpy-tools

Quick Start

import rustpy_tools
from rustpy_tools import RegexUtil, AES

rustpy_tools.version
# 0.2.1

RegexUtil.is_match(r'^\w+@\w+$', 'xxx@gamil.com')
# True

message = 'hello, world'
key = 'yrbv8qlrGJsfo28C'
iv = 'TcwqrwsShZ2FfUSi'
rustpy_tools.AES.encrypt(message, key, iv)
# GSk0f16bYJm+SUbd49PBkw==

rustpy_tools.AES.decrypt('GSk0f16bYJm+SUbd49PBkw==', key, iv)
# 'hello, world'

Build wheel

# install rust nightly and set default
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install nightly
rustup default nightly

# create virtual environment by virtualenv 
virtualenv venv
source venv/activate

# install build tools and build 
pip install maturin
maturin build

Credit

PyO3

License

rustpy-tools is licensed under the BSD 2-Clause license.