PHPackages                             localgovdrupal/localgov\_publications\_importer - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. localgovdrupal/localgov\_publications\_importer

ActiveDrupal-module[File &amp; Storage](/categories/file-storage)

localgovdrupal/localgov\_publications\_importer
===============================================

PDF to HTML publication importer for the LocalGovDrupal distribution.

1.x-dev(4mo ago)62372[15 issues](https://github.com/localgovdrupal/localgov_publications_importer/issues)[1 PRs](https://github.com/localgovdrupal/localgov_publications_importer/pulls)GPL-2.0-or-laterPHPCI failing

Since Jan 28Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/localgovdrupal/localgov_publications_importer)[ Packagist](https://packagist.org/packages/localgovdrupal/localgov_publications_importer)[ Docs](https://github.com/localgovdrupal/localgov_publications_importer)[ RSS](/packages/localgovdrupal-localgov-publications-importer/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (10)Used By (0)

Publications Importer
=====================

[](#publications-importer)

[![Tests](https://github.com/localgovdrupal/localgov_publications_importer/actions/workflows/test.yml/badge.svg)](https://github.com/localgovdrupal/localgov_publications_importer/actions/workflows/test.yml/badge.svg)

Import PDFs into your localGov Drupal site as [HTML publications](https://github.com/localgovdrupal/localgov_publications) automatically.

Please join the #feature-publications-importer channel on LGD Slack to learn more about this. Don't install this in your production site yet.

You can fund the development of this feature via the [LocalGov Drupal Community Fund](https://localgovdrupal.org/products/community-fund/pdf-import-discovery).

How to try this out
-------------------

[](#how-to-try-this-out)

1. Enable the module.
2. Choose "Content" -&gt; "Imports" from the admin menu.
3. Click the "Import Publication" button in the top right.
4. Upload a PDF file to the form and submit it.
5. You'll be redirected back to the import screen on submission, and be able to see your uploaded file as a new import.
6. When cron next runs on the site, you'll see the import change status to "Processing". Once done, the status changes to "Completed" and a link to the resulting publication will show in the "Result" column.

Import pipelines
----------------

[](#import-pipelines)

The configuraton of the import process is known as an "import pipeline" and can be administered by users with the permission to do so. Multiple import pipelines can be created, and users can choose between them when a new import is created. This allows the ability to import content in different ways - for example, using different plugins or different AI prompts.

Using AI to format the imported PDF
-----------------------------------

[](#using-ai-to-format-the-imported-pdf)

If you'd like to use AI to clean up or transform the text, you can. A submodule, localgov\_publications\_importer\_ai, is included. To enable this module you will need to install the [Drupal AI module](https://www.drupal.org/project/ai) and at least one [AI provider module](https://www.drupal.org/project/ai#:~:text=complete%20AI%20applications.-,AI%20Providers,-In%20order%20to). The default AI chat provider will be used if one is configured. The steps below illustrate how to configure ChatGPT to work with this module. Similar steps can be used with other AI providers.

1. Enable the localgov\_publications\_importer\_ai submodule.
2. Download and install the [Open AI provider](https://www.drupal.org/project/ai_provider_openai) module.
3. Get an [API key from OpenAI](https://platform.openai.com/api-keys) (requires an Open AI account).
4. Choose "Configuration" -&gt; "AI" -&gt; "Provider Settings" -&gt; "OpenAI Authentication" from the admin menu.
5. Click the link saying "create a new key".
6. Add your API key here. Key name and description can be whatever makes sense to you. Key type should be "Authentication". Key provider can be "Configuration" if you're just testing locally. Value is the key itself.
7. Save the key and head to "Configuration" -&gt; "AI" -&gt; "Provider Settings" -&gt; "OpenAI Authentication" again.
8. This time you can choose your key from the dropdown. The key will be verified on save, so if you put in a key that's incorrect, you'll be notified here.
9. Once the key is saved, head to "Configuration" -&gt; "AI" -&gt; "AI Default Settings".
10. Scroll down to chat. Ensure OpenAI is selected. Choose the model you'd like to use. GPT-4o seems to work.

Now repeat the steps to upload a PDF from before. You'll notice that the form submission takes longer, and the results are cleaned up compared to what they were previously like.

Bear in mind that if you do choose to use this feature with an external AI, you should only import content that you're willing to share with the provider of that AI.

Plugin structure:
-----------------

[](#plugin-structure)

This module is designed to be customisable. You can either write your own plugins to affect how content is imported, or use Drupal modules that provide plugins.

We work on an instance of ImportInterface, which is passed between plugins. There's a default implementation called Import, but you can use your own if you like.

Operations are what happens to an Import. These can be one of three types:

- Extract: Plugin/LocalGovImporter/Extract
- Transform: Plugin/LocalGovImporter/Transform
- Save: Plugin/LocalGovImporter/Save

Content is extracted from the uploaded file by an Extract plugin, and placed on an Import object. It's then transformed by any number of Transform plugins, and saved by a Save plugin.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance62

Regular maintenance activity

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.2% 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

Every ~68 days

Recently: every ~83 days

Total

6

Last Release

126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6ddb50af6b9c474d285b294c1bc6989627fefda0669b348dbf851110759fbf3?d=identicon)[rupertj](/maintainers/rupertj)

---

Top Contributors

[![rupertj](https://avatars.githubusercontent.com/u/326243?v=4)](https://github.com/rupertj "rupertj (177 commits)")[![rbg-lslater](https://avatars.githubusercontent.com/u/63865891?v=4)](https://github.com/rbg-lslater "rbg-lslater (4 commits)")[![andybroomfield](https://avatars.githubusercontent.com/u/1467480?v=4)](https://github.com/andybroomfield "andybroomfield (3 commits)")

### Embed Badge

![Health badge](/badges/localgovdrupal-localgov-publications-importer/health.svg)

```
[![Health](https://phpackages.com/badges/localgovdrupal-localgov-publications-importer/health.svg)](https://phpackages.com/packages/localgovdrupal-localgov-publications-importer)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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