cypy/data.py
def coerce(cls, value, encoding=None):
        """ Coerce a Python value to an appropriate Cypher value.

        The supported mappings are:

        =====================  ===============  ===========  =====
        Python Type            Python Versions  Cypher Type  Notes
        =====================  ===============  ===========  =====
        :py:const:`None`       2, 3+            Null
        :py:class:`bool`       2, 3+            Boolean
        :py:class:`int`        2, 3+            Integer      Must be in the range -(2\ :sup:`63`) to 2\ :sup:`63` - 1.
        :py:class:`long`       2                Integer      Must be in the range -(2\ :sup:`63`) to 2\ :sup:`63` - 1.
        :py:class:`float`      2, 3+            Float
        :py:class:`str`        2, 3+            String       In Python 2, a Unicode value is derived via the `encoding`.
        :py:class:`unicode`    2                String
        :py:class:`bytearray`  2, 3             Bytes
        :py:class:`bytes`      3                Bytes        In Python 2, :py:attr:`bytes` is an alias for :py:attr:`str`.
        :py:class:`dict`       2, 3             Map
        (iterable)             2, 3             List         Any other class which implements the :py:func:`__iter__` method.
        =====================  ===============  ===========  =====

        """
        from cypy.graph import Node, Relationship, Path
        if value is None:
            return cls.coerce_null(value)
        elif isinstance(value, bool):
            return cls.coerce_boolean(value)
        elif isinstance(value, integer_types):
            return cls.coerce_integer(value)
        elif isinstance(value, float):
            return cls.coerce_float(value)
        elif isinstance(value, unicode_types):
            return cls.coerce_string(value)
        elif isinstance(value, utf8_types):
            return cls.coerce_string(value, encoding)
        elif isinstance(value, bytes_types):
            return cls.coerce_bytes(value, encoding)
        elif isinstance(value, Node):
            return cls.coerce_node(value, encoding)
        elif isinstance(value, Relationship):
            return cls.coerce_relationship(value, encoding)
        elif isinstance(value, Path):
            return cls.coerce_path(value, encoding)
        elif isinstance(value, dict):
            return cls.coerce_map(value, encoding)
        elif hasattr(value, "__iter__"):
            return cls.coerce_list(value, encoding)
        else:
            raise TypeError("Values of type %s are not supported" % value.__class__.__name__)
 Coerce a Python value to an appropriate Cypher value.

        The supported mappings are:

        =====================  ===============  ===========  =====
        Python Type            Python Versions  Cypher Type  Notes
        =====================  ===============  ===========  =====
        :py:const:`None`       2, 3+            Null
        :py:class:`bool`       2, 3+            Boolean
        :py:class:`int`        2, 3+            Integer      Must be in the range -(2\ :sup:`63`) to 2\ :sup:`63` - 1.
        :py:class:`long`       2                Integer      Must be in the range -(2\ :sup:`63`) to 2\ :sup:`63` - 1.
        :py:class:`float`      2, 3+            Float
        :py:class:`str`        2, 3+            String       In Python 2, a Unicode value is derived via the `encoding`.
        :py:class:`unicode`    2                String
        :py:class:`bytearray`  2, 3             Bytes
        :py:class:`bytes`      3                Bytes        In Python 2, :py:attr:`bytes` is an alias for :py:attr:`str`.
        :py:class:`dict`       2, 3             Map
        (iterable)             2, 3             List         Any other class which implements the :py:func:`__iter__` method.
        =====================  ===============  ===========  =====

        
Coerce a Python value to an appropriate Cypher value.
The supported mappings are.

