tempfile — Temporary File System Objects — PyMOTW 3

Creating temporary files with unique names securely, so they cannot be guessed by someone wanting to break the application or steal the data, is challenging. The tempfile module provides several functions for creating temporary file system resources securely. TemporaryFile() opens and returns an unnamed file, NamedTemporaryFile() opens and returns a named file, SpooledTemporaryFile holds its content in memory before writing to disk, and TemporaryDirectory is a context manager what removes the directory when the context is closed.

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.

imapautofiler 1.3.0

imapautofiler applies user-defined rules to automatically organize messages on an IMAP server.

What’s new in 1.3.0?

  • add sort action with the ability to derive a destination mailbox name from a message header
  • add sort-mailing-list action
  • add a rule for checking if a message is from a mailing list
  • add a rule for checking if a header exists
  • do not die if there is an error handling one message

pathlib — Filesystem Paths as Objects — PyMOTW 3

pathlib includes classes for managing filesystem paths formatted using either the POSIX standard or Microsoft Windows syntax. It includes so called “pure” classes, which operate on strings but do not interact with an actual filesystem, and “concrete” classes, which extend the API to include operations that reflect or modify data on the local filesystem.

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.

sphinxcontrib-spelling 4.0.1

sphinxcontrib-spelling is a spelling checker for Sphinx-based documentation. It uses PyEnchant to produce a report showing misspelled words.

What’s new in 4.0.1?

  • use the right method to emit warnings (Fixes #5)
  • Fixes #1 — disable smart quotes so that we can recognize contractions/posessives correctly (contributed by Alex Gaynor)

sphinxcontrib-spelling 4.0.0

sphinxcontrib-spelling is a spelling checker for Sphinx-based documentation. It uses PyEnchant to produce a report showing misspelled words.

What’s new in 4.0.0?

  • Don’t fail by default (contributed by Stephen Finucane)
  • Mark the extension as safe for parallel reading (contributed by Alex Gaynor)
  • be more verbose about configuration options
  • switch to testrepository for running tests
  • update python 3.3 to 3.5

linecache — Read Text Files Efficiently — PyMOTW 3

The linecache module is used within other parts of the Python standard library when dealing with Python source files. The implementation of the cache holds the contents of files, parsed into separate lines, in memory. The API returns the requested line(s) by indexing into a list , and saves time over repeatedly reading the file and parsing lines to find the one desired. This is especially useful when looking for multiple lines from the same file, such as when producing a traceback for an error report.

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.

git-os-job 1.1.1

The OpenStack project stores the logs for all of the test jobs related to a commit on http://logs.openstack.org organized by the commit hash. To review the logs after a job runs, most developers start with the message jenkins leaves on gerrit, and click through to the log files. Not all jenkins jobs are triggered by or related to a gerrit review, though (e.g, release tags).

git-os-job makes it easy to find those logs by finding the hash of the commit and using it to build the right URL. It will then either print the URL or open a web browser directly.

What’s new in 1.1.1?

  • don’t decode bytes to unicode twice