# Welcome to fasta-reader 👋
> Read and write FASTA file
### 🏠 [Homepage](https://github.com/EBI-Metagenomics/fasta-reader-py)
## ⚡️ Requirements
- Python >= 3.9
## Install
```sh
pip install fasta-reader
```
## Examples
The following example show that it can read a compressed file remotely seamlessly:
```python
from fasta_reader import read_fasta
ROOT = "https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/009/858/895"
REF = "GCF_009858895.2_ASM985889v3"
FILE = f"{ROOT}/{REF}/{REF}_genomic.fna.gz"
for item in read_fasta(FILE):
print(item)
```
We can also write a FASTA file in a compressed format directly:
```python
from fasta_reader import write_fasta
with write_fasta("protein.faa.gz") as file:
file.write_item("P01013 GENE X PROTEIN", "QIKDLLVSSSTDLDT...")
```
## 👤 Author
- [Danilo Horta](https://github.com/horta)
## Show your support
Give a ⭐️ if this project helped you!
Raw data
{
"_id": null,
"home_page": "https://github.com/EBI-Metagenomics/fasta-reader",
"name": "fasta-reader",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Danilo Horta",
"author_email": "fdanilo.horta@pm.me",
"download_url": "https://files.pythonhosted.org/packages/85/76/e14bcee2a9503190695f9b5c9406b8eeb43137f84386de3600d23569d445/fasta_reader-3.1.1.tar.gz",
"platform": null,
"description": "# Welcome to fasta-reader \ud83d\udc4b\n\n> Read and write FASTA file\n\n### \ud83c\udfe0 [Homepage](https://github.com/EBI-Metagenomics/fasta-reader-py)\n\n## \u26a1\ufe0f Requirements\n\n- Python >= 3.9\n\n## Install\n\n```sh\npip install fasta-reader\n```\n\n## Examples\n\nThe following example show that it can read a compressed file remotely seamlessly:\n\n```python\nfrom fasta_reader import read_fasta\n\nROOT = \"https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/009/858/895\"\nREF = \"GCF_009858895.2_ASM985889v3\"\nFILE = f\"{ROOT}/{REF}/{REF}_genomic.fna.gz\"\n\nfor item in read_fasta(FILE):\n print(item)\n```\n\nWe can also write a FASTA file in a compressed format directly:\n\n```python\nfrom fasta_reader import write_fasta\n\nwith write_fasta(\"protein.faa.gz\") as file:\n file.write_item(\"P01013 GENE X PROTEIN\", \"QIKDLLVSSSTDLDT...\")\n```\n\n## \ud83d\udc64 Author\n\n- [Danilo Horta](https://github.com/horta)\n\n## Show your support\n\nGive a \u2b50\ufe0f if this project helped you!\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "FASTA file reader/writer.",
"version": "3.1.1",
"project_urls": {
"Homepage": "https://github.com/EBI-Metagenomics/fasta-reader",
"Repository": "https://github.com/EBI-Metagenomics/fasta-reader"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fa6a377acf779355b682162bed15b8ba3a2c11fd024f3e7f66421d26ab38b935",
"md5": "f64fe3c9cd0754da4c73ce05e9705ec5",
"sha256": "2517b3ee7fd93984bd0e7af1875f7362a41f310ab6298082304605a7f5cadbc9"
},
"downloads": -1,
"filename": "fasta_reader-3.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f64fe3c9cd0754da4c73ce05e9705ec5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 7320,
"upload_time": "2024-11-26T10:37:48",
"upload_time_iso_8601": "2024-11-26T10:37:48.687573Z",
"url": "https://files.pythonhosted.org/packages/fa/6a/377acf779355b682162bed15b8ba3a2c11fd024f3e7f66421d26ab38b935/fasta_reader-3.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8576e14bcee2a9503190695f9b5c9406b8eeb43137f84386de3600d23569d445",
"md5": "6b26af7e4d3b1c3e75e3ad74f194069a",
"sha256": "a5f089818fb66e44ba410a0832f2026c82c51a9bb719371df3cd78fe26c296d6"
},
"downloads": -1,
"filename": "fasta_reader-3.1.1.tar.gz",
"has_sig": false,
"md5_digest": "6b26af7e4d3b1c3e75e3ad74f194069a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 4766,
"upload_time": "2024-11-26T10:37:49",
"upload_time_iso_8601": "2024-11-26T10:37:49.684006Z",
"url": "https://files.pythonhosted.org/packages/85/76/e14bcee2a9503190695f9b5c9406b8eeb43137f84386de3600d23569d445/fasta_reader-3.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-26 10:37:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "EBI-Metagenomics",
"github_project": "fasta-reader",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fasta-reader"
}