Python Ports of Drupal API Client and JSON:API Params Streamline AI Workflows

Cross-language tooling pushes Drupal deeper into AI, automation and headless development workflows
Hero image for a The Drop Times feature about Drupal, Python, and AI integration workflows. A large portrait of Vincenzo Gambino appears beside the headline “Connecting Drupal APIs to the Python AI Ecosystem” and deck text about Python client libraries bringing native JSON:API utilities to external pipelines. Smaller contributor portraits on the right show Brian Perry, Shibin Das, and Francesco Maria Battaglia.

Python has become one of the dominant languages for AI systems, automation workflows and data processing. While working on projects that connected Python applications with Drupal backends, I found that many of the tools available in the JavaScript ecosystem did not have equivalent support in Python, particularly for handling JSON:API queries, authentication and content retrieval.

To simplify that workflow, I converted two existing JavaScript packages from the Drupal ecosystem into Python: Drupal API Client and Drupal JSON:API Params. Both projects were originally created to make it easier to work with Drupal APIs in decoupled applications, and the Python versions follow the same goal of reducing friction when integrating Drupal with external systems.

With modern AI agents, RAG pipelines, automation tools and data-processing workflows increasingly written in Python, it is increasingly important for Drupal to offer reliable bridges into this ecosystem.

Drupal itself is already moving in this direction. The Drupal AI Initiative and the growing ecosystem of AI modules are doing a great deal of work on the Drupal side, helping Drupal become a powerful platform for AI-assisted content, automation and intelligent workflows. But for Drupal to be truly ready for this new generation of applications, it also needs robust integrations with external systems.

This is where client libraries matter.

With modern AI agents, RAG pipelines, automation tools and data-processing workflows increasingly written in Python, it is increasingly important for Drupal to offer reliable bridges into this ecosystem.

–Vincenzo Gambino

The original Drupal API Client JavaScript package was proposed and created by Brian Perry, funded through the Drupal Association's Pitch-burgh initiative, and sponsored by Pantheon and Chapter Three, which was later acquired by Kanopi Studios. Its purpose was to make it easier to connect to Drupal when building headless applications. It provides a practical client layer for common Drupal API use cases, including JSON:API CRUD operations, path resolution through Decoupled Router, OAuth and Basic authentication, and response caching.

The Drupal JSON:API Params JavaScript package was originally created by Shibin Das to simplify constructing JSON:API query parameters. It helps developers build filters, sorting rules, sparse fieldsets, includes, pagination options and nested filter groups without manually assembling complex query strings.

These packages address a common integration problem. Drupal uses JSON:API as a core web service protocol, and many contributed modules extend its capabilities. When building JavaScript or Python applications that connect to Drupal, tools like these make the developer experience much smoother. They reduce boilerplate, make API calls more predictable and help developers focus on building applications rather than fighting with query syntax.

Other headless CMS platforms, such as Sanity and Contentful, provide extensive client APIs, framework integrations and examples for tools such as Nuxt, Next.js, React, Vue and Astro. These libraries are often maintained by the platform teams themselves, which gives developers confidence and makes adoption easier.

Drupal has the technical foundations, but it sometimes lacks these bridges into other ecosystems. When those bridges are missing, developers may assume Drupal is harder to use in modern front-end or AI-driven architectures, even when the underlying APIs are powerful and flexible.

I saw a similar gap a couple of years ago with Astro. At the time, Astro was still relatively new, and Drupal was not listed among the CMS integrations in the Astro documentation. I created the Drupal documentation for Astro, which is now available in the official Astro documentation. I also contributed a related pull request to Astro documentation development discussions on GitHub.

Together with Francesco Maria Battaglia, I also worked on a starter kit based on Drupal's Umami demo, showing how Drupal and Astro can work together in a modern headless architecture.

The Python versions of these two packages follow the same idea. They are not just ports of JavaScript utilities; they are bridges. They make it easier for Python developers, AI engineers and automation workflows to interact with Drupal as a content repository, a structured data source and a central part of an AI-enabled digital platform.

If Drupal wants to remain relevant in the AI era, it is not enough to build excellent AI functionality inside Drupal. We also need to make Drupal easy to connect with the tools, languages and frameworks where AI applications are being built.

If Drupal wants to remain relevant in the AI era, it is not enough to build excellent AI functionality inside Drupal.

–Vincenzo Gambino

Python support for Drupal API Client and Drupal JSON:API Params is one step in that direction.

The growth of AI tooling and automation workflows is increasing the importance of reliable integrations between Drupal and external developer ecosystems. Drupal already has strong foundations through JSON:API and the broader work being done around AI modules and initiatives, but developer adoption also depends on the availability of maintained client libraries and tooling outside the traditional PHP ecosystem.

Community contributions can help establish these integrations, but long-term maintenance and documentation often require broader ecosystem support. Continued involvement from the Drupal Association and other ecosystem sponsors in supporting cross-language tooling could help make Drupal easier to integrate into modern AI, automation and headless development workflows.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related Drupal Initiatives

Related Organizations

Upcoming Events