fastpy_rs
FastPy-RS: High-performance Python extensions written in Rust
This crate provides optimized Python extensions for various tasks including:
- AI/ML utilities
- Data processing tools
- Cryptographic functions
- Text processing utilities
- JSON parsing
- HTTP client functionality
Examples
import fastpy_rs as fr
# Using crypto functions
hash_result = fr.crypto.sha256_str("hello")
# Using data tools
encoded = fr.datatools.base64_encode(b"hello")
# Count word frequencies in a text
text = "Hello hello world! This is a test. Test passed!"
frequencies = fr.ai.token_frequency(text)
print(frequencies)
# Output: {'hello': 2, 'world': 1, 'this': 1, 'is': 1, 'a': 1, 'test': 2, 'passed': 1}
# JSON parsing
json_data = '{"name": "John", "age": 30, "active": true}'
parsed_json = fr.json.parse_json(json_data)
print(parsed_json)
# Output: {'name': 'John', 'age': 30, 'active': True}
# Serialization JSON
# Serialize a simple dictionary
data = {"name": "John", "age": 30, "active": True}
json_str = fr.json.serialize_json(data)
print(json_str) # Output: {"name":"John","age":30,"active":true}