Drupy
Drupal… in Python
Frequently Asked Questions
Updated 07/12/2008
-
Why port Drupal to Python?
A lot of people have asked for it, and a lot of people have talked about it, but it still had not been done. Drupal is a highly robust platform, with no real counterpart for Python. Drupy is offering a solution for the many people who love Drupal or would love Drupal but wish for an environment other than PHP.
We recognize that some Drupal developers and Python developers may be uncomfortable with Drupal in Python. The beauty of Free and Open software is that you are given the ability to choose what is right for your own needs.
-
I am a PHP programmer. Why should I care about Python?
Python makes life easy. It places an emphasis on code readability and consistancy. Python has excellent OOP and namespace support integrated throughout. This means your code is easier to write, and easier to debug.
-
Does Drupy aim to provide 100% Drupal API compatibility?
Yes. If an API function is available in Drupal, it either already is or will be available in Drupy.
-
Will Drupal modules work out of the box with Drupy?
No. However, Drupy provides an abstraction library and some conversion scripts to make the process very simple. It is not uncommon to port a non-core module at about 200 lines per hour.
-
Will Drupy inherit Drupal's php-specific hacks and quirks?
No. Great care goes into balancing Drupal API compatibility with Python best practices. One such example is that Drupy is 100% fully namespaced.
-
How would Drupy implement an API call such as "node_load()"?
In Drupy, "node_load()" would be called as "plugin_node.load()".
-
What does a Drupal module look like in Drupy?
The path of the system module (system.module) is "plugins/system/__init__.py". The hook "system_init" is renamed to "hook_init".
-
Is this a fork of Drupal?
No. This is a port to a different language.
-
What are the primary differences between Drupal and Drupy?
- Drupy is written in Python. Drupal is written in PHP.
- Any reference to a "module" in Drupal is called a "plugin" in Drupy.
- Drupal does not make use of namespaces and OOP structures. Drupy is 100% fully namespaced.
-
Is Drupy PEP-8 compliant?
All code ported from Drupal core is partially PEP-8 compliant:
- Strict 79 character limit per line
- Docstrings on modules and functions
All non-Drupal core files either already are or will be fully PEP-8 compliant.
-
Why isn't Drupy 100% PEP-8 compliant?
Thousands and thousands of lines of code have been ported by one person. Most of this code is stable and consistant. Without starting completely from scratch, it would not be possible to completely integrate every single PEP-8/Pythonic practice on the first iteration.
PEP-8 does not define application stability, reliability, and performance. It only defines stylistic guidlines so code can be easy to read. The first and primary goal for Drupy is to deliver an application that is stable and reliable. After this goal is met, more attention will be given to stylistic details such as indentation width and proper spacing between function blocks.
-
Do any other similar projects exist?
There has been a lot of talk over the years of porting Drupal to Python. As of yet, no project has actually written any substantial amount of code aside from Drupy.
-
Will Drupy run as WSGI?
After the first Alpha release, WSGI will be integrated into Drupy.
-
Can you add feature X?
Python developers are strongly encouraged to contribute. If there is a feature you would like to see, feel free to build it and submit to the project.
-
Where can I address any criticisms or complaints?
You are encouraged to fix the problem and submit your contribution. If it is good quality, it will be committed.
For criticisms or complaints about indentation levels, variable names, directory structures, or docstring formats, please go here.