Compiled python generated from the Cloud Foundry Dropsonde Protobuf definition files.
The Dropsonde Protocol is defined here, and this repo provides "protoc" compiled Python and Python3 modules.
The Standard protobuf files are referenced as follows.
from dropsonde.pb import envelope_pb2
from dropsonde.pb import error_pb2
from dropsonde.pb import http_pb2
from dropsonde.pb import log_pb2
from dropsonde.pb import metric_pb2
from dropsonde.pb import uuid_pb2
The UUID protobuf type is rather cryptic, so a utility function is included for parsing the type into a UUID formatted string.
>>> from dropsonde.util import get_uuid_string
>>> application_guid = {
... 'low': '12413561682238894606',
... 'high': '3611542221973970511'
... }
>>> application_guid = get_uuid_string(**application_guid)
>>> print(application_guid)
0ef23f83-94d4-45ac-e455-014268ec2103
>>>
The Makefile
provides all core development tasks.
make install
This will
- clone the Dropsonde protobuf repo
- install dependencies for python2
- install dependencies for python3
make compile
This will
- create a copy of the protobuf source files
- refactor the "import" directives in the source files to match the required python package structure
- run "protoc" on the refactored source files and output the generated Python code into the "dropsonde.pb" python package tree.
make test
This will
- run the tests to ensure that imports work
- ensure that the UUID conversion tool works
make clean
This will
- remove all the refactored protobuf files
- remove the virtualenv environments for python2 and python3
make package
This will only package the compiled python files using setup.py
make build
This will
- run the "clone" task
- run the "compile" task
- run the "test" task
- run the "package" task
make deploy
This will
- run the "clean" task
- run the "clone" task
- run the "compile" task
- run the "test" task
- run the
python setup.py sdist upload
to deploy to PyPI.