pysyncml 0.1 documentation

Overview of pysyncml

«  Welcome to pysyncml   ::   Contents   ::   Command-Line Programs  »

Overview of pysyncml


The pysyncml project has the following goals, some of them diverge critically from other SyncML implementations and are the reasons for creating a new package instead of building on other existing implementations:

  • Can be installed and used with a single “pip install pysyncml” (or easy_install).
  • Is python 2.6+ and 3+ compatible.
  • Implements a sufficiently large subset of the SyncML 1.2.2 (a.k.a. the OMA Data Synchronization specification) as to be interoperable with other implementations without necessarily being “conformant”.
  • Can be easily integrated into SQLAlchemy based projects to store data in the application’s database instead of separated out (so that integrated database triggers and cascading can be applied).
  • Can be extended in order to make properly crafted clients able to operate in “distributed” mode - this means that in the absence of a network, SyncML client peers are able to synchronize with each other in the anticipation that the central server may or may not eventually become available again.
  • Differentiates as little as possible between “client” and “server” modes to enable the previous goal.
  • Makes basic synchronization easy and complicated synchronization possible by providing standard implementations for commonly used approaches, while allowing these components to be overriden or extended.
  • Provides basic command line tools for commonly synchronized data types.
  • Provides a framework of server-push notifications which are transport agnostic.
  • Auto-discovery of SyncML server URI locations; i.e. finding the “right” paths to bind object types is done automatically instead of needing error-prone user configuration.


It is the goal of the project to get a minimally functional library going in the shortest possible timeframe. To that end, the following features of SyncML will NOT be implemented until a later phase, even if this means that the library does not provide a conformant implementation:

  • NOT supported: filtering of searches or synchronization targets.
  • NOT supported: data split over multiple messages.
  • NOT supported: soft-deletes.
  • NOT supported: memory constraint management.
  • NOT supported: suspend, resume and busy signaling.
  • NOT supported: MD5 authentication scheme.
  • NOT supported: per-database-layer authorization.


Installation of pysyncml is near-trivial with PIP:

$ pip install pysyncml

or, using easy_install:

$ easy_install pysyncml


Python 2.6.6 or better is required, as the following is “taken for granted” by the pysyncml developers:

  • relative imports,
  • “with” context manager statement,
  • native ElementTree,
  • ternary expression (EXPR if EXPR else EXPR),
  • and something else which was found to not work in 2.6.4 but the author cannot remember what it was and does not wish to run into that limitation ever again...


  • Command-Line Programs:

    pysyncml comes with several simple command line programs to synchronize various object types, such as contacts and notes. Although they are intended as example implementations, they can nonetheless be used for real, albeit simple, synchronization.

  • Implementing a SyncML Command-Line Interface:

    This guide documents how to implement a command-line interface using the pysyncml.cli.CommandLineSyncEngine helper class and its subclasses. It provides some basic common functionality and implements both the client-side as well as the server-side of the SyncML negotiation.

  • Implementing a SyncML Client:

    This guide documents how to implement only the client-side of a SyncML communication. Due to the fact that pysyncml is intended to allow omni-directional synchronization, this is in fact not that much different from implementing a server, but can be slightly simpler.

  • Implementing a SyncML Server:

    This guide documents how to implement only the server-side of a SyncML communication. Due to the fact that pysyncml is intended to allow omni-directional synchronization, this is in fact not that much different from implementing a server, but there are extra tidbits about how to manage deep integration with a database, manage state and sessions as well as authorization/authentication concerns.

  • Matching, Merging, and Conflict Resolution:

    This guide covers the intricacies of finding matching items, tracking changes, detecting conflicting changes and merging non-conflicting changes. This is a difficult topic, so pysyncml offers several utilities to simplify this process as much as possible.

Coding Standards

Here are a few of the coding standards where the pysyncml project deviates or goes beyond PEP-8:

  • No hard tabs; soft tabs set to two (2) spaces.
  • All text-based versioned files have svn:keywords “Id” and “Revision”.
  • All text-based files must use unix-style line endings.
  • Assignment operations should be operator-aligned when in context of consecutive assignments.
  • No hard coding of literals; all literals must be overrideable.
  • No one-line logic (conditionals, loops, etc), except anonymous functions.
  • Python files are “utf-8” encoded and are marked as such.
  • Variables and methods are camelCase unless otherwise required by specs.
  • Classes are capitalized CamelCase unless otherwise required by specs.
  • Complexity is hidden via sane defaulting.
  • Documentation is on all public API entry points via restructured text (RST).
  • TODO items indicate potentially show-stopper issues, todo indicates nice-to-haves.


Please send any feedback, comments, suggestions, etc. to <>. For bug reports, please use the SourceForge ticket system (see Resources).

«  Welcome to pysyncml   ::   Contents   ::   Command-Line Programs  »