Personal tools
Skip to content. | Skip to navigation
Enhancements for standard library's cmd module. Drop-in replacement adds several features for command-prompt tools: * Searchable command history (commands: "hi", "li", "run") * Load commands from file, save to file, edit commands in file * Multi-line commands * Case-insensitive commands * Special-character shortcut commands (beyond cmd's "@" and "!") * Settable environment parameters * Parsing commands with flags * > (filename), >> (filename) redirect output to file * < (filename) gets input from file * bare >, >>, < redirect to/from paste buffer * accepts abbreviated commands when unambiguous * `py` enters interactive Python console * test apps against sample session transcript (see example/example.py) Usable without modification anywhere cmd is used; simply import cmd2.Cmd in place of cmd.Cmd. See docs at http://packages.python.org/cmd2/
Welcome to the Coding class. The Coding class is one answer to the question of python enums.
An extensible package which can be used to: - deserialize and validate a data structure composed of strings, mappings, and lists. - serialize an arbitrary data structure to a data structure composed of strings, mappings, and lists. Please see http://docs.pylonsproject.org/projects/colander/en/latest/ for further documentation.
Overview This module provides an additional log handler for Python's standard logging package (PEP 282). This handler will write log events to log file which is rotated when the log file reaches a certain size. Multiple processes can safely write to the same log file concurrently. Details The ConcurrentRotatingFileHandler class is a drop-in replacement for Python's standard log handler RotatingFileHandler. This module uses file locking so that multiple processes can concurrently log to a single file without dropping or clobbering log events. This module provides a file rotation scheme like with RotatingFileHanler. Extra care is taken to ensure that logs can be safely rotated before the rotation process is started. (This module works around the file rename issue with RotatingFileHandler on Windows, where a rotation failure means that all subsequent log events are dropped). This module attempts to preserve log records at all cost. This means that log files will grow larger than the specified maximum (rotation) size. So if disk space is tight, you may want to stick with RotatingFileHandler, which will strictly adhere to the maximum file size. If you have multiple instances of a script (or multiple scripts) all running at the same time and writing to the same log file, then all of the scripts should be using ConcurrentRotatingFileHandler. You should not attempt to mix and match RotatingFileHandler and ConcurrentRotatingFileHandler. This package bundles portalocker to deal with file locking. Please be aware that portalocker only supports Unix (posix) an NT platforms at this time, and therefore this package only supports those platforms as well.
ConfigObj is a simple but powerful config file reader and writer: an ini file round tripper. Its main feature is that it is very easy to use, with a straightforward programmer's interface and a simple syntax for config files. It has lots of other features though: * Nested sections (subsections), to any level * List values * Multiple line values * String interpolation (substitution) * Integrated with a powerful validation system o including automatic type checking/conversion o repeated sections o and allowing default values * All comments in the file are preserved * The order of keys/sections is preserved * No external dependencies * Full Unicode support * A powerful unrepr mode for storing basic datatypes
The ancient ConfigParser module available in the standard library 2.x has seen a major update in Python 3.2. This is a backport of those changes so that they can be used directly in Python 2.6 - 2.7. To use configparser instead of ConfigParser, simply replace: import ConfigParser with: import configparser For detailed documentation consult the vanilla version at http://docs.python.org/py3k/library/configparser.html. Why you'll love configparser * there's now one default ConfigParser class, which basically is the old SafeConfigParser with a bunch of tweaks which make it more predictable for users. Don't need interpolation? Simply use ConfigParser(interpolation=None), no need to use a distinct RawConfigParser anymore. * the parser is highly customizable upon instantiation supporting things like changing option delimiters, comment characters, the name of the DEFAULT section, the interpolation syntax, etc. * you can easily create your own interpolation syntax but there are two powerful implementations built-in (more info): o the classic %(string-like)s syntax (called BasicInterpolation) o a new ${buildout:like} syntax (called ExtendedInterpolation) * ConfigParser objects can now read data directly from strings and from dictionaries. That means importing configuration from JSON or specifying default values for the whole configuration (multiple sections) is now a single line of code. Same goes for copying data from another ConfigParser instance, thanks to its mapping protocol support. * many smaller tweaks, updates and fixes
A framework to implement simple but nice configuration-oriented command-line interfaces.
OpenStack Congress Service is an open policy framework for OpenStack This package contains the Congress python library.