Six Python Libraries Every Programmer Will Love
This article introduces six versatile Python libraries—Pyglet, Peewee, Bottle, Invoke, Splinter, and Arrow—that help developers quickly solve common tasks, from multimedia handling and database access to web APIs, automation, and date‑time processing, while remaining robust for larger projects.
When programming, small setbacks can be as painful as big problems, and developers appreciate solutions that are both quick to implement and robust for long‑term use. The following six Python libraries address immediate challenges and serve as solid foundations for larger projects.
Pyglet
What it is: Pyglet is a pure‑Python, cross‑platform framework for developing multimedia and window‑effect applications.
Why you need it: Building graphical applications from scratch is cumbersome; Pyglet provides ready‑made modules for windows, OpenGL effects, audio/video playback, input handling, and image processing, saving considerable development time. It runs natively on Windows, macOS, and Linux without external binary dependencies and is released under the BSD license.
Peewee
What it is: Peewee is a small yet powerful ORM library that supports SQLite, MySQL, PostgreSQL and other databases.
Why you need it: Applications that frequently interact with external data need a reliable way to access databases; Peewee offers a safe, stable channel with support for transactions, connection pooling, many‑to‑many fields, and extensible modules, allowing rapid development without redesign.
Bottle
What it is: Bottle is a lightweight web framework that is fast and easy to use.
Why you need it: If you want to quickly create a RESTful API or a simple web application, Bottle provides routing, templating, request/response handling, support for multiple servers, and even WebSockets, with minimal setup and built‑in extensibility.
Invoke
What it is: Invoke lets you execute system‑administration tasks through a clean, Pythonic interface.
Why you need it: It offers a high‑level way to run shell commands, define and organize tasks as Python functions, and replace ad‑hoc scripts with maintainable code. Note that Invoke is still in preview; for a stable alternative, consider its predecessor, Fabric.
Splinter
What it is: Splinter is a Python library for automating web‑application testing.
Why you need it: It can automate browser actions such as opening URLs, filling forms, and clicking buttons. It ships with Chrome and Firefox drivers and can use Selenium Remote to control browsers on other machines, even executing custom JavaScript.
If you need non‑browser‑based interaction, you might explore Twill, a command‑line web scripting language.
Arrow
What it is: Arrow improves handling of dates and times in Python.
Why you need it: Dealing with time zones, conversions, and various formats can be painful with the standard .now() and .utcnow() functions. Arrow replaces the built‑in datetime module, provides easy time‑zone conversion, human‑friendly representations (e.g., "an hour ago"), and straightforward localization.
Original source: InfoWorld
Translation source: Programming Club
Article reposted from: Open Source China Community [http://www.oschina.net]
Article URL: http://www.oschina.net/news/68586/6-python-libraries-every-programmer-will-love
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
