Plagx Cite for Python
A free academic writing tool by Plagiarism Checker X.
Plagx Cite for Python is a free, open-source citation generator and reference checker for Python, Jupyter and the command line. It turns sources into correct APA 7 and MLA 9 references and in-text citations, so researchers and students can build a clean reference list in seconds. It also checks BibTeX files for duplicate references, broken DOIs and missing details before you submit.
Use it as an APA citation generator or MLA citation generator: create a reference list, bibliography or works cited page, generate in-text citations, turn a DOI into a citation, import and export BibTeX, and find duplicate references.
- No dependencies, Python 3.9+
- Works in scripts, Jupyter notebooks, Django and Flask apps, and from the command line
- Uses CSL-JSON, the reference format used by Zotero, Mendeley and Crossref
- Plain text, HTML or Markdown output
- Same output as the JavaScript version, plagx-cite on npm
Developer downloads: PyPI · npm · Maven Central · NuGet · GitHub
Need a quick citation online? Use the free citation generator.
Plagx Cite is a free academic writing utility by Plagiarism Checker X. It is a citation generator that builds and checks APA and MLA reference lists. Plagiarism checking and AI-generated text detection are available in Plagiarism Checker X, linked at the end of this page.
Install
pip install plagx-cite
Command line
plagx-cite format references.bib --style apa
plagx-cite check references.bib --check-dois
plagx-cite doi 10.1038/nature14539 --style mla
plagx-cite bibtex references.json > references.bib
| Command | What it does |
|---|---|
format <file> |
Prints the formatted reference list (--style apa|mla, --format text|html|markdown) |
check <file> |
Reports duplicates, invalid DOIs and missing fields (--check-dois, --strict, --json) |
doi <doi> [...] |
Looks up DOIs and prints formatted references |
bibtex <file> |
Converts a CSL-JSON or BibTeX file to BibTeX |
<file> is a .bib or CSL-JSON .json file, or - for stdin. Exit codes: 0 OK, 1 problems found, 2 usage or input error. python -m plagx_cite … works too.
Quick start
from plagx_cite import format_reference, cite_in_text
ref = {
"type": "article-journal",
"title": "Deep learning for text similarity",
"author": [{"family": "Smith", "given": "John Allen"}, {"family": "Lee", "given": "Kate"}],
"issued": {"date-parts": [[2020]]},
"container-title": "Journal of Academic Writing",
"volume": "12",
"issue": "3",
"page": "45-67",
"DOI": "10.1234/jaw.2020.045",
}
format_reference(ref)
# Smith, J. A., & Lee, K. (2020). Deep learning for text similarity. Journal of Academic Writing, 12(3), 45–67. https://doi.org/10.1234/jaw.2020.045
format_reference(ref, style="mla")
# Smith, John Allen, and Kate Lee. “Deep learning for text similarity.” Journal of Academic Writing, vol. 12, no. 3, 2020, pp. 45-67, https://doi.org/10.1234/jaw.2020.045.
cite_in_text(ref, page="50") # (Smith & Lee, 2020, p. 50)
cite_in_text(ref, narrative=True) # Smith and Lee (2020)
cite_in_text(ref, style="mla", page="50") # (Smith and Lee 50)
References are plain dicts in CSL-JSON form, so a Zotero or Crossref export works with json.load().
API
Formatting references and citations
| Function | Returns |
|---|---|
format_reference(ref, style="apa", format="text") |
One reference-list entry |
format_bibliography(refs, style="apa", format="text") |
Sorted list of entries |
cite_in_text(ref, style="apa", page=None, narrative=False) |
In-text citation |
sort_references(refs) |
New list sorted by author, year, title |
styles |
["apa", "mla"] |
style:"apa"(default) or"mla"format:"text"(default),"html"(titles in<i>, text escaped) or"markdown"(titles in*…*)
Supported reference types: article-journal, article-magazine, article-newspaper, book, chapter, paper-conference, report, thesis, webpage. Other types fall back to a sensible general layout.
BibTeX import and export
from plagx_cite import parse_bibtex, to_bibtex
refs = parse_bibtex(open("library.bib", encoding="utf-8").read())
print(to_bibtex(refs))
parse_bibtex handles @string macros, # concatenation, common LaTeX accents ({\"u} → ü), organisation names in braces, and BibLaTeX date / journaltitle fields.
DOI lookup
from plagx_cite import lookup_doi, normalize_doi, extract_dois
ref = lookup_doi("10.1038/nature14539", mailto="you@example.com")
normalize_doi("https://doi.org/10.1038/NATURE14539") # '10.1038/NATURE14539'
extract_dois(text) # every DOI found in the text
lookup_doi calls the free public Crossref API. If a DOI isn't registered with Crossref, such as arXiv or Zenodo DOIs from DataCite, it falls back to doi.org content negotiation. No API key is needed. It raises ValueError for an invalid DOI and LookupError when the DOI can't be found. To use your own HTTP client (for example requests or httpx), pass http=lambda url, headers: (status, body).
Duplicate references
from plagx_cite import find_duplicates
find_duplicates(refs)
# [{'indexes': [0, 4], 'reasons': ['doi']}, {'indexes': [2, 7], 'reasons': ['title']}]
References count as duplicates when they share a DOI, or the same title and first author. Case, accents and punctuation are ignored.
Checking a reference list
from plagx_cite import check_references
result = check_references(refs, check_dois=True)
# {'references': 4, 'errors': 2, 'warnings': 1, 'issues': [{'level': 'error', 'code': 'duplicate', 'ref': 'smith2020b', ...}]}
Errors are duplicates, invalid DOIs and DOIs that can't be found (with check_dois=True). Warnings are missing titles, authors or years.
Good to know
- Titles are used exactly as you give them. APA wants sentence case for article and book titles, and MLA wants title case. Plagx Cite does not change capitalisation automatically, because doing so would break names and acronyms.
- The output follows the main APA 7 and MLA 9 rules for common reference types. Always check the final list against your institution's or publisher's guidelines.
Development
python -m venv .venv
.venv/bin/pip install -e . pytest # on Windows: .venv\Scripts\pip
.venv/bin/pytest
Plagx Cite - Free Citation & Reference Toolkit
An open-source citation utility for students, researchers and developers. Format references, organize citations and manage bibliographies.
Developed by Plagiarism Checker X.
Plagx Cite helps with source attribution; it does not detect plagiarism or AI-generated text. For full document checks, explore Plagiarism Checker X and its AI Content Detector.
License
MIT © Plagiarism Checker X
Metadata
Release files for plagx-cite 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plagx_cite-0.2.2.tar.gz | 27.8 kB | With provenance | Details for plagx_cite-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plagx_cite-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for plagx_cite-0.2.2-py3-none-any.whl |
Total release size: 53.0 kB
Release files / plagx_cite-0.2.2.tar.gz
| Download URL | plagx_cite-0.2.2.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b418539806561001da71aa56acaf41edf708404fca8b92c9893e0f90dd281c02
|
|
BLAKE2b-256 checksum How to use checksums |
ba1079131b9e487a47b22a1f3a95b32b2f97a971a2bd68c7566235fd11963d2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logRelease files / plagx_cite-0.2.2-py3-none-any.whl
| Download URL | plagx_cite-0.2.2-py3-none-any.whl |
|---|---|
| Size | 25.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52808b5973dd7edc9d83ffc33740ab6b00b7cbe065c80c6835dcdb2c58c78c39
|
|
BLAKE2b-256 checksum How to use checksums |
dc5ecf6fb0791f509d6c961fb3cd4a987805f7d3f7e6b7b43277b94dbcd6aa84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logSecurity for plagx-cite 0.2.2
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 2 files in this release have been uploaded with provenance metadata.
Attestation for plagx_cite-0.2.2.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 Oct 27, 2026.
Transparency logA 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.