| name | pma2apa |
| description | Use when converting `PubmedArticle` XML from EDirect into APA-style citation text or APA-structured XML for downstream parsing. |
| disable-model-invocation | true |
| user-invocable | true |
pma2apa
Quick Start
- Command:
efetch -db pubmed -id <PMID> -format xml | pma2apa
- Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/pma2apa
- Primary modes: default one-line citation text,
-xml for structured XML, -ascii for accent-normalized output
When To Use This Tool
- Turn PubMed XML records into APA-style citation strings inside shell pipelines.
- Keep an intermediate XML representation of parsed citation fields when downstream
xtract steps need structure.
- Normalize accented characters to ASCII before exporting to plain-text systems.
- Stay inside EDirect tooling after
efetch -format xml instead of post-processing citations elsewhere.
Common Patterns
efetch -db pubmed -id 19212835 -format xml | pma2apa
efetch -db pubmed -id 19212835 -format xml | pma2apa -xml
efetch -db pubmed -id 19212835 -format xml | pma2apa -ascii
Recommended Workflow
- Fetch
PubmedArticle XML with efetch -db pubmed -format xml.
- Decide whether you need flat citation text or the structured XML intermediate.
- Add
-ascii only when the downstream consumer cannot handle accented characters.
- Check the emitted title, journal, pages, and DOI fields before storing or reusing the citation.
Guardrails
- The tool reads
PubmedArticle XML from stdin; it does not fetch PubMed records by itself.
- There is no built-in
--help or --version; unknown arguments fail with Unrecognized argument ....
- Accepted mode switches are the bare or dashed forms
xml/-xml, apa/-apa, and ascii/-ascii.
- Default text mode emits a single tab-delimited line that starts with the PMID and then the formatted citation.
-xml keeps the <APASet><APAFormat>...</APAFormat></APASet> intermediate instead of flattening to text.
- The wrapper depends on EDirect helpers such as
transmute and xtract being available on PATH.