The Python 

Library Ecosystem



(Libraries I like)


-Davis Silverman

WEB scraping


  • LXML - Simple XML Parsing
  • Requests - HTTP For Humans
  • Beautiful Soup - Dead simple HTML Parsing
>>> import requests 
>>> from bs4 import BeautifulSoup as BS
>>>
>>> result = requests.get("http://oreilly.com/store/samplers.html")
>>> assert result.status_code == 200, "request did not pan out!"
>>>
>>> soup = BS(result.content) 
>>>
>>> samples = soup.find_all("a", "item-title")
>>> samples[0].contents[0] u'\nBuilding Web Apps with Ember.js\n' >>> >>> print("rejoice!")

web apps

  • Flask - Just what you need

( In fact, anything by www.pocoo.org )
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run() 

GUI


  • WxPython - Project Phoenix for 3.x!
  • PyQT / PySide - beautiful, cross-platform
  • ENAML - Declarative GUIs

CLI

  • Urwid - CLI GUIs
  • Click - Less Magic, still beautiful!
  • Docopt - Magic

Naval Fate.

Usage:
  naval_fate.py ship new ...
  naval_fate.py ship  move   [--speed=]
  naval_fate.py ship shoot  
  naval_fate.py mine (set|remove)   [--moored|--drifting]
  naval_fate.py -h | --help
  naval_fate.py --version

Options:
  -h --help     Show this screen.
  --version     Show version.
  --speed=  Speed in knots [default: 10].
  --moored      Moored (anchored) mine.
  --drifting    Drifting mine.

Images


  • PILLOW - Alex Clark!

from PIL import Image

im = Image.open("animation.gif")
im.seek(1) # skip to the second frame

try:
    i = 1
    while 1:
        im.seek(im.tell()+1)
        im.save(str(i), "GIF")
        i += 1
except EOFError:
    pass # end of sequence
 

SCIENCE & MATH


  • NLTK
  • SCIKIT-LEARN
  • --------------
  • SCIPY
  • NUMPY
  • SYMPY
  • Matplotlib
  • Pandas

Special Mention: IPython! 

Environments


  • Jython - Python in Java
  • IronPython - .Net Python
  • PyPy - Python in Python! ¯\_(ツ)_/¯
  • Brython - Python in the Browser?!? (JavaScript)
  • Berp - HASKELL

THE SURFACE


WE ARE STILL THERE

THERE IS SO MUCH HAPPENING

LEARN

CREATE

BE AWESOME

CODE

The PYthon LIBRARY Ecosystem

By Davis Silverman

The PYthon LIBRARY Ecosystem

  • 1,510