Download the PHP package localgovdrupal/localgov_publications_importer without Composer

On this page you can find all versions of the php package localgovdrupal/localgov_publications_importer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package localgov_publications_importer

Publications Importer

Tests

Import PDFs into your localGov Drupal site as HTML 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.

How to try this out

1) Enable the module. 2) Choose "Content" -> "Import Publication" from the admin menu. 3) Upload a PDF file to the form and submit it. 4) After a few seconds, you'll get redirected to a new HTML Publication created from the supplied PDF.

Using AI to format the imported PDF

If you'd like to use AI to clean up 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 and at least one AI provider module. The default AI chat provider will be used if one is configured. In the steps below will illustrate how to configure one using ChatGPT. Similar steps can be used with other AI LLM providers:

1) Enable the localgov_publications_importer_ai submodule. 2) Download and install the Open AI provider module. 3) Get an API key from OpenAI (requires an Open AI account). 4) Choose "Configuration" -> "AI" -> "Provider Settings" -> "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" -> "AI" -> "Provider Settings" -> "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" -> "AI" -> "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.

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:

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.


All versions of localgov_publications_importer with dependencies

PHP Build Version
Package Version
Requires smalot/pdfparser Version ^2.7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package localgovdrupal/localgov_publications_importer contains the following files

Loading the files please wait ....