http.server uses classes from socketserver to create base classes for making HTTP servers. HTTPServer can be used directly, but the BaseHTTPRequestHandler is intended to be extended to handle each protocol method (GET, POST, etc.).
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
robotparser implements a parser for the robots.txt file format, including a function that checks if a given user agent can access a resource. It is intended for use in well-behaved spiders, or other crawler applications that need to either be throttled or otherwise restricted.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
What’s new in 4.1.0? Make it possible to provide several wordlists (contributed by Tobias Olausson) Update developer documentation (contributed by Tobias Olausson) Update home page link (contributed by Devin Sevilla)
The urllib.parse module provides functions for manipulating URLs and their component parts, to either break them down or build them up.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
What’s new in 0.2.0? add link formatter for producing links to online copies of source (see the user guide for details) add python-openstackclient integration to create an openstack code search command
A few days ago Logan Jones contacted me about my Python package bartender, to ask if I would let him use the name since the package I published is unmaintained. Since it is also (as far as I know) unused, I agreed.
I don’t know what happens to the name if I delete the existing entry, so I’ve given him Owner rights to it so he can publish packages to overwrite what is there now rather than deleting the entry and having neither of us able to use it again.
Python’s unittest module is based on the XUnit framework design by Kent Beck and Erich Gamma. The same pattern is repeated in many other languages, including C, Perl, Java, and Smalltalk. The framework implemented by unittest supports fixtures, test suites, and a test runner to enable automated testing.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
The traceback module works with the call stack to produce error messages. A traceback is a stack trace from the point of an exception handler down the call chain to the point where the exception was raised. Tracebacks also can be accessed from the current call stack up from the point of a call (and without the context of an error), which is useful for finding out the paths being followed into a function.
The json module provides an API similar to pickle for converting in-memory Python objects to a serialized representation known as JavaScript Object Notation (JSON). Unlike pickle, JSON has the benefit of having implementations in many languages (especially JavaScript). It is most widely used for communicating between the web server and client in REST API, but is also useful for other inter-application communication needs.
Read more…
This post is part of the Python Module of the Week series for Python 3.