Skip to main content
Help us improve Python packaging – donate today!

Python protocol buffers compiler

Project Description

##########
pyprotobuf
##########


A python protocol buffers compiler
##################################


Converts from .proto to:

* python protorpc
* Closure library externs
* Closure library goog.proto2


Visit http://code.google.com/p/pyprotobuf for more information.

Installation
############


From PyPi::

pip install pyprotobuf


Usage
#####

.. program:: pyprotoc

.. option:: --format

Select the output format

.. option:: -h, --help

Show a help message


Usage::

usage: pyprotoc [-h] [--format {closure,python,externs}] paths [paths ...]

positional arguments:
paths

optional arguments:
-h, --help show this help message and exit
--format {closure,python,externs}


Example
#######

Input file (test.proto)::

option javascript_package = "com.example";

message Item {
optional string aString = 1;
optional int32 aNumber = 2;
required string aRequiredString = 3;
repeated string aRepeatedString = 4;
}

Generated python rpc (`protopy --format python test.proto`)::

from protorpc import messages

class Item(messages.Message):
aString = messages.StringField(1)
aNumber = messages.IntegerField(2)
aRequiredString = messages.StringField(3, required=True)
aRepeatedString = messages.StringField(4, repeated=True)

Generated javascript externs(`protopy --format externs test.proto`)::

/** @constructor */
com.example.Item = function(){};

/** @type {string} */
com.example.Item.prototype.aString;

/** @type {number} */
com.example.Item.prototype.aNumber;

/** @type {string} */
com.example.Item.prototype.aRequiredString;

/** @type {[string]} */
com.example.Item.prototype.aRepeatedString;



Development
###########

Contributions are welcome.

Release history Release notifications

History Node

0.8

This version
History Node

0.7.2

History Node

0.7.1

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyprotobuf-0.7.2.tar.gz (17.5 kB) Copy SHA256 hash SHA256 Source None Sep 25, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page