Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

django-literature

Latest version: v0.4.1

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
PyPI package Publisher: SSJenny90
0 Stars
0 Forks
6 Versions
724 Downloads
Python Repo language

Scan summary

django-literature was last scanned on 29 Nov 2026 at version 0.4.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 6 versions; the latest was published on 29 Nov 2026.
  • Findings: No rules fired in version 0.4.1.
  • Downloads: 724 downloads.

Versions

6 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.4.1 LATEST 29 Nov 2026 No rules fired
0.4.0 2 Nov 2026 No rules fired
0.3.2 28 Oct 2026 No rules fired
0.3.1 27 Oct 2026 Not shown
0.3.0 27 Oct 2026 Not shown

No rules fired in 0.4.1

Findings

Findings for v0.4.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.4.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

django-literature

Tests Build Docs Publish PyPI Development status Python Django Ruff Licence

A Django app for storing, managing, and converting bibliographic references using the CSL JSON 1.0.2 standard.


Features

  • Normalized data model — five Django models (Item, Name, ItemName, ItemDate, ItemIdentifier) that faithfully represent the CSL JSON 1.0.2 specification.
  • Full CSL JSON coverage — all 45 item types, 26 name roles, 6 date-variable slots, and 6 known identifier types.
  • Bidirectional conversion — import CSL JSON dicts into the database and export model instances back to valid CSL JSON with full round-trip fidelity.
  • Partial date support — year-only, year-month, full year-month-day, and date ranges via django-partial-dates.
  • Identifier validation — model-layer validators for DOI, ISBN, ISSN, URL, PMID, and PMCID formats.
  • Ordered contributors — author, editor, and translator order is preserved independently within each role on an item.
  • i18n ready — all user-facing strings wrapped with gettext_lazy; ships a pre-generated locale/en/LC_MESSAGES/django.po catalog.

Scope & philosophy

What it is. Two Django apps that ship together. The core (literature) stores bibliographic references as a normalized relational representation of CSL JSON 1.0.2 and converts between the two in both directions with round-trip fidelity. It is headless: add literature to INSTALLED_APPS, point a ForeignKey at an Item, and the host project owns its reference catalogue with no front end pulled in. Layered on top is an opt-in UI app (literature.ui, built on django-mvp) that provides a full front end, which is the intended way to use the package in full. Install the core on its own, or add the UI when you want it.

What it deliberately is not.

  • Not a citation renderer in the core. The core stores and converts CSL JSON. Formatting citations and bibliographies is added over time through a downstream CSL processor, never baked into the store.
  • Not a bundled admin. No admin-based management ships with the package. A host that wants one registers its own; the UI app is where reference management lives.
  • Not a set of generic, restylable views. The only views provided are the ones in literature.ui. Anything beyond that, a host builds against the models.
  • Not a host-styled UI. literature.ui follows its own design system (django-mvp), not the host project's. It will not blend into your app's styling, and that is a deliberate trade for a UI that is complete and consistent on its own terms.
  • Not an external-registry client. It does not sync with CrossRef, PubMed, or similar services at runtime.

Tie-break principles, when a design choice is contested:

  1. CSL JSON faithfulness wins. The option closest to the CSL JSON structure and naming is preferred; any deviation is documented and mapped back to its CSL JSON equivalent.
  2. The core stays UI-free. The store carries no front-end dependencies. Anything heavy, django-mvp included, sits behind the opt-in literature.ui, so embedding the core never drags in the UI stack.
  3. Relational integrity over convenience. Known, stable fields (names, dates, identifiers) live in queryable relational structures, never JSON blobs.
  4. Translatable by default. User-facing strings are always wrapped for i18n.

Requirements


Installation

pip install django-literature

Add literature to INSTALLED_APPS:

# settings.py
INSTALLED_APPS = [
    # ...
    "literature",
]

Apply migrations:

python manage.py migrate
Installing the web interface

literature.ui is a second, opt-in app that adds a searchable catalogue, a page for each reference and contributor, pages to add, edit, delete and import references, and a reference picker for your own forms. It is installed with the ui extra and needs Python 3.12 or later and Django 5.2 or later. The apps, settings and URLs it needs, and the demo project that runs it, are set out in Installing the web interface.


Quick Start

Import from CSL JSON
from literature.converters import from_csl_json

item = from_csl_json(
    {
        "id": "Jennings2019",
        "type": "article-journal",
        "title": "A new compositionally based thermal conductivity model",
        "author": [
            {"family": "Jennings", "given": "S"},
            {"family": "Hasterok", "given": "D"},
        ],
        "issued": {"date-parts": [[2019, 8, 16]]},
        "DOI": "10.1093/gji/ggz376",
        "container-title": "Geophysical Journal International",
        "volume": "219",
        "issue": "2",
        "page": "1377-1394",
    }
)

print(item.citation_key)  # "Jennings2019"
print(item.title)  # "A new compositionally based thermal conductivity model"
Export to CSL JSON
from literature.converters import to_csl_json

csl = to_csl_json(item)
# csl is a standards-compliant dict ready for citeproc-js or any CSL processor
Batch import
import json
from literature.converters import from_csl_json_list

with open("references.json") as f:
    items = from_csl_json_list(json.load(f))

print(f"Imported {len(items)} references")
Import a bibliography file

