Metadata-Version: 2.4
Name: fasta-summary-songwei
Version: 0.1.0
Summary: A small command-line tool that summarizes FASTA files (sequence count and mean length).
Author-email: songwei <songwei@example.com>
License: MIT
Project-URL: Homepage, https://github.com/songwei/fasta-summary
Project-URL: Repository, https://github.com/songwei/fasta-summary
Project-URL: Issues, https://github.com/songwei/fasta-summary/issues
Keywords: fasta,bioinformatics,cli,summary
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Fasta_summary

A small, dependency-free Python command-line tool that summarizes a FASTA file:
it counts the number of sequences and prints their mean length.

## Installation

From PyPI (once published):

```bash
pip install fasta-summary-songwei
```

From source:

```bash
git clone https://github.com/songwei/fasta-summary.git
cd fasta-summary
python -m pip install -e .
```

Requires Python 3.9 or newer.

## Usage

Run the command against a FASTA file:

```bash
fasta-summary example.fasta
```

Typical output (TSV, two lines):

```
sequences	3
mean_length	8.33
```

You can also invoke it as a module:

```bash
python -m fasta_summary example.fasta
```

Help:

```bash
fasta-summary --help
```

```
usage: fasta-summary [-h] input

Summarize a FASTA file: count sequences and compute mean length.

positional arguments:
  input       Path to the input FASTA file

options:
  -h, --help  show this help message and exit
```

## Input / Output

- **Input:** a FASTA file. Headers start with `>`. Sequences may span multiple
  lines. Blank lines are ignored.
- **Output:** two TSV lines written to stdout:
  - `sequences<TAB><count>`
  - `mean_length<TAB><mean>` (mean is formatted with 2 decimal places)

### Special cases

- **Empty file** (or file containing only blank lines): prints
  `sequences\t0` and `mean_length\t0.00` and exits with code 0.
- **Missing file:** prints a friendly error to stderr and exits with code 1.
- **Sequence data before any header:** prints a clear error to stderr and
  exits with code 2.

## Known Limitations

- Reads the whole file into memory; not optimized for very large FASTA files.
- Length is counted in raw characters; letters are not validated against any
  biological alphabet (IUPAC, etc.).
- Header metadata (anything after the first whitespace) is ignored.
- Only standard `>`-prefixed FASTA headers are recognized; alternate formats
  such as FASTQ or multi-record line-wrapping conventions are not supported.
- Input is read as UTF-8 text; binary FASTA files are not supported.