Python Type            Python Versions  Cypher Type  Notes
Coerce a Python value to an appropriate Cypher value . The supported mappings are . Python Type Python Versions Cypher Type Notes
def coerce(cls, value, encoding=None):
        from cypy.graph import Node, Relationship, Path
        if value is None:
            return cls.coerce_null(value)
        elif isinstance(value, bool):
            return cls.coerce_boolean(value)
        elif isinstance(value, integer_types):
            return cls.coerce_integer(value)
        elif isinstance(value, float):
            return cls.coerce_float(value)
        elif isinstance(value, unicode_types):
            return cls.coerce_string(value)
        elif isinstance(value, utf8_types):
            return cls.coerce_string(value, encoding)
        elif isinstance(value, bytes_types):
            return cls.coerce_bytes(value, encoding)
        elif isinstance(value, Node):
            return cls.coerce_node(value, encoding)
        elif isinstance(value, Relationship):
            return cls.coerce_relationship(value, encoding)
        elif isinstance(value, Path):
            return cls.coerce_path(value, encoding)
        elif isinstance(value, dict):
            return cls.coerce_map(value, encoding)
        elif hasattr(value, "__iter__"):
            return cls.coerce_list(value, encoding)
        else:
            raise TypeError("Values of type %s are not supported" % value.__class__.__name__)
def coerce ( cls , value , encoding = None ) : from cypy . graph import Node , Relationship , Path if value is None : return cls . coerce_null ( value ) elif isinstance ( value , bool ) : return cls . coerce_boolean ( value ) elif isinstance ( value , integer_types ) : return cls . coerce_integer ( value ) elif isinstance ( value , float ) : return cls . coerce_float ( value ) elif isinstance ( value , unicode_types ) : return cls . coerce_string ( value ) elif isinstance ( value , utf8_types ) : return cls . coerce_string ( value , encoding ) elif isinstance ( value , bytes_types ) : return cls . coerce_bytes ( value , encoding ) elif isinstance ( value , Node ) : return cls . coerce_node ( value , encoding ) elif isinstance ( value , Relationship ) : return cls . coerce_relationship ( value , encoding ) elif isinstance ( value , Path ) : return cls . coerce_path ( value , encoding ) elif isinstance ( value , dict ) : return cls . coerce_map ( value , encoding ) elif hasattr ( value , "__iter__" ) : return cls . coerce_list ( value , encoding ) else : raise TypeError ( "Values of type %s are not supported" % value . __class__ . __name__ )
Coerce a Python value to an appropriate Cypher value.
Coerce a Python value to an appropriate Cypher value .
""" Coerce a Python value to an appropriate Cypher value.

        The supported mappings are:

        =====================  ===============  ===========  =====
        Python Type            Python Versions  Cypher Type  Notes
        =====================  ===============  ===========  =====
        :py:const:`None`       2, 3+            Null
        :py:class:`bool`       2, 3+            Boolean
        :py:class:`int`        2, 3+            Integer      Must be in the range -(2\ :sup:`63`) to 2\ :sup:`63` - 1.
        :py:class:`long`       2                Integer      Must be in the range -(2\ :sup:`63`) to 2\ :sup:`63` - 1.
        :py:class:`float`      2, 3+            Float
        :py:class:`str`        2, 3+            String       In Python 2, a Unicode value is derived via the `encoding`.
        :py:class:`unicode`    2                String
        :py:class:`bytearray`  2, 3             Bytes
        :py:class:`bytes`      3                Bytes        In Python 2, :py:attr:`bytes` is an alias for :py:attr:`str`.
        :py:class:`dict`       2, 3             Map
        (iterable)             2, 3             List         Any other class which implements the :py:func:`__iter__` method.
        =====================  ===============  ===========  =====

        """
cls
value
encoding
py
None
py
None
py
None
py
None
py
None
py
`str`        2, 3+            String       In Python 2, a Unicode value is derived via the `encoding`.
` str ` 2 3 + String In Python 2 a Unicode value is derived via the ` encoding ` .
py
`unicode`    2                String
` unicode ` 2 String
py
`bytearray`  2, 3             Bytes
` bytearray ` 2 3 Bytes
py
`bytes`      3                Bytes        In Python 2, :py:attr:`bytes` is an alias for :py:attr:`str`.
` bytes ` 3 Bytes In Python 2 : py : attr : ` bytes ` is an alias for : py : attr : ` str ` .
py
`dict`       2, 3             Map
(iterable)             2, 3             List         Any other class which implements the :py:func:`__iter__` method.
` dict ` 2 3 Map ( iterable ) 2 3 List Any other class which implements the : py : func : ` __iter__ ` method .