File python-JsonWeb.spec of Package python-JsonWeb

# spec file for package python-JsonWeb
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           python-JsonWeb
Version:        0.8.2
Release:        0
Summary:        Quickly add json serialization and deserialization to your python classes
License:        BSD-3-Clause
Group:          Development/Languages/Python
BuildRequires:  python-coverage
BuildRequires:  python-devel
BuildRequires:  python-nose
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

Add JSON (de)serialization to your python objects :

    >>> from jsonweb import decode, encode
    >>> @encode.to_object()
    ... @decode.from_object()
    ... class User(object):
    ...     def __init__(self, nick, email):
    ...         self.nick = nick
    ... = email
    >>> json_str = encode.dumper(User("cool_user123", ""))
    >>> print json_str
    {"nick": "cool_user123", "__type__": "User", "email": ""}
    >>> user = decode.loader(json_str)
    >>> print user.nick
    >>> print user
    <User object at 0x10145e390>

%setup -q -n JsonWeb-%{version}

python build

python install --prefix=%{_prefix} --root=%{buildroot}


%doc README.rst