Skip to main content

Python protocol buffers compiler

Project description

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

protocol buffers compiler

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.

Project details


Download files

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

Source Distribution

pyprotobuf-0.8.tar.gz (48.2 kB view details)

Uploaded Source

File details

Details for the file pyprotobuf-0.8.tar.gz.

File metadata

  • Download URL: pyprotobuf-0.8.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyprotobuf-0.8.tar.gz
Algorithm Hash digest
SHA256 80276e0f8b4beaf0e77b3ef957c0addb3bb54e42a24a7bbaa121a6a2eb7515db
MD5 6e86c409fd0dfdbbba84ab3c55ceae47
BLAKE2b-256 dfc9cb3d6f51bf724da92a96d93ddf5591a12ecca1ab09d0a75d4ac8c88e63af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page