CSL JSON is what this package stores, but researchers keep their libraries in BibTeX and RIS. The import contract reads any configured format through one call and tells you what happened to every entry in the file. Declare which formats your project reads in settings:

BibTeX and RIS are both read out of the box and need no configuration. Declare BIB_FORMATS only to add a format of your own, which replaces the default list rather than extending it — so list the built-ins you still want alongside it:

# settings.py
LITERATURE = {
    "BIB_FORMATS": [
        "literature.importers.bibtex.BibTeXFormat",
        "literature.importers.ris.RISFormat",
        "myapp.formats.EndNoteXMLFormat",
    ],
}

Then import by name:

from literature.importers import get_format

with open("library.bib") as handle:
    result = get_format("bibtex")().import_file(handle)

print(f"{len(result.created)} stored, {len(result.failed)} could not be read")

for entry in result.failed:
    label = entry.handle or f"entry {entry.index}"
    print(f"  {label}: {entry.reason}")

Importing is per entry. One unreadable entry does not stop the rest of the file, and every entry is accounted for in the result whether it was stored or not — you never have to compare counts to find out something went wrong. An entry is stored in full or not at all, so a rejected contributor never leaves an item behind without its authors.

Rehearse it first if you like. Every stage runs, nothing is written:

with open("library.bib") as handle:
    preview = get_format("bibtex")().import_file(handle, dry_run=True)

if not preview.ok:
    print(f"{len(preview.failed)} entries need attention first")

To find out which formats an installation can read:

from literature.importers import available_formats

for name, format_class in available_formats().items():
    print(name, "—", format_class.label)
Reading BibTeX

bibtex reads a .bib file in either dialect — classic BibTeX, which is what a publisher's "export citation" link and most academic databases emit, and BibLaTeX, which is what current Zotero and JabRef write. You do not have to know which one you were given.

An export is rarely clean, so the format recovers before it refuses. A DOI written as a resolver URL is normalized to the bare identifier, LaTeX-encoded text becomes the characters it stands for, XML escaping left over from a publisher's pipeline is resolved, and a value that cannot be recovered is kept with the record instead of costing you the whole entry. @string macros are expanded and crossref inheritance is resolved, including a reference to an entry defined further down the file.

Fields that no bibliographic standard defines — the file, owner and timestamp bookkeeping every reference manager writes into its exports — have no CSL equivalent and are not thrown away either. They are stored on the item under custom["bibtex"] and can be read back:

item = result.created[0].item
# {'file': ':papers/curie1898.pdf:PDF', 'owner': 'sam', ...}
print(item.custom["bibtex"])

What maps to what is generated from the mapping tables themselves, so it cannot fall out of step with the code.

Reading RIS

ris reads a .ris file the way EndNote, Web of Science and Scopus write it, with no producer detection: one format, reading every tag the original specification defines and every tag these producers use beyond it, decided from the tag itself rather than from which tool wrote the file. RIS supplies no cite key of its own — where an entry carries no ID tag, one is minted from its own author, year and title instead, and importing the same file twice mints the same key both times.

Bibliographic exports vary more than any one specification can promise to cover, so this package reads the common producers as best it can. It makes no promise that every variant imports perfectly, and its coverage grows over time through bug reports and feature requests rather than a fixed target: EndNote is the primary support target, with Web of Science and Scopus supported secondarily. A file from a producer this package does not name is still read — tags the specification defines are read, and tags it does not are preserved rather than dropped.

Tags with no CSL equivalent are kept with the record rather than discarded, the same as BibTeX's own bookkeeping fields:

item = result.created[0].item
print(item.custom["ris"])  # {'C7': 'e70142', 'N1': 'Funding: NIH grant R01-GM12345'}

What maps to what is generated from the mapping tables themselves too, the same way as BibTeX's own page.

Adding a further format means writing a BibFormat subclass with a parser and a conversion to CSL JSON, then listing its dotted path in LITERATURE["BIB_FORMATS"] — the workflow above does not change. A format with an unusual need may override any of the workflow's other steps (import_entries, import_entry, get_result); the base class only has to get the job done when its two required stages are supplied, not stop you from replacing the rest.

Query
from literature.models import Item

# All journal articles
articles = Item.objects.filter(type="article-journal")

# Items authored by a specific person
by_jennings = Item.objects.filter(
    item_names__name__family="Jennings",
    item_names__role="author",
)

Data Model Overview

Item ──< ItemName >── Name
  │
  ├──< ItemDate
  │
  └──< ItemIdentifier
Model Purpose CSL JSON equivalent
Item Core bibliographic entry Top-level item object
Name Person or organization Name-variable object
ItemName Associates names with items in a role and order Name-variable array entry
ItemDate Structured date per CSL date-variable slot Date-variable object
ItemIdentifier Typed identifier (DOI, ISBN, etc.) Top-level string fields

See the data model documentation for the full field reference.


Documentation

The documentation is published at fair-dm.github.io/django-literature.

A database still on the old LiteratureItem schema is moved to the current models with python manage.py upgrade_literature. See Upgrading from the LiteratureItem schema.


Development

To work on the package, see Set up a development environment and Run the tests and checks.


Changelog

See CHANGELOG.md.

License

MIT — see LICENSE.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases django-literature

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229