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.4.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.4-cp39-abi3-win_amd64.whl
(314.6 kB
view details)
File details
Details for the file biors-0.47.4.tar.gz.
File metadata
- Download URL: biors-0.47.4.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 |
807a245acc0f97de0a2a0bd55bac2aaa62e75b1bfc33094f5350a2aeb23dc1f4
|
|
| MD5 |
25708846d048fd442f76074411374462
|
|
| BLAKE2b-256 |
aa56d8859869319c7ab663b64b756d39221c2560eecf1c3b10eb0103c3442b02
|
File details
Details for the file biors-0.47.4-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: biors-0.47.4-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 314.6 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 |
77fe287db36520a05af0739871817465b2d1f3b524eb63d57d0e5a4bd9810113
|
|
| MD5 |
811a850043455056d0aa51c7174abe6b
|
|
| BLAKE2b-256 |
800138ebe4eca80415dc7e727d633e4baf7fc8be4fe93a75f732ce60d5730d1e
|
File details
Details for the file biors-0.47.4-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: biors-0.47.4-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 481.0 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 |
c5986f400d91fbe807c4275b6c22f487830a5932d601a8862a5bf121ce98b666
|
|
| MD5 |
53a3b3bcdf7a163e1f90a40b85530f6d
|
|
| BLAKE2b-256 |
d55f17e84feab2b8fa72878107946479eb3b23cf9df472ac3d0b7ae491a0cb58
|
File details
Details for the file biors-0.47.4-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: biors-0.47.4-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 420.2 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 |
13b43cf5f613a5542073df1a414564346fbf686a47ca1218b218b47d2572403e
|
|
| MD5 |
729393c57dbab6850ec5910bcef2dc3c
|
|
| BLAKE2b-256 |
239396b89c92b5d966e496b7e0d021ea54b53b1708e3680eb00d1aa42a26ddee
|