From brian at python.org Mon Feb 4 16:57:01 2013 From: brian at python.org (Brian Curtin) Date: Mon, 4 Feb 2013 09:57:01 -0600 Subject: [Baypiggies] PyCon 2013 has some great beginner events. Tickets selling quickly! Message-ID: Hi all, As PyCon is down to its last 400 tickets, I wanted to highlight several new and great parts about the conference that may interest you or someone you know. We think PyCon is a great value for our attendees and we?ve added some tutorials and events to get people started in the Python world. New for 2013 is a two-day event happening March 13th and 14th titled ?The Young Coder: Let?s Learn Python,? taught by Katie Cunningham and Barbara Shaurette. This *free* tutorial teaches kids 12 and over the basics of Python and ends with the creation of a game. The kids don?t need to bring anything, as the tutorial will be happening in a lab furnished with Raspberry Pis, and each attendee gets to take home a free book to keep on learning. See https://us.pycon.org/2013/events/letslearnpython/ for more details and reserve your space before it fills up! We also have two great beginner tutorials on the schedule: Jessica McKellar?s ?A hands-on introduction to Python for beginning programmers?, and Dave Beazley?s ?Learn Python Through Public Data Hacking.? They?re both great teachers and want to bring attendees to the world of programming via Python. More info about Jessica?s tutorial is at https://us.pycon.org/2013/schedule/presentation/1/. Dave?s tutorial is happening right after Jessica?s, with details at https://us.pycon.org/2013/schedule/presentation/2/. We?ve also added a set of free workshops hosted by several of our sponsors, available at https://us.pycon.org/2013/schedule/sponsor-tutorials/. These 90 minute sessions give you an intimate setting to hear about the latest goings on with some of the coolest companies in the Python world. You don?t need to register for the conference to attend our tutorials, so they?re great for locals to get some exposure to Python. Jessica and Dave?s tutorials are $150 each, and the kids tutorial as well as the sponsor tutorials are free! If you?re interested in attending the conference, don?t hesitate as tickets are going quickly. Check out the full schedule of events at https://us.pycon.org/2013/schedule/ and head to https://us.pycon.org/2013/registration/ and get signed up today! See you in March! Jesse Noller, Chairman jnoller at python.org Brian Curtin, Publicity Coordinator brian at python.org From erin.lynn.root at gmail.com Wed Feb 6 18:35:24 2013 From: erin.lynn.root at gmail.com (Lynn Root) Date: Wed, 6 Feb 2013 09:35:24 -0800 Subject: [Baypiggies] [CfP] EuroPython July 1-7th Message-ID: Europe's biggest Python conference just announced their CfP for this year. This is the last year it's in Florence, Italy - a fantastic venue, and a superbly-ran conference. The CfP is due by March 5th, and talks are voted on by the community. I had the pleasure of keynoting last year in regards to community + diversity - and hope to speak again this year! https://ep2013.europython.eu/call-for-proposals/ Lynn Root -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Tue Feb 12 00:52:08 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Mon, 11 Feb 2013 15:52:08 -0800 Subject: [Baypiggies] Microsoft Web API (heeeeellp) Message-ID: I'm sorry. Since I know *nothing* about Microsoft technology -- except for a few very painful times I had to deal with it, when I see something like this in the docs for my new project, I immediately am going to ask for help: The Web API utilizes the Microsoft Web API query functionality. This provides a partial implementation of OData operators, including $filter, $orderby, $top, $skip, $count and $inlinecount. I get lost even Googling what I need to know. Does anyone have a nice OpenSource library for Python that exists so I don't have to re-invent the wheel to interact with this API? G -- "Pursue, keep up with, circle round and round your life as a dog does his master's chase. Do what you love. Know your own bone; gnaw at it, bury it, unearth it, and gnaw it still." --Henry David Thoreau -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 13 02:00:59 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 12 Feb 2013 17:00:59 -0800 Subject: [Baypiggies] Entry points help Message-ID: I have a directory like this: baypiggies - __init__.py - fruit.py - meat.py - mock.py - runner.py My runner.py is the main entry point and it is used to dynamically chose which of these other files to import. # pylint: disable=C0103,R0904 """A sample dynamically loaded example with endpoints ./runner.py --backend=fruit """ from optparse import OptionParser entry_points = { 'fruit': dict( thump = ('fruit', 'thump'), eat = ('fruit', 'eat'), chew = ('fruit', 'chew'), ), 'meat': dict( thump = ('meat', 'thump'), eat = ('meat', 'eat'), chew = ('meat', 'chew'), ), 'mock': dict( thump = ('mock', 'thump'), eat = ('mock', 'eat'), chew = ('mock', 'chew'), ), 'custom1': dict( thump = ('myns.mypkg.mymodule', 'thump'), eat = ('myns.mypkg.mymodule', 'eat'), chew = ('myns.mypkg.mymodule', 'chew'), ), } def import_entry_points(entries): """Dynamically import the functions for the specified backend entry_points is a global dictionary whos keys correspond to each of the different types of backends that we can support. The variable options.backend specifies which of the backends that will be used during this program run. The value of entry_points (for options.backend) is another dictionary which map the functions needed to the modules from where we will import these modules. We only want to import the backend modules that will be used (and not have unnecessary dependencies). This module will replace the values in this inner dictionary with the imported functions. This way, the functions are imported and available when needed. """ for entry in entries: module, name = entries[entry] _temp = __import__(module, globals(), locals(), [name], 0) entries[entry] = getattr(_temp, entry) def run(backend="mock"): print "Running, backend: ", backend import_entry_points(entry_points[backend]) import pprint pprint.pprint(entry_points) print "THUMPING..." entry_points[backend]["thump"]() print "EATING..." entry_points[backend]["eat"]() print "CHEWING..." # Chew five times entry_points[backend]["chew"](5) if __name__ == "__main__": parser = OptionParser() parser.add_option("-b", "--backend", dest="backend", default="mock", help="Choose which backend to run.") (options, args) = parser.parse_args() run(options.backend) Now, as you can see, the backends are loaded dynamically depending upon the command line options (let's only import what we need). prompt> python runner.py Running, backend: mock {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), 'eat': ('myns.mypkg.mymodule', 'eat'), 'thump': ('myns.mypkg.mymodule', 'thump')}, 'fruit': {'chew': ('fruit', 'chew'), 'eat': ('fruit', 'eat'), 'thump': ('fruit', 'thump')}, 'meat': {'chew': ('meat', 'chew'), 'eat': ('meat', 'eat'), 'thump': ('meat', 'thump')}, 'mock': {'chew': , 'eat': , 'thump': }} THUMPING... Pretend to thump EATING... Pretend to eat CHEWING... Prentend to chew And, totally new/different backend if I choose the option: Running, backend: fruit {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), 'eat': ('myns.mypkg.mymodule', 'eat'), 'thump': ('myns.mypkg.mymodule', 'thump')}, 'fruit': {'chew': , 'eat': , 'thump': }, 'meat': {'chew': ('meat', 'chew'), 'eat': ('meat', 'eat'), 'thump': ('meat', 'thump')}, 'mock': {'chew': ('mock', 'chew'), 'eat': ('mock', 'eat'), 'thump': ('mock', 'thump')}} THUMPING... Thumping fruit... EATING... Eating fruit.. very healthy.... CHEWING... Fruit chew 0 Fruit chew 1 Fruit chew 2 Fruit chew 3 Fruit chew 4 Here are examples of my backends: """An empty mock (Currently not implemented)""" def thump(): print "Pretend to thump" def eat(): print "Pretend to eat" def chew(number_of_times): print "Prentend to chew" Here's the mock one (by default): def thump(): print "Pretend to thump" def eat(): print "Pretend to eat" def chew(number_of_times): print "Prentend to chew" So, I'm supposed to be using entry points from the setuptools library (instead of the above). But, I've googled and get stuck. I just don't see how to use it (and use it without doing a setup each time).: http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 Can someone help me by example? I'm confused... Cheers, Glen -- "Pursue, keep up with, circle round and round your life as a dog does his master's chase. Do what you love. Know your own bone; gnaw at it, bury it, unearth it, and gnaw it still." --Henry David Thoreau -------------- next part -------------- An HTML attachment was scrubbed... URL: From malcolm at hoprocker.net Wed Feb 13 02:18:10 2013 From: malcolm at hoprocker.net (malcolm) Date: Tue, 12 Feb 2013 17:18:10 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: References: Message-ID: Hey Glen I've got no idea if this matters -- haven't used this before -- but comparing your entry_point structure against then one the SO post, it looks as though you've missed the type definitions by a bit. The poster on SO structured his entry_points like so: entry_points = { # <-- dict 'group_name' : [ # <-- list 'ep_func = module:attr', .. Whereas you've structured yours like so: entry_points = { # <-- dict 'group_name': dict( # <-- dict 'name' = (tuple), .. I also found the SO structure used here: http://reinout.vanrees.org/weblog/2010/01/06/zest-releaser-entry-points.html Like I said, I've never toyed with this corner of packaging, but maybe this can shed some light. -m On Tue, Feb 12, 2013 at 5:00 PM, Glen Jarvis wrote: > I have a directory like this: > > baypiggies > - __init__.py > - fruit.py > - meat.py > - mock.py > - runner.py > > My runner.py is the main entry point and it is used to dynamically chose > which of these other files to import. > > # pylint: disable=C0103,R0904 > > """A sample dynamically loaded example with endpoints > > ./runner.py --backend=fruit > """ > > from optparse import OptionParser > > > entry_points = { > 'fruit': dict( > thump = ('fruit', 'thump'), > eat = ('fruit', 'eat'), > chew = ('fruit', 'chew'), > ), > 'meat': dict( > thump = ('meat', 'thump'), > eat = ('meat', 'eat'), > chew = ('meat', 'chew'), > ), > 'mock': dict( > thump = ('mock', 'thump'), > eat = ('mock', 'eat'), > chew = ('mock', 'chew'), > ), > 'custom1': dict( > thump = ('myns.mypkg.mymodule', 'thump'), > eat = ('myns.mypkg.mymodule', 'eat'), > chew = ('myns.mypkg.mymodule', 'chew'), > ), > } > > def import_entry_points(entries): > > """Dynamically import the functions for the specified backend > > entry_points is a global dictionary whos keys correspond to each > of the different types of backends that we can support. The variable > options.backend specifies which of the backends that will be used > during this program run. > > The value of entry_points (for options.backend) is another > dictionary which map the functions needed to the modules from where > we will import these modules. We only want to import the backend > modules that will be used (and not have unnecessary dependencies). > > This module will replace the values in this inner dictionary with > the imported functions. This way, the functions are imported and > available when needed. > """ > > for entry in entries: > module, name = entries[entry] > _temp = __import__(module, globals(), locals(), [name], 0) > entries[entry] = getattr(_temp, entry) > > > def run(backend="mock"): > print "Running, backend: ", backend > import_entry_points(entry_points[backend]) > > import pprint > pprint.pprint(entry_points) > > print "THUMPING..." > entry_points[backend]["thump"]() > > print "EATING..." > entry_points[backend]["eat"]() > > print "CHEWING..." > # Chew five times > entry_points[backend]["chew"](5) > > if __name__ == "__main__": > parser = OptionParser() > parser.add_option("-b", "--backend", dest="backend", > default="mock", > help="Choose which backend to run.") > > (options, args) = parser.parse_args() > run(options.backend) > > > > Now, as you can see, the backends are loaded dynamically depending upon > the command line options (let's only import what we need). > > prompt> python runner.py > Running, backend: mock > {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), > 'eat': ('myns.mypkg.mymodule', 'eat'), > 'thump': ('myns.mypkg.mymodule', 'thump')}, > 'fruit': {'chew': ('fruit', 'chew'), > 'eat': ('fruit', 'eat'), > 'thump': ('fruit', 'thump')}, > 'meat': {'chew': ('meat', 'chew'), > 'eat': ('meat', 'eat'), > 'thump': ('meat', 'thump')}, > 'mock': {'chew': , > 'eat': , > 'thump': }} > THUMPING... > Pretend to thump > EATING... > Pretend to eat > CHEWING... > Prentend to chew > > > And, totally new/different backend if I choose the option: > > > Running, backend: fruit > {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), > 'eat': ('myns.mypkg.mymodule', 'eat'), > 'thump': ('myns.mypkg.mymodule', 'thump')}, > 'fruit': {'chew': , > 'eat': , > 'thump': }, > 'meat': {'chew': ('meat', 'chew'), > 'eat': ('meat', 'eat'), > 'thump': ('meat', 'thump')}, > 'mock': {'chew': ('mock', 'chew'), > 'eat': ('mock', 'eat'), > 'thump': ('mock', 'thump')}} > THUMPING... > Thumping fruit... > EATING... > Eating fruit.. very healthy.... > CHEWING... > Fruit chew 0 > Fruit chew 1 > Fruit chew 2 > Fruit chew 3 > Fruit chew 4 > > > > Here are examples of my backends: > > > > > """An empty mock (Currently not implemented)""" > > > def thump(): > > print "Pretend to thump" > > > def eat(): > > print "Pretend to eat" > > > def chew(number_of_times): > > print "Prentend to chew" > > > > > Here's the mock one (by default): > > > def thump(): > > print "Pretend to thump" > > > def eat(): > > print "Pretend to eat" > > > def chew(number_of_times): > > print "Prentend to chew" > > > > > > So, I'm supposed to be using entry points from the setuptools library > (instead of the above). But, I've googled and get stuck. I just don't see > how to use it (and use it without doing a setup each time).: > > > http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 > > Can someone help me by example? I'm confused... > > > Cheers, > > > Glen > -- > > "Pursue, keep up with, circle round and round your life as a dog does his > master's chase. Do what you love. Know your own bone; gnaw at it, bury it, > unearth it, and gnaw it still." > > --Henry David Thoreau > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 13 03:21:16 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 12 Feb 2013 18:21:16 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: References: Message-ID: <9666208C-8500-4CF4-A2CC-008B79883CB2@glenjarvis.com> Thanks Malcolm. Yeah, I simplified the structure for my needs. I will need to update struct when we update. But the real question comes into how to use the library properly -- I'm still not sure. G On Feb 12, 2013, at 5:18 PM, malcolm wrote: > Hey Glen > > I've got no idea if this matters -- haven't used this before -- but comparing your entry_point structure against then one the SO post, it looks as though you've missed the type definitions by a bit. The poster on SO structured his entry_points like so: > > entry_points = { # <-- dict > 'group_name' : [ # <-- list > 'ep_func = module:attr', > .. > > Whereas you've structured yours like so: > > entry_points = { # <-- dict > 'group_name': dict( # <-- dict > 'name' = (tuple), > .. > > I also found the SO structure used here: http://reinout.vanrees.org/weblog/2010/01/06/zest-releaser-entry-points.html > > Like I said, I've never toyed with this corner of packaging, but maybe this can shed some light. > > -m > > On Tue, Feb 12, 2013 at 5:00 PM, Glen Jarvis wrote: >> I have a directory like this: >> >> baypiggies >> - __init__.py >> - fruit.py >> - meat.py >> - mock.py >> - runner.py >> >> My runner.py is the main entry point and it is used to dynamically chose which of these other files to import. >> >> # pylint: disable=C0103,R0904 >> >> """A sample dynamically loaded example with endpoints >> >> ./runner.py --backend=fruit >> """ >> >> from optparse import OptionParser >> >> >> entry_points = { >> 'fruit': dict( >> thump = ('fruit', 'thump'), >> eat = ('fruit', 'eat'), >> chew = ('fruit', 'chew'), >> ), >> 'meat': dict( >> thump = ('meat', 'thump'), >> eat = ('meat', 'eat'), >> chew = ('meat', 'chew'), >> ), >> 'mock': dict( >> thump = ('mock', 'thump'), >> eat = ('mock', 'eat'), >> chew = ('mock', 'chew'), >> ), >> 'custom1': dict( >> thump = ('myns.mypkg.mymodule', 'thump'), >> eat = ('myns.mypkg.mymodule', 'eat'), >> chew = ('myns.mypkg.mymodule', 'chew'), >> ), >> } >> >> def import_entry_points(entries): >> >> """Dynamically import the functions for the specified backend >> >> entry_points is a global dictionary whos keys correspond to each >> of the different types of backends that we can support. The variable >> options.backend specifies which of the backends that will be used >> during this program run. >> >> The value of entry_points (for options.backend) is another >> dictionary which map the functions needed to the modules from where >> we will import these modules. We only want to import the backend >> modules that will be used (and not have unnecessary dependencies). >> >> This module will replace the values in this inner dictionary with >> the imported functions. This way, the functions are imported and >> available when needed. >> """ >> >> for entry in entries: >> module, name = entries[entry] >> _temp = __import__(module, globals(), locals(), [name], 0) >> entries[entry] = getattr(_temp, entry) >> >> >> def run(backend="mock"): >> print "Running, backend: ", backend >> import_entry_points(entry_points[backend]) >> >> import pprint >> pprint.pprint(entry_points) >> >> print "THUMPING..." >> entry_points[backend]["thump"]() >> >> print "EATING..." >> entry_points[backend]["eat"]() >> >> print "CHEWING..." >> # Chew five times >> entry_points[backend]["chew"](5) >> >> if __name__ == "__main__": >> parser = OptionParser() >> parser.add_option("-b", "--backend", dest="backend", >> default="mock", >> help="Choose which backend to run.") >> >> (options, args) = parser.parse_args() >> run(options.backend) >> >> >> >> Now, as you can see, the backends are loaded dynamically depending upon the command line options (let's only import what we need). >> >> prompt> python runner.py >> Running, backend: mock >> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >> 'eat': ('myns.mypkg.mymodule', 'eat'), >> 'thump': ('myns.mypkg.mymodule', 'thump')}, >> 'fruit': {'chew': ('fruit', 'chew'), >> 'eat': ('fruit', 'eat'), >> 'thump': ('fruit', 'thump')}, >> 'meat': {'chew': ('meat', 'chew'), >> 'eat': ('meat', 'eat'), >> 'thump': ('meat', 'thump')}, >> 'mock': {'chew': , >> 'eat': , >> 'thump': }} >> THUMPING... >> Pretend to thump >> EATING... >> Pretend to eat >> CHEWING... >> Prentend to chew >> >> >> And, totally new/different backend if I choose the option: >> >> >> Running, backend: fruit >> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >> 'eat': ('myns.mypkg.mymodule', 'eat'), >> 'thump': ('myns.mypkg.mymodule', 'thump')}, >> 'fruit': {'chew': , >> 'eat': , >> 'thump': }, >> 'meat': {'chew': ('meat', 'chew'), >> 'eat': ('meat', 'eat'), >> 'thump': ('meat', 'thump')}, >> 'mock': {'chew': ('mock', 'chew'), >> 'eat': ('mock', 'eat'), >> 'thump': ('mock', 'thump')}} >> THUMPING... >> Thumping fruit... >> EATING... >> Eating fruit.. very healthy.... >> CHEWING... >> Fruit chew 0 >> Fruit chew 1 >> Fruit chew 2 >> Fruit chew 3 >> Fruit chew 4 >> >> >> >> Here are examples of my backends: >> >> >> >> >> """An empty mock (Currently not implemented)""" >> >> >> def thump(): >> >> print "Pretend to thump" >> >> >> def eat(): >> >> print "Pretend to eat" >> >> >> def chew(number_of_times): >> >> print "Prentend to chew" >> >> >> >> >> Here's the mock one (by default): >> >> >> def thump(): >> >> print "Pretend to thump" >> >> >> def eat(): >> >> print "Pretend to eat" >> >> >> def chew(number_of_times): >> >> print "Prentend to chew" >> >> >> >> >> >> So, I'm supposed to be using entry points from the setuptools library (instead of the above). But, I've googled and get stuck. I just don't see how to use it (and use it without doing a setup each time).: >> >> http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 >> >> Can someone help me by example? I'm confused... >> >> >> Cheers, >> >> >> Glen >> -- >> "Pursue, keep up with, circle round and round your life as a dog does his master's chase. Do what you love. Know your own bone; gnaw at it, bury it, unearth it, and gnaw it still." >> >> --Henry David Thoreau >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From shakefu at gmail.com Wed Feb 13 03:41:37 2013 From: shakefu at gmail.com (Jake Alheid) Date: Tue, 12 Feb 2013 18:41:37 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: References: Message-ID: If you want 3rd parties to be able to register runners, then entry points is a good way to go. However, since your example looks like you have control over all the files, you might want to look at runpy ( http://docs.python.org/2/library/runpy.html#runpy.run_module) to import your runner's module dictionary, which can then be called. Something like: def get_runner(name): return runpy.run_module('baypiggies.' + name) get_runner('fruit')['chew']() The documentation is really terrible for setuptools... I can't remember what I originally read that helped me grok what was going. If you really want to use entry points for this, you want to define it in your setup.py, and do something like: entry_points = { 'baypiggies':[ 'fruit = baypiggies.fruit', 'meta = baypiggies.meat', 'mock = baypiggies.mock', ], }, This just registers those namespaces (modules in this case) with setuptools/pkg_resources for later consumption. You consume using iter_entry_points: def get_runner_module(name): """ Return a module for `name`. """ # This looks for the first entry point with `name` in the 'baypiggies' for entry in pkg_resources.iter_entry_points('baypiggies', name): # Return the loaded module or object, or raise ImportError return entry.load() If you don't want the module in sys.modules, use runpy instead, and replace the last line with: # Return the module's namespace dictionary return runpy.run_module(entry.module_name) Of course, using entry_points will also allow third party packages to register with your runner using the 'baypiggies' entry point. You could allow for that, and get a list of all registered names, like: def get_registered_names(): names = [] for entry in pkg_resources.iter_entry_points('baypiggies'): names.append(entry.name) return names Hope this helps! -- Jake Alheid http://about.me/jake On Tue, Feb 12, 2013 at 5:00 PM, Glen Jarvis wrote: > I have a directory like this: > > baypiggies > - __init__.py > - fruit.py > - meat.py > - mock.py > - runner.py > > My runner.py is the main entry point and it is used to dynamically chose > which of these other files to import. > > # pylint: disable=C0103,R0904 > > """A sample dynamically loaded example with endpoints > > ./runner.py --backend=fruit > """ > > from optparse import OptionParser > > > entry_points = { > 'fruit': dict( > thump = ('fruit', 'thump'), > eat = ('fruit', 'eat'), > chew = ('fruit', 'chew'), > ), > 'meat': dict( > thump = ('meat', 'thump'), > eat = ('meat', 'eat'), > chew = ('meat', 'chew'), > ), > 'mock': dict( > thump = ('mock', 'thump'), > eat = ('mock', 'eat'), > chew = ('mock', 'chew'), > ), > 'custom1': dict( > thump = ('myns.mypkg.mymodule', 'thump'), > eat = ('myns.mypkg.mymodule', 'eat'), > chew = ('myns.mypkg.mymodule', 'chew'), > ), > } > > def import_entry_points(entries): > > """Dynamically import the functions for the specified backend > > entry_points is a global dictionary whos keys correspond to each > of the different types of backends that we can support. The variable > options.backend specifies which of the backends that will be used > during this program run. > > The value of entry_points (for options.backend) is another > dictionary which map the functions needed to the modules from where > we will import these modules. We only want to import the backend > modules that will be used (and not have unnecessary dependencies). > > This module will replace the values in this inner dictionary with > the imported functions. This way, the functions are imported and > available when needed. > """ > > for entry in entries: > module, name = entries[entry] > _temp = __import__(module, globals(), locals(), [name], 0) > entries[entry] = getattr(_temp, entry) > > > def run(backend="mock"): > print "Running, backend: ", backend > import_entry_points(entry_points[backend]) > > import pprint > pprint.pprint(entry_points) > > print "THUMPING..." > entry_points[backend]["thump"]() > > print "EATING..." > entry_points[backend]["eat"]() > > print "CHEWING..." > # Chew five times > entry_points[backend]["chew"](5) > > if __name__ == "__main__": > parser = OptionParser() > parser.add_option("-b", "--backend", dest="backend", > default="mock", > help="Choose which backend to run.") > > (options, args) = parser.parse_args() > run(options.backend) > > > > Now, as you can see, the backends are loaded dynamically depending upon > the command line options (let's only import what we need). > > prompt> python runner.py > Running, backend: mock > {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), > 'eat': ('myns.mypkg.mymodule', 'eat'), > 'thump': ('myns.mypkg.mymodule', 'thump')}, > 'fruit': {'chew': ('fruit', 'chew'), > 'eat': ('fruit', 'eat'), > 'thump': ('fruit', 'thump')}, > 'meat': {'chew': ('meat', 'chew'), > 'eat': ('meat', 'eat'), > 'thump': ('meat', 'thump')}, > 'mock': {'chew': , > 'eat': , > 'thump': }} > THUMPING... > Pretend to thump > EATING... > Pretend to eat > CHEWING... > Prentend to chew > > > And, totally new/different backend if I choose the option: > > > Running, backend: fruit > {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), > 'eat': ('myns.mypkg.mymodule', 'eat'), > 'thump': ('myns.mypkg.mymodule', 'thump')}, > 'fruit': {'chew': , > 'eat': , > 'thump': }, > 'meat': {'chew': ('meat', 'chew'), > 'eat': ('meat', 'eat'), > 'thump': ('meat', 'thump')}, > 'mock': {'chew': ('mock', 'chew'), > 'eat': ('mock', 'eat'), > 'thump': ('mock', 'thump')}} > THUMPING... > Thumping fruit... > EATING... > Eating fruit.. very healthy.... > CHEWING... > Fruit chew 0 > Fruit chew 1 > Fruit chew 2 > Fruit chew 3 > Fruit chew 4 > > > > Here are examples of my backends: > > > > > """An empty mock (Currently not implemented)""" > > > def thump(): > > print "Pretend to thump" > > > def eat(): > > print "Pretend to eat" > > > def chew(number_of_times): > > print "Prentend to chew" > > > > > Here's the mock one (by default): > > > def thump(): > > print "Pretend to thump" > > > def eat(): > > print "Pretend to eat" > > > def chew(number_of_times): > > print "Prentend to chew" > > > > > > So, I'm supposed to be using entry points from the setuptools library > (instead of the above). But, I've googled and get stuck. I just don't see > how to use it (and use it without doing a setup each time).: > > > http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 > > Can someone help me by example? I'm confused... > > > Cheers, > > > Glen > -- > > "Pursue, keep up with, circle round and round your life as a dog does his > master's chase. Do what you love. Know your own bone; gnaw at it, bury it, > unearth it, and gnaw it still." > > --Henry David Thoreau > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 13 03:47:56 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 12 Feb 2013 18:47:56 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: References: Message-ID: <42AC267A-3B2F-4002-A232-8BF1F6CD5559@glenjarvis.com> I'm still reading this and need to play with your examples. But, I think this is EXACTLY what I needed. Thank you!!!! G On Feb 12, 2013, at 6:41 PM, Jake Alheid wrote: > If you want 3rd parties to be able to register runners, then entry points is a good way to go. However, since your example looks like you have control over all the files, you might want to look at runpy (http://docs.python.org/2/library/runpy.html#runpy.run_module) to import your runner's module dictionary, which can then be called. Something like: > > def get_runner(name): > return runpy.run_module('baypiggies.' + name) > > get_runner('fruit')['chew']() > > The documentation is really terrible for setuptools... I can't remember what I originally read that helped me grok what was going. > > If you really want to use entry points for this, you want to define it in your setup.py, and do something like: > > entry_points = { > 'baypiggies':[ > 'fruit = baypiggies.fruit', > 'meta = baypiggies.meat', > 'mock = baypiggies.mock', > ], > }, > > This just registers those namespaces (modules in this case) with setuptools/pkg_resources for later consumption. You consume using iter_entry_points: > > def get_runner_module(name): > """ Return a module for `name`. """ > # This looks for the first entry point with `name` in the 'baypiggies' > for entry in pkg_resources.iter_entry_points('baypiggies', name): > # Return the loaded module or object, or raise ImportError > return entry.load() > > If you don't want the module in sys.modules, use runpy instead, and replace the last line with: > > # Return the module's namespace dictionary > return runpy.run_module(entry.module_name) > > Of course, using entry_points will also allow third party packages to register with your runner using the 'baypiggies' entry point. You could allow for that, and get a list of all registered names, like: > > def get_registered_names(): > names = [] > for entry in pkg_resources.iter_entry_points('baypiggies'): > names.append(entry.name) > return names > > Hope this helps! > -- > Jake Alheid > http://about.me/jake > > > On Tue, Feb 12, 2013 at 5:00 PM, Glen Jarvis wrote: >> I have a directory like this: >> >> baypiggies >> - __init__.py >> - fruit.py >> - meat.py >> - mock.py >> - runner.py >> >> My runner.py is the main entry point and it is used to dynamically chose which of these other files to import. >> >> # pylint: disable=C0103,R0904 >> >> """A sample dynamically loaded example with endpoints >> >> ./runner.py --backend=fruit >> """ >> >> from optparse import OptionParser >> >> >> entry_points = { >> 'fruit': dict( >> thump = ('fruit', 'thump'), >> eat = ('fruit', 'eat'), >> chew = ('fruit', 'chew'), >> ), >> 'meat': dict( >> thump = ('meat', 'thump'), >> eat = ('meat', 'eat'), >> chew = ('meat', 'chew'), >> ), >> 'mock': dict( >> thump = ('mock', 'thump'), >> eat = ('mock', 'eat'), >> chew = ('mock', 'chew'), >> ), >> 'custom1': dict( >> thump = ('myns.mypkg.mymodule', 'thump'), >> eat = ('myns.mypkg.mymodule', 'eat'), >> chew = ('myns.mypkg.mymodule', 'chew'), >> ), >> } >> >> def import_entry_points(entries): >> >> """Dynamically import the functions for the specified backend >> >> entry_points is a global dictionary whos keys correspond to each >> of the different types of backends that we can support. The variable >> options.backend specifies which of the backends that will be used >> during this program run. >> >> The value of entry_points (for options.backend) is another >> dictionary which map the functions needed to the modules from where >> we will import these modules. We only want to import the backend >> modules that will be used (and not have unnecessary dependencies). >> >> This module will replace the values in this inner dictionary with >> the imported functions. This way, the functions are imported and >> available when needed. >> """ >> >> for entry in entries: >> module, name = entries[entry] >> _temp = __import__(module, globals(), locals(), [name], 0) >> entries[entry] = getattr(_temp, entry) >> >> >> def run(backend="mock"): >> print "Running, backend: ", backend >> import_entry_points(entry_points[backend]) >> >> import pprint >> pprint.pprint(entry_points) >> >> print "THUMPING..." >> entry_points[backend]["thump"]() >> >> print "EATING..." >> entry_points[backend]["eat"]() >> >> print "CHEWING..." >> # Chew five times >> entry_points[backend]["chew"](5) >> >> if __name__ == "__main__": >> parser = OptionParser() >> parser.add_option("-b", "--backend", dest="backend", >> default="mock", >> help="Choose which backend to run.") >> >> (options, args) = parser.parse_args() >> run(options.backend) >> >> >> >> Now, as you can see, the backends are loaded dynamically depending upon the command line options (let's only import what we need). >> >> prompt> python runner.py >> Running, backend: mock >> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >> 'eat': ('myns.mypkg.mymodule', 'eat'), >> 'thump': ('myns.mypkg.mymodule', 'thump')}, >> 'fruit': {'chew': ('fruit', 'chew'), >> 'eat': ('fruit', 'eat'), >> 'thump': ('fruit', 'thump')}, >> 'meat': {'chew': ('meat', 'chew'), >> 'eat': ('meat', 'eat'), >> 'thump': ('meat', 'thump')}, >> 'mock': {'chew': , >> 'eat': , >> 'thump': }} >> THUMPING... >> Pretend to thump >> EATING... >> Pretend to eat >> CHEWING... >> Prentend to chew >> >> >> And, totally new/different backend if I choose the option: >> >> >> Running, backend: fruit >> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >> 'eat': ('myns.mypkg.mymodule', 'eat'), >> 'thump': ('myns.mypkg.mymodule', 'thump')}, >> 'fruit': {'chew': , >> 'eat': , >> 'thump': }, >> 'meat': {'chew': ('meat', 'chew'), >> 'eat': ('meat', 'eat'), >> 'thump': ('meat', 'thump')}, >> 'mock': {'chew': ('mock', 'chew'), >> 'eat': ('mock', 'eat'), >> 'thump': ('mock', 'thump')}} >> THUMPING... >> Thumping fruit... >> EATING... >> Eating fruit.. very healthy.... >> CHEWING... >> Fruit chew 0 >> Fruit chew 1 >> Fruit chew 2 >> Fruit chew 3 >> Fruit chew 4 >> >> >> >> Here are examples of my backends: >> >> >> >> >> """An empty mock (Currently not implemented)""" >> >> >> def thump(): >> >> print "Pretend to thump" >> >> >> def eat(): >> >> print "Pretend to eat" >> >> >> def chew(number_of_times): >> >> print "Prentend to chew" >> >> >> >> >> Here's the mock one (by default): >> >> >> def thump(): >> >> print "Pretend to thump" >> >> >> def eat(): >> >> print "Pretend to eat" >> >> >> def chew(number_of_times): >> >> print "Prentend to chew" >> >> >> >> >> >> So, I'm supposed to be using entry points from the setuptools library (instead of the above). But, I've googled and get stuck. I just don't see how to use it (and use it without doing a setup each time).: >> >> http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 >> >> Can someone help me by example? I'm confused... >> >> >> Cheers, >> >> >> Glen >> -- >> "Pursue, keep up with, circle round and round your life as a dog does his master's chase. Do what you love. Know your own bone; gnaw at it, bury it, unearth it, and gnaw it still." >> >> --Henry David Thoreau >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shakefu at gmail.com Wed Feb 13 03:49:57 2013 From: shakefu at gmail.com (Jake Alheid) Date: Tue, 12 Feb 2013 18:49:57 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: <42AC267A-3B2F-4002-A232-8BF1F6CD5559@glenjarvis.com> References: <42AC267A-3B2F-4002-A232-8BF1F6CD5559@glenjarvis.com> Message-ID: Ooh, I found some of the elusive documentation: http://pythonhosted.org/distribute/pkg_resources.html?highlight=iter_entry_points#convenience-api Good luck! -- Jake Alheid http://about.me/jake On Tue, Feb 12, 2013 at 6:47 PM, Glen Jarvis wrote: > I'm still reading this and need to play with your examples. But, I think > this is EXACTLY what I needed. > > Thank you!!!! > > G > > On Feb 12, 2013, at 6:41 PM, Jake Alheid wrote: > > If you want 3rd parties to be able to register runners, then entry points > is a good way to go. However, since your example looks like you have > control over all the files, you might want to look at runpy ( > http://docs.python.org/2/library/runpy.html#runpy.run_module) to import > your runner's module dictionary, which can then be called. Something like: > > def get_runner(name): > return runpy.run_module('baypiggies.' + name) > > get_runner('fruit')['chew']() > > The documentation is really terrible for setuptools... I can't remember > what I originally read that helped me grok what was going. > > If you really want to use entry points for this, you want to define it in > your setup.py, and do something like: > > entry_points = { > 'baypiggies':[ > 'fruit = baypiggies.fruit', > 'meta = baypiggies.meat', > 'mock = baypiggies.mock', > ], > }, > > This just registers those namespaces (modules in this case) with > setuptools/pkg_resources for later consumption. You consume using > iter_entry_points: > > def get_runner_module(name): > """ Return a module for `name`. """ > # This looks for the first entry point with `name` in the 'baypiggies' > for entry in pkg_resources.iter_entry_points('baypiggies', name): > # Return the loaded module or object, or raise ImportError > return entry.load() > > If you don't want the module in sys.modules, use runpy instead, and > replace the last line with: > > # Return the module's namespace dictionary > return runpy.run_module(entry.module_name) > > Of course, using entry_points will also allow third party packages to > register with your runner using the 'baypiggies' entry point. You could > allow for that, and get a list of all registered names, like: > > def get_registered_names(): > names = [] > for entry in pkg_resources.iter_entry_points('baypiggies'): > names.append(entry.name) > return names > > Hope this helps! > -- > Jake Alheid > http://about.me/jake > > > On Tue, Feb 12, 2013 at 5:00 PM, Glen Jarvis wrote: > >> I have a directory like this: >> >> baypiggies >> - __init__.py >> - fruit.py >> - meat.py >> - mock.py >> - runner.py >> >> My runner.py is the main entry point and it is used to dynamically chose >> which of these other files to import. >> >> # pylint: disable=C0103,R0904 >> >> """A sample dynamically loaded example with endpoints >> >> ./runner.py --backend=fruit >> """ >> >> from optparse import OptionParser >> >> >> entry_points = { >> 'fruit': dict( >> thump = ('fruit', 'thump'), >> eat = ('fruit', 'eat'), >> chew = ('fruit', 'chew'), >> ), >> 'meat': dict( >> thump = ('meat', 'thump'), >> eat = ('meat', 'eat'), >> chew = ('meat', 'chew'), >> ), >> 'mock': dict( >> thump = ('mock', 'thump'), >> eat = ('mock', 'eat'), >> chew = ('mock', 'chew'), >> ), >> 'custom1': dict( >> thump = ('myns.mypkg.mymodule', 'thump'), >> eat = ('myns.mypkg.mymodule', 'eat'), >> chew = ('myns.mypkg.mymodule', 'chew'), >> ), >> } >> >> def import_entry_points(entries): >> >> """Dynamically import the functions for the specified backend >> >> entry_points is a global dictionary whos keys correspond to each >> of the different types of backends that we can support. The variable >> options.backend specifies which of the backends that will be used >> during this program run. >> >> The value of entry_points (for options.backend) is another >> dictionary which map the functions needed to the modules from where >> we will import these modules. We only want to import the backend >> modules that will be used (and not have unnecessary dependencies). >> >> This module will replace the values in this inner dictionary with >> the imported functions. This way, the functions are imported and >> available when needed. >> """ >> >> for entry in entries: >> module, name = entries[entry] >> _temp = __import__(module, globals(), locals(), [name], 0) >> entries[entry] = getattr(_temp, entry) >> >> >> def run(backend="mock"): >> print "Running, backend: ", backend >> import_entry_points(entry_points[backend]) >> >> import pprint >> pprint.pprint(entry_points) >> >> print "THUMPING..." >> entry_points[backend]["thump"]() >> >> print "EATING..." >> entry_points[backend]["eat"]() >> >> print "CHEWING..." >> # Chew five times >> entry_points[backend]["chew"](5) >> >> if __name__ == "__main__": >> parser = OptionParser() >> parser.add_option("-b", "--backend", dest="backend", >> default="mock", >> help="Choose which backend to run.") >> >> (options, args) = parser.parse_args() >> run(options.backend) >> >> >> >> Now, as you can see, the backends are loaded dynamically depending upon >> the command line options (let's only import what we need). >> >> prompt> python runner.py >> Running, backend: mock >> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >> 'eat': ('myns.mypkg.mymodule', 'eat'), >> 'thump': ('myns.mypkg.mymodule', 'thump')}, >> 'fruit': {'chew': ('fruit', 'chew'), >> 'eat': ('fruit', 'eat'), >> 'thump': ('fruit', 'thump')}, >> 'meat': {'chew': ('meat', 'chew'), >> 'eat': ('meat', 'eat'), >> 'thump': ('meat', 'thump')}, >> 'mock': {'chew': , >> 'eat': , >> 'thump': }} >> THUMPING... >> Pretend to thump >> EATING... >> Pretend to eat >> CHEWING... >> Prentend to chew >> >> >> And, totally new/different backend if I choose the option: >> >> >> Running, backend: fruit >> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >> 'eat': ('myns.mypkg.mymodule', 'eat'), >> 'thump': ('myns.mypkg.mymodule', 'thump')}, >> 'fruit': {'chew': , >> 'eat': , >> 'thump': }, >> 'meat': {'chew': ('meat', 'chew'), >> 'eat': ('meat', 'eat'), >> 'thump': ('meat', 'thump')}, >> 'mock': {'chew': ('mock', 'chew'), >> 'eat': ('mock', 'eat'), >> 'thump': ('mock', 'thump')}} >> THUMPING... >> Thumping fruit... >> EATING... >> Eating fruit.. very healthy.... >> CHEWING... >> Fruit chew 0 >> Fruit chew 1 >> Fruit chew 2 >> Fruit chew 3 >> Fruit chew 4 >> >> >> >> Here are examples of my backends: >> >> >> >> >> """An empty mock (Currently not implemented)""" >> >> >> def thump(): >> >> print "Pretend to thump" >> >> >> def eat(): >> >> print "Pretend to eat" >> >> >> def chew(number_of_times): >> >> print "Prentend to chew" >> >> >> >> >> Here's the mock one (by default): >> >> >> def thump(): >> >> print "Pretend to thump" >> >> >> def eat(): >> >> print "Pretend to eat" >> >> >> def chew(number_of_times): >> >> print "Prentend to chew" >> >> >> >> >> >> So, I'm supposed to be using entry points from the setuptools library >> (instead of the above). But, I've googled and get stuck. I just don't see >> how to use it (and use it without doing a setup each time).: >> >> >> http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 >> >> Can someone help me by example? I'm confused... >> >> >> Cheers, >> >> >> Glen >> -- >> >> "Pursue, keep up with, circle round and round your life as a dog does his >> master's chase. Do what you love. Know your own bone; gnaw at it, bury it, >> unearth it, and gnaw it still." >> >> --Henry David Thoreau >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 13 03:56:01 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 12 Feb 2013 18:56:01 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: References: <42AC267A-3B2F-4002-A232-8BF1F6CD5559@glenjarvis.com> Message-ID: Your example and slides are going to help (I'm on my way home on the bus so not hacking on it for the moment). I'll check out the docs after I look at your slides and example. Again, awesome help :) G On Feb 12, 2013, at 6:49 PM, Jake Alheid wrote: > Ooh, I found some of the elusive documentation: http://pythonhosted.org/distribute/pkg_resources.html?highlight=iter_entry_points#convenience-api > > Good luck! > -- > Jake Alheid > http://about.me/jake > > > On Tue, Feb 12, 2013 at 6:47 PM, Glen Jarvis wrote: >> I'm still reading this and need to play with your examples. But, I think this is EXACTLY what I needed. >> >> Thank you!!!! >> >> G >> >> On Feb 12, 2013, at 6:41 PM, Jake Alheid wrote: >> >>> If you want 3rd parties to be able to register runners, then entry points is a good way to go. However, since your example looks like you have control over all the files, you might want to look at runpy (http://docs.python.org/2/library/runpy.html#runpy.run_module) to import your runner's module dictionary, which can then be called. Something like: >>> >>> def get_runner(name): >>> return runpy.run_module('baypiggies.' + name) >>> >>> get_runner('fruit')['chew']() >>> >>> The documentation is really terrible for setuptools... I can't remember what I originally read that helped me grok what was going. >>> >>> If you really want to use entry points for this, you want to define it in your setup.py, and do something like: >>> >>> entry_points = { >>> 'baypiggies':[ >>> 'fruit = baypiggies.fruit', >>> 'meta = baypiggies.meat', >>> 'mock = baypiggies.mock', >>> ], >>> }, >>> >>> This just registers those namespaces (modules in this case) with setuptools/pkg_resources for later consumption. You consume using iter_entry_points: >>> >>> def get_runner_module(name): >>> """ Return a module for `name`. """ >>> # This looks for the first entry point with `name` in the 'baypiggies' >>> for entry in pkg_resources.iter_entry_points('baypiggies', name): >>> # Return the loaded module or object, or raise ImportError >>> return entry.load() >>> >>> If you don't want the module in sys.modules, use runpy instead, and replace the last line with: >>> >>> # Return the module's namespace dictionary >>> return runpy.run_module(entry.module_name) >>> >>> Of course, using entry_points will also allow third party packages to register with your runner using the 'baypiggies' entry point. You could allow for that, and get a list of all registered names, like: >>> >>> def get_registered_names(): >>> names = [] >>> for entry in pkg_resources.iter_entry_points('baypiggies'): >>> names.append(entry.name) >>> return names >>> >>> Hope this helps! >>> -- >>> Jake Alheid >>> http://about.me/jake >>> >>> >>> On Tue, Feb 12, 2013 at 5:00 PM, Glen Jarvis wrote: >>>> I have a directory like this: >>>> >>>> baypiggies >>>> - __init__.py >>>> - fruit.py >>>> - meat.py >>>> - mock.py >>>> - runner.py >>>> >>>> My runner.py is the main entry point and it is used to dynamically chose which of these other files to import. >>>> >>>> # pylint: disable=C0103,R0904 >>>> >>>> """A sample dynamically loaded example with endpoints >>>> >>>> ./runner.py --backend=fruit >>>> """ >>>> >>>> from optparse import OptionParser >>>> >>>> >>>> entry_points = { >>>> 'fruit': dict( >>>> thump = ('fruit', 'thump'), >>>> eat = ('fruit', 'eat'), >>>> chew = ('fruit', 'chew'), >>>> ), >>>> 'meat': dict( >>>> thump = ('meat', 'thump'), >>>> eat = ('meat', 'eat'), >>>> chew = ('meat', 'chew'), >>>> ), >>>> 'mock': dict( >>>> thump = ('mock', 'thump'), >>>> eat = ('mock', 'eat'), >>>> chew = ('mock', 'chew'), >>>> ), >>>> 'custom1': dict( >>>> thump = ('myns.mypkg.mymodule', 'thump'), >>>> eat = ('myns.mypkg.mymodule', 'eat'), >>>> chew = ('myns.mypkg.mymodule', 'chew'), >>>> ), >>>> } >>>> >>>> def import_entry_points(entries): >>>> >>>> """Dynamically import the functions for the specified backend >>>> >>>> entry_points is a global dictionary whos keys correspond to each >>>> of the different types of backends that we can support. The variable >>>> options.backend specifies which of the backends that will be used >>>> during this program run. >>>> >>>> The value of entry_points (for options.backend) is another >>>> dictionary which map the functions needed to the modules from where >>>> we will import these modules. We only want to import the backend >>>> modules that will be used (and not have unnecessary dependencies). >>>> >>>> This module will replace the values in this inner dictionary with >>>> the imported functions. This way, the functions are imported and >>>> available when needed. >>>> """ >>>> >>>> for entry in entries: >>>> module, name = entries[entry] >>>> _temp = __import__(module, globals(), locals(), [name], 0) >>>> entries[entry] = getattr(_temp, entry) >>>> >>>> >>>> def run(backend="mock"): >>>> print "Running, backend: ", backend >>>> import_entry_points(entry_points[backend]) >>>> >>>> import pprint >>>> pprint.pprint(entry_points) >>>> >>>> print "THUMPING..." >>>> entry_points[backend]["thump"]() >>>> >>>> print "EATING..." >>>> entry_points[backend]["eat"]() >>>> >>>> print "CHEWING..." >>>> # Chew five times >>>> entry_points[backend]["chew"](5) >>>> >>>> if __name__ == "__main__": >>>> parser = OptionParser() >>>> parser.add_option("-b", "--backend", dest="backend", >>>> default="mock", >>>> help="Choose which backend to run.") >>>> >>>> (options, args) = parser.parse_args() >>>> run(options.backend) >>>> >>>> >>>> >>>> Now, as you can see, the backends are loaded dynamically depending upon the command line options (let's only import what we need). >>>> >>>> prompt> python runner.py >>>> Running, backend: mock >>>> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >>>> 'eat': ('myns.mypkg.mymodule', 'eat'), >>>> 'thump': ('myns.mypkg.mymodule', 'thump')}, >>>> 'fruit': {'chew': ('fruit', 'chew'), >>>> 'eat': ('fruit', 'eat'), >>>> 'thump': ('fruit', 'thump')}, >>>> 'meat': {'chew': ('meat', 'chew'), >>>> 'eat': ('meat', 'eat'), >>>> 'thump': ('meat', 'thump')}, >>>> 'mock': {'chew': , >>>> 'eat': , >>>> 'thump': }} >>>> THUMPING... >>>> Pretend to thump >>>> EATING... >>>> Pretend to eat >>>> CHEWING... >>>> Prentend to chew >>>> >>>> >>>> And, totally new/different backend if I choose the option: >>>> >>>> >>>> Running, backend: fruit >>>> {'custom1': {'chew': ('myns.mypkg.mymodule', 'chew'), >>>> 'eat': ('myns.mypkg.mymodule', 'eat'), >>>> 'thump': ('myns.mypkg.mymodule', 'thump')}, >>>> 'fruit': {'chew': , >>>> 'eat': , >>>> 'thump': }, >>>> 'meat': {'chew': ('meat', 'chew'), >>>> 'eat': ('meat', 'eat'), >>>> 'thump': ('meat', 'thump')}, >>>> 'mock': {'chew': ('mock', 'chew'), >>>> 'eat': ('mock', 'eat'), >>>> 'thump': ('mock', 'thump')}} >>>> THUMPING... >>>> Thumping fruit... >>>> EATING... >>>> Eating fruit.. very healthy.... >>>> CHEWING... >>>> Fruit chew 0 >>>> Fruit chew 1 >>>> Fruit chew 2 >>>> Fruit chew 3 >>>> Fruit chew 4 >>>> >>>> >>>> >>>> Here are examples of my backends: >>>> >>>> >>>> >>>> >>>> """An empty mock (Currently not implemented)""" >>>> >>>> >>>> def thump(): >>>> >>>> print "Pretend to thump" >>>> >>>> >>>> def eat(): >>>> >>>> print "Pretend to eat" >>>> >>>> >>>> def chew(number_of_times): >>>> >>>> print "Prentend to chew" >>>> >>>> >>>> >>>> >>>> Here's the mock one (by default): >>>> >>>> >>>> def thump(): >>>> >>>> print "Pretend to thump" >>>> >>>> >>>> def eat(): >>>> >>>> print "Pretend to eat" >>>> >>>> >>>> def chew(number_of_times): >>>> >>>> print "Prentend to chew" >>>> >>>> >>>> >>>> >>>> >>>> So, I'm supposed to be using entry points from the setuptools library (instead of the above). But, I've googled and get stuck. I just don't see how to use it (and use it without doing a setup each time).: >>>> >>>> http://stackoverflow.com/questions/774824/explain-python-entry-points/9615473#9615473 >>>> >>>> Can someone help me by example? I'm confused... >>>> >>>> >>>> Cheers, >>>> >>>> >>>> Glen >>>> -- >>>> "Pursue, keep up with, circle round and round your life as a dog does his master's chase. Do what you love. Know your own bone; gnaw at it, bury it, unearth it, and gnaw it still." >>>> >>>> --Henry David Thoreau >>>> >>>> >>>> _______________________________________________ >>>> Baypiggies mailing list >>>> Baypiggies at python.org >>>> To change your subscription options or unsubscribe: >>>> http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Wed Feb 13 07:39:20 2013 From: aahz at pythoncraft.com (Aahz) Date: Tue, 12 Feb 2013 22:39:20 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: References: Message-ID: <20130213063920.GA13116@panix.com> On Tue, Feb 12, 2013, Glen Jarvis wrote: > > I have a directory like this: > > baypiggies > - __init__.py > - fruit.py > - meat.py > - mock.py > - runner.py > > My runner.py is the main entry point and it is used to dynamically chose > which of these other files to import. > > # pylint: disable=C0103,R0904 > > ./runner.py --backend=fruit Why do you have __init__.py? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Times are bad. Children no longer obey their parents, and everyone is writing a book." --Cicero From glen at glenjarvis.com Wed Feb 13 17:11:24 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Wed, 13 Feb 2013 08:11:24 -0800 Subject: [Baypiggies] Entry points help In-Reply-To: <20130213063920.GA13116@panix.com> References: <20130213063920.GA13116@panix.com> Message-ID: Left over from my project before I converted it into a small demo to illustrate. G On Feb 12, 2013, at 10:39 PM, Aahz wrote: > On Tue, Feb 12, 2013, Glen Jarvis wrote: >> >> I have a directory like this: >> >> baypiggies >> - __init__.py >> - fruit.py >> - meat.py >> - mock.py >> - runner.py >> >> My runner.py is the main entry point and it is used to dynamically chose >> which of these other files to import. >> >> # pylint: disable=C0103,R0904 >> >> ./runner.py --backend=fruit > > Why do you have __init__.py? > -- > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "Times are bad. Children no longer obey their parents, and everyone is > writing a book." --Cicero > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From cappy2112 at gmail.com Wed Feb 13 21:47:12 2013 From: cappy2112 at gmail.com (Tony Cappellini) Date: Wed, 13 Feb 2013 12:47:12 -0800 Subject: [Baypiggies] Thoughts about an early meeting in March to hold practice presentations for Pycon 2013 Message-ID: Pycon 2013 is almost upon us. One person has asked about doing a Pycon presentation practice session at Baypiggies. I'd expect that many presenters would be interested in doing that as well. If we do this in March it would have to be in the second week of March. If everyone is OK with our usual Thursday meeting, I'll inquire about getting the room on March 7th. Please post your thoughts about this -------------- next part -------------- An HTML attachment was scrubbed... URL: From erin.lynn.root at gmail.com Wed Feb 13 22:15:08 2013 From: erin.lynn.root at gmail.com (Lynn Root) Date: Wed, 13 Feb 2013 13:15:08 -0800 Subject: [Baypiggies] Thoughts about an early meeting in March to hold practice presentations for Pycon 2013 In-Reply-To: References: Message-ID: I would also love to practice my talk! Mine is 1/2 hour but I can shorten it/do half if we're limited on time. On Wed, Feb 13, 2013 at 12:47 PM, Tony Cappellini wrote: > > Pycon 2013 is almost upon us. > > One person has asked about doing a Pycon presentation practice session at > Baypiggies. I'd expect that many presenters would be interested > in doing that as well. > > If we do this in March it would have to be in the second week of March. > If everyone is OK with our usual Thursday meeting, I'll inquire about > getting the room on March 7th. > > Please post your thoughts about this > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rupa at codechix.org Wed Feb 13 23:10:23 2013 From: rupa at codechix.org (Rupa Dachere) Date: Wed, 13 Feb 2013 14:10:23 -0800 Subject: [Baypiggies] Thoughts about an early meeting in March to hold practice presentations for Pycon 2013 In-Reply-To: References: Message-ID: Tony, I was the one that asked but I can't commit to that date yet. Work is too spiky. I have 2 practice presentations scheduled. The first one is at CodeChix on 2/27 @6:30p - if anyone wants to attend, register here - codechix.org. I'm looking for a location - somewhere in Palo Alto or Mt. View. The second one is internal to VMware probably the week after the CodeChix one. - Rupa On Wed, Feb 13, 2013 at 12:47 PM, Tony Cappellini wrote: > > Pycon 2013 is almost upon us. > > One person has asked about doing a Pycon presentation practice session at > Baypiggies. I'd expect that many presenters would be interested > in doing that as well. > > If we do this in March it would have to be in the second week of March. > If everyone is OK with our usual Thursday meeting, I'll inquire about > getting the room on March 7th. > > Please post your thoughts about this > > > -- -------- Rupa Dachere codechix.org @codechix www.linkedin.com/codechix www.facebook.com/codechix - "Like" us Donate and help us with our mission of continuous education for female developers! -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Thu Feb 14 04:54:21 2013 From: glen at glenjarvis.com (Glen Jarvis) Date: Wed, 13 Feb 2013 19:54:21 -0800 Subject: [Baypiggies] Thoughts about an early meeting in March to hold practice presentations for Pycon 2013 In-Reply-To: References: Message-ID: I'm confused. Don't we already have a February speaker? Isn't PyCon before our March meeting? This is from memory, so I could be mistaken and just confused... G On Feb 13, 2013, at 12:47 PM, Tony Cappellini wrote: > > Pycon 2013 is almost upon us. > > One person has asked about doing a Pycon presentation practice session at Baypiggies. I'd expect that many presenters would be interested > in doing that as well. > > If we do this in March it would have to be in the second week of March. > If everyone is OK with our usual Thursday meeting, I'll inquire about getting the room on March 7th. > > Please post your thoughts about this > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From cappy2112 at gmail.com Thu Feb 14 05:20:32 2013 From: cappy2112 at gmail.com (Tony Cappellini) Date: Wed, 13 Feb 2013 20:20:32 -0800 Subject: [Baypiggies] Thoughts about an early meeting in March to hold practice presentations for Pycon 2013 In-Reply-To: References: Message-ID: Yes- we do have a speaker for Feb. There is no dispute about this. >From the original post: *"If we do this in March it would have to be in the second week of March. If everyone is OK with our usual Thursday meeting, I'll inquire about getting the room for March 7th." * I've only had two replies so far, so it seems as though there aren't as many people interested in doing practice presentations for Pyon 2013, as I was expecting. On Wed, Feb 13, 2013 at 7:54 PM, Glen Jarvis wrote: > I'm confused. Don't we already have a February speaker? Isn't PyCon before > our March meeting? > > This is from memory, so I could be mistaken and just confused... > > G > > On Feb 13, 2013, at 12:47 PM, Tony Cappellini wrote: > > > > > Pycon 2013 is almost upon us. > > > > One person has asked about doing a Pycon presentation practice session > at Baypiggies. I'd expect that many presenters would be interested > > in doing that as well. > > > > If we do this in March it would have to be in the second week of March. > > If everyone is OK with our usual Thursday meeting, I'll inquire about > getting the room on March 7th. > > > > Please post your thoughts about this > > > > > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msabramo at gmail.com Thu Feb 14 21:57:05 2013 From: msabramo at gmail.com (Marc Abramowitz) Date: Thu, 14 Feb 2013 12:57:05 -0800 Subject: [Baypiggies] Date/location for Salt talk? Message-ID: Was a date and location ever determined for the possible Salt talk from Thomas Hatch ? If it's still a possibility and a location is needed, I can ask around at my work (SurveyMonkey in Palo Alto) to see if they'd be willing to host. -Marc http://marc-abramowitz.com Sent from my iPhone 4S From tony at tcapp.com Fri Feb 15 04:13:24 2013 From: tony at tcapp.com (Tony Cappellini) Date: Thu, 14 Feb 2013 19:13:24 -0800 Subject: [Baypiggies] Date/location for Salt talk? In-Reply-To: References: Message-ID: No- we couldn't coordinate a date with the presenter. Thanks for the offer. On Thu, Feb 14, 2013 at 12:57 PM, Marc Abramowitz wrote: > Was a date and location ever determined for the possible Salt talk from > Thomas Hatch ? > > If it's still a possibility and a location is needed, I can ask around at > my work (SurveyMonkey in Palo Alto) to see if they'd be willing to host. > > -Marc > http://marc-abramowitz.com > Sent from my iPhone 4S > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Thu Feb 21 18:24:13 2013 From: cappy2112 at gmail.com (Tony Cappellini) Date: Thu, 21 Feb 2013 09:24:13 -0800 Subject: [Baypiggies] DARPA Funds Python Big Data Effort Message-ID: http://www.informationweek.co.uk/government/information-management/darpa-funds-python-big-data-effort/240147993 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Sun Feb 24 04:21:26 2013 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sat, 23 Feb 2013 19:21:26 -0800 Subject: [Baypiggies] More thoughts on the March Baypiggies meeting Message-ID: Since the response to a pre-Pycon practice session at an early Baypiggies meeting in March was so poor, why don't we do our usual post-Pycon wrap-up for the March Baypiggies meeting? Pycon is March 13-17. The March Baypiggies meeting will be on March 28th. Presenter will have plenty of time to get their thoughts in order. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rami.chowdhury at gmail.com Sun Feb 24 12:16:27 2013 From: rami.chowdhury at gmail.com (Rami Chowdhury) Date: Sun, 24 Feb 2013 17:16:27 +0600 Subject: [Baypiggies] More thoughts on the March Baypiggies meeting In-Reply-To: References: Message-ID: Don't forget the PyCon sprints after the main conference, 17th-21st! On Sun, Feb 24, 2013 at 9:21 AM, Tony Cappellini wrote: > > > Since the response to a pre-Pycon practice session at an early Baypiggies > meeting in March > was so poor, why don't we do our usual post-Pycon wrap-up for the March > Baypiggies meeting? > > Pycon is March 13-17. > > The March Baypiggies meeting will be on March 28th. > Presenter will have plenty of time to get their thoughts in order. > > > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Rami Chowdhury "A mind all logic is like a knife all blade - it makes the hand bleed that uses it." -- Rabindranath Tagore +44-7581-430-517 / +1-408-597-7068 / +88-01771-064063 -------------- next part -------------- An HTML attachment was scrubbed... URL: From swojtkowski at odesk.com Sun Feb 24 17:12:49 2013 From: swojtkowski at odesk.com (Susan Wojtkowski) Date: Sun, 24 Feb 2013 10:12:49 -0600 Subject: [Baypiggies] Python Developer - IMMEDIATE NEED! Message-ID: Our team is seeking a talented Python developer with Project Management skills and experience. The role would be split between our client site in Mountain View, CA, our office in Redwood City and the contractor?s home office. This long-term contract role is open to those with authorization to work in the US Excellent English communication skills are required. *Requirements:* Solid and demonstrable Java and Python knowledge Strong, demonstrable expertise with AWS, Google App Engine, etc. Experience with JUnit, Maven, continuous integration, or equivalent Able to effectively communicate in English Able to read\write design documents in English Email me at: swojtkowski at odesk.com with your resume (I am not a 3rd party recruiter- I work directly for the hiring company) Tell us about your level of expertise in Python. Give us examples of what you have done with it, what obstacles you encountered and how you overcame them. IMMEDIATE NEED! . -- Best regards, Susan Wojtkowski *oDesk* | Love the way you work. 650-206-2666 | www.odesk.com Skype: odesksusan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jobs at python.org Sun Feb 24 22:11:56 2013 From: jobs at python.org (jobs at python.org) Date: Sun, 24 Feb 2013 13:11:56 -0800 Subject: [Baypiggies] Python Developer - IMMEDIATE NEED! In-Reply-To: References: Message-ID: <20130224211155.GA4735@panix.com> On Sun, Feb 24, 2013, Susan Wojtkowski wrote: > > Our team is seeking a talented Python developer with Project Management > skills and experience. The role would be split between our client site in > Mountain View, CA, our office in Redwood City and the contractor?s home > office. Please use our template and make clear the proportion of Python time expected in this position (we only post jobs that are primarily Python): http://www.python.org/community/jobs/howto/ -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Times are bad. Children no longer obey their parents, and everyone is writing a book." --Cicero From aahz at pythoncraft.com Sun Feb 24 22:13:12 2013 From: aahz at pythoncraft.com (Aahz) Date: Sun, 24 Feb 2013 13:13:12 -0800 Subject: [Baypiggies] Python Developer - IMMEDIATE NEED! In-Reply-To: <20130224211155.GA4735@panix.com> References: <20130224211155.GA4735@panix.com> Message-ID: <20130224211312.GA8725@panix.com> On Sun, Feb 24, 2013, jobs at python.org wrote: > On Sun, Feb 24, 2013, Susan Wojtkowski wrote: >> >> Our team is seeking a talented Python developer with Project Management >> skills and experience. The role would be split between our client site in >> Mountain View, CA, our office in Redwood City and the contractor?s home >> office. > > Please use our template and make clear the proportion of Python time > expected in this position (we only post jobs that are primarily Python): > > http://www.python.org/community/jobs/howto/ Whoops! That'll teach me to pay more attention to which list things are going to.... Sorry about that. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Times are bad. Children no longer obey their parents, and everyone is writing a book." --Cicero From cappy2112 at gmail.com Mon Feb 25 00:36:36 2013 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 24 Feb 2013 15:36:36 -0800 Subject: [Baypiggies] Need help installing pip and other Python packages on Debian Wheezy Message-ID: I'm trying to install pip on a Raspberry Pi. I don't want to install anything that requires any version of Python other than 2.7. What is the best way to get apt-get to install pip with a version compatible with 2.7, and ignore any packages that require Python versions than 2.7? The linux dist that is typically used for the Raspberry Pi is Debian Wheezy. which comes with python 2.7.3. After typing sudo apt-get install python-pip, the following is displayed sudo apt-get install python-pip Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: icelib Use 'apt-get autoremove' to remove it. The following extra packages will be installed: python-pkg-resources python-setuptools python2.6 python2.6-minimal Suggested packages: python-distribute python-distribute-doc python2.6-doc binfmt-support Recommended packages: python-dev-all The following NEW packages will be installed: python-pip python-pkg-resources python-setuptools python2.6 python2.6-minimal 0 upgraded, 5 newly installed, 0 to remove and 8 not upgraded. Need to get 4,475 kB of archives. After this operation, 14.5 MB of additional disk space will be used. Do you want to continue [Y/n]? n -------------- next part -------------- An HTML attachment was scrubbed... URL: From mvoorhie at yahoo.com Mon Feb 25 00:59:58 2013 From: mvoorhie at yahoo.com (Mark Voorhies) Date: Sun, 24 Feb 2013 15:59:58 -0800 Subject: [Baypiggies] Need help installing pip and other Python packages on Debian Wheezy In-Reply-To: References: Message-ID: <512AA97E.6080703@yahoo.com> python-pip in wheezy and sid depends on python-all, which depends on both python2.6 and python2.7, so I think any apt-based install vs. the official repositories will pull in both. The python ecosystem in Debian is a pretty complex symlink farm, so I wouldn't try to hack it directly. For things like the scientific python stack on Debian/Ubuntu, I install from upstream source to ~/.local/ via the --user flag to setup.py -- is this an option with pip? --Mark http://packages.debian.org/wheezy/python-pip http://packages.debian.org/source/sid/python-pip On 02/24/2013 03:36 PM, Tony Cappellini wrote: > I'm trying to install pip on a Raspberry Pi. > I don't want to install anything that requires any version of Python other > than 2.7. > What is the best way to get apt-get to install pip with a version > compatible with 2.7, and ignore > any packages that require Python versions than 2.7? > > The linux dist that is typically used for the Raspberry Pi is Debian > Wheezy. which comes with python 2.7.3. > After typing > > sudo apt-get install python-pip, > > the following is displayed > > > sudo apt-get install python-pip > Reading package lists... Done > Building dependency tree > Reading state information... Done > The following package was automatically installed and is no longer required: > icelib > Use 'apt-get autoremove' to remove it. > The following extra packages will be installed: > python-pkg-resources python-setuptools python2.6 python2.6-minimal > Suggested packages: > python-distribute python-distribute-doc python2.6-doc binfmt-support > > Recommended packages: > python-dev-all > The following NEW packages will be installed: > python-pip python-pkg-resources python-setuptools python2.6 > python2.6-minimal > 0 upgraded, 5 newly installed, 0 to remove and 8 not upgraded. > Need to get 4,475 kB of archives. > After this operation, 14.5 MB of additional disk space will be used. > Do you want to continue [Y/n]? n > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From jjinux at gmail.com Tue Feb 26 00:32:54 2013 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Mon, 25 Feb 2013 15:32:54 -0800 Subject: [Baypiggies] New graduate looking for a Python job Message-ID: Hey guys, I have a buddy named Jeff Stewart who just graduated from St. Mary's College of California, which is where I'm from. He's fresh out of school and looking for his first programming job. He knows Python, Java, C++, etc. Here's his resume ( https://docs.google.com/file/d/0B9S076kfs_EnNW1KQnhfUkN1ZFk/edit?usp=sharing). I've code reviewed his code; he's smart, careful, and hard working. Best Regards, -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa -------------- next part -------------- An HTML attachment was scrubbed... URL: From welch at quietplease.com Wed Feb 27 00:46:13 2013 From: welch at quietplease.com (will welch) Date: Tue, 26 Feb 2013 15:46:13 -0800 Subject: [Baypiggies] Analytics Roles at Riverbed Message-ID: Howdy BayPIGgies -- We're assembling a product analytics group at Riverbed and have a couple of openings in San Francisco. Our task is to archive, analyze, and report on what happens to our appliances after customers deploy them -- how they are used, how they fail, how they could be made better. The services we build are used by a variety of groups within the company. Most of this development is done in Python. One role is for a general swiss-army-knife sort of programmer. You'd build web applications using, eg, Node.js and Bootstrap; plumb data streams with Kafka and RabbitMQ; ETL into elasticsearch and MySQL; and stage out to Hadoop or Drill. You don't need to know those technologies to get hired, just convince us you are not afraid. The other position is for an analytics architect. If you can tell me why I chose the buzzwords above, and what I should've specified instead for managing and mining data streams from thousands of network appliances around the globe, you are hired. The platform is in the design/specification phase, so you'll be there from the beginning and not lamenting someone else's choices. Riverbed is a pretty swell company. We just got named #3 best place to work (behind Facebook and McKinsey consulting) in Glassdoor's satisfaction survey. The Analytics group is small, nimble, and operates across many boundaries within the company to get its job done. These jobs have official company links with a more starched presentation: Senior Software Engineer - Analytics Lead Software Engineer - Analytics I'm in the analytics group, so feel free to pelt me with questions or go straight for the interview forms at those links. -- Will Welch -------------- next part -------------- An HTML attachment was scrubbed... URL: From itz at buug.org Wed Feb 27 05:07:55 2013 From: itz at buug.org (Ian Zimmerman) Date: Tue, 26 Feb 2013 20:07:55 -0800 Subject: [Baypiggies] Need help installing pip and other Python packages on Debian Wheezy In-Reply-To: References: Message-ID: <20130226200755.59b37163.itz@buug.org> On Sun, 24 Feb 2013 15:36:36 -0800 Tony Cappellini wrote: Tony> I'm trying to install pip on a Raspberry Pi. I don't want to Tony> install anything that requires any version of Python other than Tony> 2.7. What is the best way to get apt-get to install pip with a Tony> version compatible with 2.7, and ignore any packages that require Tony> Python versions than 2.7? http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679196 No action on this bug, so what you're asking is probably impossible just using official Debian packages. Mark's suggestion looks like it should work. -- Please *no* private copies of mailing list or newsgroup messages. gpg public key: 1024D/C6FF61AD fingerprint: 66DC D68F 5C1B 4D71 2EE5 BD03 8A00 786C C6FF 61AD http://www.gravatar.com/avatar/c66875cda51109f76c6312f4d4743d1e.png From cappy2112 at gmail.com Thu Feb 28 20:05:51 2013 From: cappy2112 at gmail.com (Tony Cappellini) Date: Thu, 28 Feb 2013 11:05:51 -0800 Subject: [Baypiggies] Baypiggies meeting tonight @ 7:30PM. The topic for the presentation is "How to speedup a Python program 114, 000 times" Message-ID: Hello Everyone, David Schachter will be doing a presentation on "How to speedup a Python program 114,000 times" tonight at 7:40PM, after the usual announcements. The Baypiggies meetings are held at Symantec Coportation Vcafe 350 Ellis Street, Mountain View, CA. 94043 http://www.baypiggies.net/ I'm looking forward to seeing you at the meeting tonight! -------------- next part -------------- An HTML attachment was scrubbed... URL: