Package: pyleus
Pyleus is a Python 2.6+ framework for developing and launchingApache Stormtopologies.Please visit ourdocumentation.masterdevelopAboutPyleus is a framework for building Apache Storm topologies in idiomatic Python.With Pyleus you can:define a topology with a simple YAML filehave dependency management with arequirements.txtfilerun faster thanks to Pyleus’MessagePackbased serializerpass options to your components directly from the YAML fileuse the Kafka spout built into Storm with only a YAML changeInstallFrom PyPI:$pipinstallpyleusNote:You doNOTneed to install pyleus on your Storm cluster. That’s cool, isn’t it?However, if you are going to usesystem_site_packages: truein your config file, you should be aware that the environment of your Storm nodes needs to match the one on the machine used for building the topology. This means you actuallyhave to installpyleus on your Storm cluster in this case.Try it out!$gitclonehttps://github.com/Yelp/pyleus.git$pyleusbuildpyleus/examples/exclamation_topology/pyleus_topology.yaml$pyleuslocalexclamation_topology.jarOr, submit to a Storm cluster with:$pyleussubmit-nNIMBUS_HOSTexclamation_topology.jarTheexamplesdirectory contains several annotated Pyleus topologies that try to cover as many Pyleus features as possible.Pyleus command line interfaceBuild a topology:$pyleusbuild/path/to/pyleus_topology.yamlRun a topology locally:$pyleuslocal/path/to/topology.jarSubmit a topology to a Storm cluster:$pyleussubmit[-nNIMBUS_HOST]/path/to/topology.jarList all topologies running on a Storm cluster:$pyleuslist[-nNIMBUS_HOST]Kill a topology running on a Storm cluster:$pyleuskill[-nNIMBUS_HOST]TOPOLOGY_NAMETrypyleus-hfor a list of all the available commands orpyleus CMD-hfor any command-specific help.Write your first topologyPlease refer to thedocumentationfor a more detailed tutorial.Organize your filesThis is an example of the directory tree of a simple topology:my_first_topology/
|-- my_first_topology/
|   |-- __init__.py
|   |-- dummy_bolt.py
|   |-- dummy_spout.py
|-- pyleus_topology.yaml
|-- requirements.txtDefine the topology layoutA simplepyleus_topology.yamlshould look like the following:name:my_first_topologytopology:-spout:name:my-first-spoutmodule:my_first_topology.dummy_spout-bolt:name:my-first-boltmodule:my_first_topology.dummy_boltgroupings:-shuffle_grouping:my-first-spoutThis defines a topology where a single bolt subscribes to the output stream of a single spout. As simple as it is.Write your first spoutThis is the code implementingdummy_spout.py:frompyleus.stormimportSpoutclassDummySpout(Spout):OUTPUT_FIELDS=['sentence','name']defnext_tuple(self):self.emit(("This is a sentence.","spout",))if__name__=='__main__':DummySpout().run()Write your first boltLet’s now look atdummy_bolt.py:frompyleus.stormimportSimpleBoltclassDummyBolt(SimpleBolt):OUTPUT_FIELDS=['sentence']defprocess_tuple(self,tup):sentence,name=tup.valuesnew_sentence="{0}says,\"{1}\"".format(name,sentence)self.emit((new_sentence,),anchors=[tup])if__name__=='__main__':DummyBolt().run()Run your topologyRun the topology on your local machine for debugging:pyleusbuildmy_first_topology/pyleus_topology.yamlpyleuslocal--debugmy_first_topology.jarWhen you are done, hitC-C.Configuration FileYou can set default values for many configuration options by placing a.pyleus.conffile in your home directory:[storm]
nimbus_host: 10.11.12.13
jvm_opts: -Djava.io.tmpdir=/home/myuser/tmp

[build]
pypi_index_url: http://pypi.ninjacorp.com/simple/ReferenceApache Storm DocumentationLicensePyleus is licensed under the Apache License, Version 2.0:http://www.apache.org/licenses/LICENSE-2.0