Hi, I'm wondering if there is a way to develop Drupal modules in Python. Thanks.

Comments

killes@www.drop.org’s picture

Sure, if you find a way to call python from PHP.

--
Drupal services
My Drupal services

Hosting Geek’s picture

Just need to give PHP a few patches...

Uwe Hermann’s picture

No obvious way at least. Why would you do that?

Uwe.
--
hermann-uwe.de | crazy-hacks.org | unmaintained-free-software.org

kbahey’s picture

The running joke around here, which normally comes up April 1st, is that Drupal will be rewritten in Java!

This is of course a joke, since Drupal is written in PHP, and moving it to any other language is a massive undertaking.

Also remember that PHP is the most widely used language on web hosts: everyone supports it. Python, Java and Ruby on Rails may have advantages, but it is hard to find a host for 9.99$ or less that supports them, which limits the available pool.

It looks like you are either a Python programmer, or you have an application written in Python that you want to integrate with Drupal.

Perhaps you should look at a CMS that is already written in Python, such as Zope/Plone for example.

--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

Nainto’s picture

Yeah, I guess guess you could say I'm a Python programmer. Back to the drawing board . . .

vinoth.3v’s picture

Nice.. But I am Developing one New CMS in Python. now it is very initial stage.

see http://nettri.org

வினோத்
Tamil2Friends.com
Nettri.org

Vinoth - வினோத்

softprodigy23’s picture

Although usage of Python and Drupal differs in building websites, together they complement each other in certain conditions. Here is how they are related to each other.

1. Python:
Python is a versatile language used for general-purpose programming and data analysis using several libraries and tools, machine learning, automation, and many more.
Python is considered to be very simple and readable, and that is why it has become so popular with the developers to develop all forms of applications.
Django and Flask are frameworks used in the web development platform to develop web applications based on Python.
2. Drupal:
The open source, flexible, and highly scalable CMS with PHP is Drupal.
It mainly offers services in creating complex websites and is even employed in massive amounts of organizations, governmental portals as well as educational institutions.
Modules which are a vibrant set within Drupal allow the users to develop complex sites with less custom code written.
How Python and Drupal Can Work Together:
Drupal is based on PHP, but you can still use Python with Drupal for most things you might:
Data Processing and Machine Learning:

What's really cool about Python is that, depending on the context, it can be used both in big data processing and in the machine learning aspect. You can do heavy analytics as well as data within your Python script or applications then pass those outputs up to a Drupal site via APIs.
For instance, perhaps you are utilizing Python on some data analysis or natural language processing job and passing its output up to the Drupal site through its RESTful API or GraphQL.
Custom Scripts or Automation:
You could use Python coding to automate administrative work on your Drupal site: migration of content, database maintenance, or even batch update.

These Python scripts, developed by softProdigy, can be scheduled either via a command-line interface or as a scheduled task, while the Drupal CMS manages the front-end and content management, ensuring everything runs smoothly

API Integrations:

By using the Python, one can have a conversation between a Drupal site and a backend service through an API. You may implement your custom feature or microservice with Python, then expose it to your Drupal site by means of API calls.
This is really going to be very useful if you want to leverage the power of the Python's libraries, like AI or data processing but still controlling your content via Drupal.
Microservices Architecture:
It's going to be a kind of microservices architecture where Drupal will be used at the front-end as the content management system, and serves various services using Python services like Flask or Django for the back-end .
Hence, you could keep the CMS and the business logic separated so that the scalability and flexibility would increase.
Conclusion:
Drupal is a PHP-based CMS that one uses to handle the management of content as well as the development of complex websites. Python would bring in tasks relating to data analysis and machine learning and automate other tasks whenever needed.
This is usually done by APIs and, for the most part, would first leave Python handling all the heavy lifting on the back end while handling the front-end content of Drupal.