Unserialize PHP data in python

Possible duplicate:
How to read / understand serialized PHP data string in python

I am using python to access a database that is controlled by a Drupal installation. The data I want to receive in Drupal is stored in the database as a serialized PHP object.

Are there any prebuilt python modules that can deserialize a serialized PHP object into a python object? I did some searching and came up with nothing.

I understand that I can write my own parser from scratch, but I would prefer to use something that has been verified and verified.

+8
python php drupal deserialization
source share
2 answers

Are you looking for phpserialize ?

+15
source share

If you don't need serialization of objects (which can be compensated by associative arrays), then a faster alternative could be this: http://code.google.com/p/serek/ (this is a Python module written in C)

It was used on production servers under heavy load in my company, so I can recommend it as stable. However, there is no tarball available. Therefore, you must grab it directly from the vault.

+3
source share

All Articles