Skip to main content

rfasta

rfasta is a production-ready toolkit for parsing, cleaning, writing, and sharding protein FASTA files.

It provides:

  • A high-performance Rust library
  • A Python package for scripting and notebooks
  • A CLI for batch and pipeline workflows

Highlights

  • FASTA parsing from files or in-memory readers
  • Configurable cleanup policies for duplicate records and invalid residues
  • Deterministic shard generation for parallel processing
  • Python bindings via PyO3
  • CLI designed for operational workflows
  • Documentation for Rust, Python, and CLI usage

Installation

Python (recommended for end users)

pip install rfasta

Rust (library development)

Add to Cargo.toml:

[dependencies]
rfasta = "0.1"

Quick Start

CLI

Clean a FASTA file:

rfasta clean proteins.fasta \
  --non-unique-header \
  --duplicate-record remove \
  --invalid-sequence convert-remove \
  -o cleaned.fasta

Split a large FASTA file into one-pass round-robin shards:

rfasta split proteins.fasta --output-dir shards --chunks 8

Python

import rfasta

rows = rfasta.read_fasta("proteins.fasta", expect_unique_header=True, verbose=False)
rfasta.write_fasta(rows, "proteins.copy.fasta", line_length=60)

Rust

use std::io::Cursor;

use rfasta::clean::{clean_sequences, CleanOptions, DuplicateAction, InvalidSequenceAction};
use rfasta::parse::{parse_fasta_reader, ParseOptions};
use rfasta::write::{write_fasta_writer, WriteOptions};

let input = b">seq1\nacdx\n>seq2\nTTTT\n";
let records = parse_fasta_reader(Cursor::new(input), ParseOptions::default())?;
let cleaned = clean_sequences(
    records,
    &CleanOptions {
        invalid_sequence_action: InvalidSequenceAction::ConvertRemove,
        duplicate_record_action: DuplicateAction::Fail,
        ..CleanOptions::default()
    },
)?;
let mut output = Vec::new();
write_fasta_writer(&mut output, &cleaned, &WriteOptions::default())?;
# Ok::<(), rfasta::RfastaError>(())

Documentation and Guides

Build the guide site locally:

pip install -r docs/requirements.txt
mkdocs build --strict

Local Performance Check

For a repo-local benchmark driver that does not require extra benchmark crates, run:

cargo run --release --example benchmark_driver

Metadata

Release files for rfasta 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rfasta 0.1.0
File Size Uploaded Provenance
rfasta-0.1.0.tar.gz 5.2 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for rfasta 0.1.0
File
rfasta-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
rfasta-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.7 abi3 Linux glibc 2.17+ ARM64 Details
rfasta-0.1.0-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details
rfasta-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl CPython 3.7 abi3 macOS 10.12+ x86-64 Details

Total release size: 7.5 MB

Release files / rfasta-0.1.0.tar.gz

Download URL rfasta-0.1.0.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
bcb656851c4ee62d0204cbbe65692cb729384db83d5b34384857ee81a579b35c
BLAKE2b-256 checksum
How to use checksums
847325bdfbaa75ba4327469f5b22e4426182c8d752937cf996184b1a6b2ca4ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release files / rfasta-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rfasta-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 586.0 kB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0fcc67de552d14b7f7b1174ce12e7c2407773731b5bffcb0894c3adb8703c431
BLAKE2b-256 checksum
How to use checksums
23620e979c872c852fc08e145104bd00ebc049bd688576045dc32944308f198b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release files / rfasta-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL rfasta-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 571.0 kB
Tags CPython 3.7 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ebf84b7ded7f7d119d3cd8d658da2143ed0d8c155576d4eb2cec8ff65bb0274a
BLAKE2b-256 checksum
How to use checksums
de38194de21069c9a47e7fb9beda82e7c514ec2136259d5a3724253f427d86bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release files / rfasta-0.1.0-cp37-abi3-macosx_11_0_arm64.whl

Download URL rfasta-0.1.0-cp37-abi3-macosx_11_0_arm64.whl
Size 522.1 kB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c79d3447c6f9319a427f2a46dd6824b2fcb04effb2126e9ccdef65255e5d6c37
BLAKE2b-256 checksum
How to use checksums
fe236ad54198b467697cb98a4ab4b616c73f687935a2ce699b8e7beeaeff4430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release files / rfasta-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl

Download URL rfasta-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl
Size 542.2 kB
Tags CPython 3.7 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
949138ca6e8807d8c5415323fbd50b93a799ea09bf01a48efce0cf3358d52fe0
BLAKE2b-256 checksum
How to use checksums
f518f1af0e2f1bfcd3d1c350c379ee13098947e53af654657f0a65c47881487a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Security for rfasta 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for rfasta-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page