phpserialize
a port of the serialize and unserialize functions of php to python.
Decision gist · record as of 2026-08-14
Yes, but with caution. The package is stable for basic PHP serialization tasks and carries no known vulnerabilities, but it has been dormant since 2012 with minimal maintenance. Install if you have a specific need to interoperate with PHP serialized data and accept that bug fixes or Python version compatibility updates are unlikely. For new projects, consider whether JSON or another standard format would reduce coupling to PHP.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- No Python version requirement specified; test compatibility with your target Python version before production use.
- High install friction due to source-only distribution.
- Package is dormant since 2012 with no recent maintenance, though the repository shows a recent commit in 2024.
License · maintenance · safety
UNKNOWN (permissive) — Licensed under BSD (permissive), allowing commercial and private use with minimal restrictions.
last release 2012-01-22 (5318 days) · last repo commit 2024-06-11 · 132 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 272,666 downloads/mo, #8,207 on PyPI
Alternatives
Verify before relying
from phpserialize import dumps, loads
# Serialize a Python string
obj = dumps("Hello World")
print(loads(obj)) # 'Hello World'
# Handle lists (serialized as dicts in PHP)
from phpserialize import dict_to_list
result = dict_to_list(loads(dumps([1, 2, 3])))
print(result) # [1, 2, 3]- Whether the 2024 repository commit represents active maintenance or a one-off update
- Python 3 compatibility status beyond the version 1.3 changelog note
- Whether binary data handling via 'surrogateescape' is production-ready
What it is and what it does
phpserialize is a Python port of PHP's serialize and unserialize functions, enabling bidirectional conversion between Python objects and PHP serialization format. It implements the standard Python serialization interface with `dumps`, `loads`, and file-like object support.
The package handles PHP's type system differences: lists become dicts (with integer keys), unicode strings are UTF-8 encoded by default, and None/floats/booleans are converted to PHP-compatible types. It also supports PHP object serialization through hooks and provides helper functions like `dict_to_list` and `dict_to_tuple` to recover Python data structures. Version 1.3 added Python 3 support using the 'surrogateescape' error handler for bytes/unicode handling.
Use it for
- Deserialize PHP session data or cache stored in PHP format within a Python application
- Exchange structured data between PHP and Python services without JSON/XML conversion overhead
- Migrate or synchronize data from PHP applications to Python backends while preserving PHP object metadata
- Test PHP serialization logic in Python test suites by round-tripping PHP-serialized objects
- Parse WordPress or other PHP framework object data in Python analysis or migration tools
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, but with caution.
The package is stable for basic PHP serialization tasks and carries no known vulnerabilities, but it has been dormant since 2012 with minimal maintenance. Install if you have a specific need to interoperate with PHP serialized data and accept that bug fixes or Python version compatibility updates are unlikely. For new projects, consider whether JSON or another standard format would reduce coupling to PHP.
Install
phpserialize on PyPI
Before you install
High install friction due to source-only distribution. Package is dormant since 2012 with no recent maintenance, though the repository shows a recent commit in 2024. No runtime dependencies.
No Python version requirement specified; test compatibility with your target Python version before production use.
License in practice
Licensed under BSD (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
from phpserialize import dumps, loads
# Serialize a Python string
obj = dumps("Hello World")
print(loads(obj)) # 'Hello World'
# Handle lists (serialized as dicts in PHP)
from phpserialize import dict_to_list
result = dict_to_list(loads(dumps([1, 2, 3])))
print(result) # [1, 2, 3]
Verify before relying
- Whether the 2024 repository commit represents active maintenance or a one-off update
- Python 3 compatibility status beyond the version 1.3 changelog note
- Whether binary data handling via 'surrogateescape' is production-ready
Package facts
| License | UNKNOWN permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Dormant 5,318 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 272,666 / month, #8,207 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: BSD LicenseProgramming Language :: PHPProgramming Language :: PythonProgramming Language :: Python :: 3 |
Evidence: phpserialize-1.3.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “php serialization python”
- phpserializeConverts Python objects to and from PHP serialization format,…
- php2jsonConverts PHP serialized strings to JSON format, designed for fast…
- phplyphply is a lexer and parser for PHP source code that generates…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also php2json · serpent · dynamodb-json · bloomfilter-py · sexpdata · dill · telepath · json-fix · amazon-ion · libconf