Python is so popular and widely learned because it’s simple, easy to learn, incredibly powerful, has a vibrant community, and tons of resources. This language touches almost every domain: automated testing, operations, web scraping, data analysis, machine learning, finance, backend development, cloud computing, game development—you name it.
Great buildings rise from the ground up. The reason Python’s ecosystem is so robust is its foundation of thousands of powerful libraries. Today, let’s take a panoramic view of this Python treasure trove.
Here, we’ve categorized Python libraries by their applications, spanning over 20 major areas. Think of it as having two wings: the left wing for “offense” (external applications)—each a standout, the heavy hitters in Python’s arsenal; the right wing for “defense” (internal/core)—dealing with underlying configurations, the very foundation of the Python edifice.
Below, we handpick the cream of the crop from each category. After reading, you’re bound to exclaim, “Wow, I haven’t heard of so many of these!”
1. The Foundation: Infrastructure
Environment Management
Tools for managing Python versions and environments.
pyenv: Simple Python version management.Vex: Run commands in a virtualenv.virtualenv: Create isolated Python environments.buildout: Build, configure, and compose applications with a declarative configuration after initial setup in isolated environments.
Package Management
Tools for managing packages and dependencies.
pip: The Python package and dependency manager.pip-tools: A set of tools to keep your Python package dependencies fresh.pipenv: The officially recommended next-generation Python packaging tool.poetry: A dependency management and packaging tool that can completely replacesetup.py.conda: Cross-platform, binary package manager.Curdling: A command line tool for managing Python packages.wheel: The new standard of Python distribution, intended to replace eggs.
Distribution
Packaging Python code for distribution as executables.
PyInstaller: Converts Python programs into standalone executables (cross-platform).cx_Freeze: Freezes Python scripts into executables.dh-virtualenv: Build and distribute a virtualenv as a Debian package.Nuitka: Compiles scripts, modules, and packages to executables or extension modules.py2app: Freezes Python scripts into standalone Mac OS X applications.py2exe: Freezes Python scripts into standalone Windows applications.pynsist: A tool to build Windows installers, which can package Python itself.
Configuration
Libraries for storing and parsing configuration.
config: Hierarchical config from the author oflogging.ConfigObj: INI file parser with validation.ConfigParser: (Standard Library) INI file parser.profig: Config via multiple formats with value conversion.python-decouple: Strict separation of settings from code.
2. Management & Configuration
File & Filesystem
aiofiles: File support for asyncio.imghdr: (Standard Library) Determine the type of an image.mimetypes: (Standard Library) Map filenames to MIME types.path.py: Module wrapper foros.path.pathlib: (Standard Library, Python 3.4+) Cross-platform, object-oriented path library.python-magic: Python interface to the libmagic file type identification library.Unipath: Object-oriented approach to file/directory operations.watchdog: API and shell utilities to monitor file system events.pofile: A simple file handling tool for beginners.
Date & Time
Libraries for working with dates and times.
arrow: Better dates and times for Python.Chronyk: A Python 3 library for parsing human-written times and dates.dateutil: Powerful extensions to the standarddatetimemodule.delorean: A library for clearing up the inconvenient truths about datetimes.maya: Datetimes for Humans.moment: A Python library for dealing with dates/times. Inspired by Moment.js.pendulum: Python datetimes made easy, with more explicit, predictable behavior than arrow.PyTime: Easy time/datetime string parser and manipulator.pytz: World timezone definitions, modern and historical. Brings the tz database into Python.when.py: User-friendly helpers for performing common date and time actions.potime: A tool for measuring code execution time.
Text Processing
Libraries for parsing and manipulating plain texts.
General
chardet: Character encoding detector, for Python 2 and 3.difflib: (Standard Library) Helpers for computing deltas.ftfy: Fixes mojibake and other glitches in Unicode text.fuzzywuzzy: Fuzzy String Matching.Levenshtein: Fast computation of Levenshtein distance and string similarity.pangu.py: Spacing texts for CJK and alphanumerics.pypinyin: Convert Chinese hanzi to pinyin.shortuuid: A generator library for concise, unambiguous, URL-safe UUIDs.simplejson: A simple, fast, complete JSON encoder/decoder.unidecode: ASCII transliterations of Unicode text.uniout: Print readable chars instead of the escaped string.xpinyin: A library to convert Chinese hanzi to pinyin.pyfiglet: An implementation of figlet written in Python.flashtext: A very fast library for find/replace keywords in text.
Slugification
awesome-slugify: A Python slugify library that can preserve unicode.python-slugify: A Python slugify library that turns unicode into ASCII.unicode-slugify: A slugifier that generates unicode slugs. Django dependency.
Parsers
phonenumbers: Parsing, formatting, storing and validating international phone numbers.PLY: Implementation of lex and yacc parsing tools for Python.Pygments: A generic syntax highlighter.pyparsing: A general framework for generating parsers.python-nameparser: Parsing human names into their individual components.python-user-agents: Browser user agent parser.sqlparse: A non-validating SQL parser.
Office & Document Formats
General
tablib: A module for tabular datasets.- ⭐
python-office: A third-party library for office automation.
Office (Excel, Word, etc.)
Marmir: Takes Python data structures and turns them into spreadsheets.openpyxl: A library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files.pyexcel: Provides one API for reading, manipulating, and writing data in various Excel formats.python-docx: Read, query, and modify Microsoft Word 2007/2008 docx files.relatorio: Templating OpenDocument files.unoconv: Convert between any document format supported by LibreOffice/OpenOffice.XlsxWriter: A Python module for creating Excel .xlsx files.xlwings: Make Excel fly with Python (and vice versa) on BSD.xlwt: Library to create spreadsheet files compatible with MS Excel 97/2000/XP/2003 XLS files.poexcel: A tool for handling Excel files.
PDFMiner: A tool for extracting information from PDF documents.popdf: A tool for working with PDFs.PyPDF2: A library capable of splitting, merging, and transforming PDF pages.ReportLab: Allows rapid creation of rich PDF documents.
Markdown
Mistune: The fastest Markdown parser in pure Python with renderer features.Python-Markdown: John Gruber’s Markdown in Python.Python-Markdown2: A fast and complete implementation of Markdown in Pure Python.
YAML
PyYAML: YAML implementations for Python.
CSV
csvkit: Utilities for converting to and working with CSV.
Command-Line Tools
Libraries for building command-line applications.
CLI Development
asciimatics: Cross-platform, full-screen terminal package (handles mouse/keyboard input & colored, positioned text output) with high-level API for complex animations and effects.cement: CLI Application Framework for Python.click: A package for creating beautiful command line interfaces composably.cliff: A framework for creating command-line programs with multi-level commands.clint: Python Command Line Interface Tools.colorama: Cross-platform colored terminal text.docopt: Pythonic command line arguments parser.Gooey: Turn command line programs into GUI applications with one line.python-prompt-toolkit: A library for building powerful interactive command lines.python-fire: A library for creating command line interfaces from absolutely any Python object (Google).Pythonpy: Run any Python expression right in the command line.
Productivity Tools
aws-cli: Universal Command Line Interface for Amazon Web Services.bashplotlib: Making basic plots in the terminal.caniusepython3: Determine which projects are blocking you from porting to Python 3.cookiecutter: Creates projects from project templates.doitlive: A tool for live demonstrations in the terminal.pyftpdlib: A fast and scalable Python FTP server library.howdoi: Instant coding answers via the command line.httpie: A user-friendly cURL replacement.PathPicker: Select files out of bash output.percol: Adds flavor of interactive selection to the traditional pipe concept on UNIX.SAWS: A Supercharged AWS Command Line Interface.thefuck: Corrects your previous console command.mycli: A MySQL terminal client with auto-completion and syntax highlighting.pgcli: A Postgres terminal client with auto-completion and syntax highlighting.try: A dead simple CLI tool to try out Python packages.
3. The Repository: Databases
Database Implementations
Databases implemented in Python.
pickleDB: A simple and lightweight key-value store.PipelineDB: Streaming SQL database.TinyDB: A tiny, document-oriented database.ZODB: A native object database for Python. A key-value and object graph database.
Database Drivers
Libraries for connecting to and operating databases.
MySQL
aiomysql: MySQL driver for asyncio.mysql-python: The MySQL database connector for Python.mysqlclient: Fork of MySQL-python with Python 3 support.oursql: A better MySQL connector with native prepared statement and BLOB support.PyMySQL: Pure Python MySQL driver compatible with mysql-python.
PostgreSQL
psycopg2: The most popular PostgreSQL adapter for Python.queries: A wrapper for psycopg2 providing a simpler interface.txpostgres: Twisted-based asynchronous driver for PostgreSQL.
Other Relational Databases
apsw: Another Python SQLite wrapper.dataset: Store Python dicts in a database.pymssql: A simple Microsoft SQL Server database interface.
NoSQL Databases
asyncio-redis: Redis client for asyncio (PEP 3156).cassandra-python-driver: Python driver for Cassandra.HappyBase: A developer-friendly library for Apache HBase.Plyvel: A fast and feature-rich Python interface to LevelDB.py2neo: Python wrapper client for Neo4j’s restful interface.pycassa: Python Thrift driver for Cassandra.PyMongo: The official Python client for MongoDB.redis-py: The Python client for Redis.telephus: A Twisted-based client for Cassandra.txRedis: A Twisted-based client for Redis.
4. Network Communication
Networking
Libraries for networking programming.
asyncio: (Standard Library) Asynchronous I/O, event loop, coroutines and tasks.Twisted: An event-driven networking engine.pulsar: Event-driven concurrent framework.diesel: Greenlet-based event I/O Framework.pyzmq: Python bindings for the 0MQ message library.Toapi: A lightweight, simple, fast Flask library that aims to make any website provide APIs.txZMQ: Twisted-based Python bindings for the 0MQ message library.
HTTP
Libraries for working with HTTP.
aiohttp: Asynchronous HTTP client/server framework for asyncio.requests: HTTP Requests for Humans.grequests: requests + gevent for asynchronous HTTP requests.httplib2: A comprehensive HTTP client library.treq: Python requests-like API built on top of Twisted’s HTTP client.urllib3: A HTTP library with thread-safe connection pooling, file post support, sanity friendly.
WebSocket
Libraries for working with WebSocket.
AutobahnPython: WebSocket & WAMP for Python on Twisted and asyncio.Crossbar: Open-source Unified Application Router (Websocket & WAMP for Python on Autobahn).django-socketio: WebSockets for Django.WebSocket-for-Python: WebSocket client and server library for Python 2/3 and PyPy.
WSGI Servers
WSGI-compatible web servers.
gunicorn: Pre-forked, partly written in C.uwsgi: Aims at developing a full stack for building hosting services (C-written).bjoern: Asynchronous, very fast, written in C.fapws3: Asynchronous (network side only), written in C.meinheld: Asynchronous, partly written in C.netius: Asynchronous, very fast.paste: Multi-threaded, stable, tried and tested.rocket: Multi-threaded.waitress: Multi-threaded, powers Pyramid.Werkzeug: A WSGI utility library for Python that powers Flask and can be embedded.
Web Frameworks
Full stack web frameworks.
Django: The most popular web framework in Python.Flask: A microframework for Python.pyramid: A small, fast, down-to-earth Python web framework.Bottle: A fast, simple and lightweight WSGI micro web-framework.CherryPy: A minimalist Python web framework, HTTP/1.1-compliant and WSGI thread-pooled.TurboGears: A microframework that can scale up to a full stack solution.Tornado: A web framework and asynchronous networking library.sanic: Async web framework for Python 3.5+.starlette: A lightweight, high-performance ASGI framework.
E-commerce
Frameworks and libraries for e-commerce and payments.
django-oscar: An open-source e-commerce framework for Django.django-shop: A Django based shop system.Cartridge: A shopping cart app built using the Mezzanine.shoop: An open-source E-Commerce platform based on Django.alipay: Unofficial Alipay API for Python.merchant: A Django app to accept payments from various payment processors.money: A money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.python-currencies: Display money format and its filthy currencies.
RESTful API
Libraries for developing RESTful APIs.
Django
django-rest-framework: A powerful and flexible toolkit for building Web APIs.django-tastypie: Creating APIs for Django apps.django-formapi: Create JSON APIs for form validation with Django.
Flask
flask-api: Browsable Web APIs for Flask.flask-restful: Quickly building REST APIs for Flask.flask-restless: Generating RESTful APIs for database models defined with SQLAlchemy.flask-api-utils: Flask extension that takes care of API representation and authentication.eve: REST API framework powered by Flask, MongoDB, etc.
Pyramid
cornice: A REST framework for Pyramid.
Framework Agnostic
falcon: A high-performance framework for building cloud APIs and web app backends.sandman: Automatically generate REST APIs for existing database-driven systems.restless: A framework-agnostic REST framework based on lessons from Tastypie.ripozo: Quickly create REST/HATEOAS/Hypermedia APIs.
Template Engines
Libraries and tools for templating and lexing.
Jinja2: A modern and designer friendly templating language.Chameleon: An HTML/XML template engine. Modeled after ZPT, optimized for speed.Genshi: Python templating toolkit for generating web-aware output.Mako: A super-fast and lightweight templating for the Python platform.
Queues
Libraries for working with event and task queues.
celery: An asynchronous task queue/job queue based on distributed message passing.huey: A little multi-threaded task queue.mrq: Mr. Queue – A distributed worker task queue in Python using Redis & gevent.rq: Simple job queues for Python.simpleq: A simple, infinitely scalable, Amazon SQS based queue.
Search
Libraries and software for indexing and performing search queries on data.
django-haystack: Modular search for Django.elasticsearch-py: The official low-level Python client for Elasticsearch.elasticsearch-dsl-py: The official high-level Python client for Elasticsearch.solrpy: A Python client for Solr.Whoosh: A fast, pure Python search engine library.
Email
Libraries for sending and parsing email.
django-celery-ses: Django email backend with AWS SES and Celery.envelopes: Mailing for human beings.flanker: An email address and Mime parsing library.imbox: Python IMAP for Humans.inbox.py: Python SMTP Server.inbox: The open source email toolkit.lamson: Pythonic SMTP Application Server.mailjet: Official Mailjet API implementation for batch emails, stats, etc.marrow.mailer: High-performance extensible mail delivery framework.modoboa: A mail hosting and management platform with a modern and simplified Web UI.pyzmail: Compose, send and parse emails.Talon: Mailgun library to extract message quotations and signatures.yagmail: A GMAIL/SMTP client designed to make sending emails as easy as possible.
URL Manipulation
Libraries for parsing URLs.
furl: A small Python library that makes parsing and manipulating URLs easy.purl: A simple, immutable URL class with a clean API for interrogation and manipulation.pyshorteners: A pure Python URL shortening lib.shorturl: Generating short URLs like bit.ly in Python.webargs: A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks.
5. The Power System
Processes
Libraries for starting and communicating with OS processes.
envoy: Subprocess for Humans.sarge: A wrapper for subprocess.sh: A full-fledged subprocess replacement.
Concurrency & Parallelism
Libraries for concurrent and parallel execution.
multiprocessing: (Standard Library) Process-based “threading” interface.threading: (Standard Library) Higher-level threading interface.eventlet: Asynchronous framework with WSGI support.gevent: A coroutine-based Python networking library that uses greenlet.Tomorrow: Magic decorator syntax for asynchronous code (viathreading).uvloop: Ultra fast implementation ofasyncioevent loop on top of libuv.