Python bindings for bio-rs core
Project description
biors-python
Python bindings for bio-rs via PyO3.
Installation
pip install biors
Requires Python 3.9+.
Quickstart
import biors
fasta_text = (
">seq1\nACDEFGHIKLMNPQRSTVWY\n"
">seq2\nMKWVTFISLLFLFSSAYSRGVFRRDAHKSEVAHRFKDLGEENFKALVLIAFAQYLQQCP\n"
)
# Parse FASTA text
records = biors.parse_fasta_records(fasta_text)
# Validate
report = biors.validate_fasta_input(fasta_text)
print(f"Valid records: {report.valid_records}/{report.records}")
# Tokenize
tokenized = biors.tokenize_fasta_records(fasta_text)
for t in tokenized:
print(t.id, t.tokens)
# Build model input
model_input = biors.build_model_inputs_checked(
tokenized,
max_length=512,
pad_token_id=0,
padding="fixed_length",
)
for r in model_input.records:
print(r.id, r.input_ids, r.attention_mask)
# End-to-end workflow
output = biors.prepare_workflow(
input_hash="sha256:abc123",
records=records,
max_length=512,
pad_token_id=0,
padding="fixed_length",
)
print(f"Model ready: {output.model_ready}")
Development
Build locally with maturin:
cd packages/rust/biors-python
maturin develop
pytest
License
MIT OR Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
biors-0.47.3.tar.gz
(92.1 kB
view details)
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
biors-0.47.3-cp39-abi3-win_amd64.whl
(314.4 kB
view details)
File details
Details for the file biors-0.47.3.tar.gz.
File metadata
- Download URL: biors-0.47.3.tar.gz
- Upload date:
- Size: 92.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eed24c3350c10972f0b9ee12a1d3afea0e53baa7d90a955f12a51f2e5b958682
|
|
| MD5 |
516c15f2a2b35046b4951dfe9242c323
|
|
| BLAKE2b-256 |
02f665690fc84b28c0137410db340a4e6ad39d182e817f7a63b17230a228905a
|
File details
Details for the file biors-0.47.3-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: biors-0.47.3-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 314.4 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82ec314cc6bb537b98919735ef6080864c69e91be370800cf524214bfe3476ac
|
|
| MD5 |
b8fe099bcf3d3e043650d31246868063
|
|
| BLAKE2b-256 |
4e0dfe7c2d7e8519530553d83165ff9270915ecf9f37b63ae1399ce4b14e4185
|
File details
Details for the file biors-0.47.3-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: biors-0.47.3-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 481.1 kB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43b579a105155da4e99cbe7aa7c19beb351a2b77e0d880a3a92e39fea629f31c
|
|
| MD5 |
a2a89df08a8fe1b7ca9e06d9bfa15349
|
|
| BLAKE2b-256 |
5c40c3678f04142fc3a8dd3fa7975fbed99573ca3cf1a10a8df50ca4673e76fa
|
File details
Details for the file biors-0.47.3-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: biors-0.47.3-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 420.0 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83c74c33d76e5d63bf0a18dc45f87884435f9f26b48fedd70b9ed277a3d1aea5
|
|
| MD5 |
63ad99b494810c692a199ead7e2d4a5f
|
|
| BLAKE2b-256 |
fe6a6750766e66f7f57572f2793df79a3702a8a2763bff36f6f9be73c0b42c9a
|