PHPackages                             citation-generator/doi2jats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. citation-generator/doi2jats

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

citation-generator/doi2jats
===========================

Generate JATS XML citations from DOIs

v1.0.0(9mo ago)1141MITPHPPHP &gt;=8.1CI passing

Since Jul 29Pushed 5mo agoCompare

[ Source](https://github.com/withanage/doi2jats)[ Packagist](https://packagist.org/packages/citation-generator/doi2jats)[ RSS](/packages/citation-generator-doi2jats/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

Citation Generator
==================

[](#citation-generator)

CLI for generating JATS XML citations from DOIs using multiple academic data providers.

[![CI/CD Pipeline](https://github.com/withanage/doi2jats/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/withanage/doi2jats/actions/workflows/main.yml/badge.svg?branch=main)

### Basic Usage (Single DOI)

[](#basic-usage-single-doi)

```
php doi2jats.php
```

Example:

```
php doi2jats.php 10.30430/gjae.2023.0350
```

### Multiple DOIs

[](#multiple-dois)

```
php doi2jats.php    ...
```

Example:

```
php doi2jats.php 10.30430/gjae.2023.0350 10.52825/bis.v1i.42
```

### Advanced Options

[](#advanced-options)

```
# Verbose output with processing details
php doi2jats.php -v 10.30430/gjae.2023.0350 10.52825/bis.v1i.42

# Ref-List format (all citations in ref-list)
php doi2jats.php -f reflist 10.30430/gjae.2023.0350 10.52825/bis.v1i.42

# Back  format with numbering
php doi2jats.php --format back 10.30430/gjae.2023.0350 10.52825/bis.v1i.42

# Verbose + reflist format
php doi2jats.php -v -f reflist 10.30430/gjae.2023.0350 10.52825/bis.v1i.42
```

Installation
------------

[](#installation)

### Using Composer (Recommended)

[](#using-composer-recommended)

```
composer require citation-generator/doi2jats

php vendor/citation-generator/doi2jats/doi2jats.php -h
```

### Using github

[](#using--github)

```
git clone https://github.com/withanage/doi2jats/
cd doi2jats
composer install
```

### Using github without Composer

[](#using--github-without-composer)

```
The application includes a fallback PSR-4 autoloader, so it works without Composer.

```

Usage
-----

[](#usage)

### Command-Line Options

[](#command-line-options)

OptionDescription`-v, --verbose`Show detailed processing information`-f, --format FORMAT`Output format: `individual`, `reflist`, `back``-h, --help`Show help message### Output Formats

[](#output-formats)

#### Individual (Default)

[](#individual-default)

Each citation as separate XML documents:

```

  ...

  ...

```

#### Reflist

[](#reflist)

All citations wrapped in a reference list:

```

      ...

      ...

```

#### Back

[](#back)

Full back format with labels:

```

    References

      1.

        ...

      2.

        ...

```

Error Handling
--------------

[](#error-handling)

The application handles various error scenarios:

- Invalid DOI format: Shows specific error for malformed DOIs
- Network failures: handles API timeouts and connection issues

### Example with Errors

[](#example-with-errors)

```
$ php doi2jats.php -v 10.30430/gjae.2023.0350 invalid-doi 10.52825/bis.v1i.42
Processing 3 DOI(s) in 'individual' format...
Processing DOI 1/3: 10.30430/gjae.2023.0350
Processing DOI 2/3: invalid-doi
  Error: Invalid DOI format: invalid-doi
Processing DOI 3/3: 10.52825/bis.v1i.42

  ...

  ...

=== SUMMARY ===
Total DOIs processed: 3
Successful: 2
Failed: 1

Failed DOIs:
  - invalid-doi: Invalid DOI format: invalid-doi
```

Development
-----------

[](#development)

- PHP Coding and code reading knowledge required. Tool does not contain method documentation.

### Testing

[](#testing)

```
composer test
```

### Adding New Providers

[](#adding-new-providers)

1. Create a new class implementing `CitationProviderInterface`
2. Extend `AbstractCitationProvider` for common functionality
3. Add it to the providers array in `Application`

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- ext-dom
- ext-json

Contribution
------------

[](#contribution)

- Lead and concept : Dulip Withanage (TIB)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance64

Regular maintenance activity

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

287d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4220afa2efac061217cfaa15396e8feb01314242011ae599532aa28f52a0c2d9?d=identicon)[withanage](/maintainers/withanage)

---

Top Contributors

[![withanage](https://avatars.githubusercontent.com/u/1921992?v=4)](https://github.com/withanage "withanage (81 commits)")

---

Tags

academiccrossrefcrossref-apidoijatsjats-xmlojsojs3ompopen-sourceopenalexopenalex-apiopensourceopsphppkp-pluginpublishingsingle-sourcexml

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/citation-generator-doi2jats/health.svg)

```
[![Health](https://phpackages.com/badges/citation-generator-doi2jats/health.svg)](https://phpackages.com/packages/citation-generator-doi2jats)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
