ANN: Gmatch, a tiny matcher of google-like queries
Gmatch is a tiny matcher of google-like query patterns, called goopats: gm = Gmatch( color: blue - sky size: 100 ) if gm.match( record ): ... matching_records = [rec for rec in records if gm.match( rec )] A record is a dict, or namedtuple, or Dotdict, or anything with record.get( key ) - value. A goopat pattern is made up of the following elements, here with examples: color: a key or field name, followed by a : colon blu words made of letters and numbers match anywhere in a field, case-insensitive: blu matches Blue Blur sublunar blue skymatch all the words, anywhere in a field, in any order: bluesky sky-blue frisky ... blues blue - sky blue but not sky -- put blanks around the - blue green - sky cloud blue and green but not sky and not cloud Double quotes are used for: key.word, http://a-b-c.net; names containing special characters sky blue sky, any amount of white space, then blue sky blue an exact word or phrase, not e.g. frisky blues rregular expression see http://docs.python.org/library/re.html . Gmatch compiles them with re.I case-insensitive and re.X, ignore white space except \ and [ ] ; Comparing: size: = = == != compare record.get( size ) to a number or string size: 100 here size must be a number, or a string like 12.3 size: = Large here it must be a string (beware: Small Large). size: = 100 200 matches sizes in the range 100 to 200. Notes, ramblings, corner cases ... (REs are pretty fast, ~ 20 Mbytes/sec on my mac ppc with python 2.5.1 .) Download files, 2feb -- 246 gmatch.py http://denis.pastebin.com/m6609dea0 154 gmparse.py http://denis.pastebin.com/m308ba33b -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
AVC 0.7.0 released
Announcing AVC 0.7.0 Webpage: http://avc.inrim.it/ What is AVC? - AVC is a multiplatform, fully automatic, live connection among graphical interface widgets and application variables for the python language. AVC supports in a uniform way the most popular widget toolkits: GTK+, Qt3, Qt4, Tk, wxWidgets. New features - * Added support for advanced widgets: list view and tree view. * Added support for progress bar widget. Features --- * Fully transparent widget-variable connections * Automatic connection by matching widgets and variables names * Multiple matching namespaces * Dynamic connections * No design pattern, no application redesign, no widget toolkit dependent code, separation between application logic and GUI. * Multiple widget toolkits support: GTK+, Qt3, Qt4, Tk, wxWidgets. * Full compatibility and support for Glade, Qt Designer, Visual Tcl and wxGlade interface design tools. * Normal widgets: button, check button, combo box, entry, label, progress bar, radio button, slider, spin button, status bar, text view/edit, toggle button. * Advanced widgets: list view, tree view. * Normal variable types: boolean, integer, float, string, list, tuple. * Advanced variable types: 2D table (list of lists), hierarchical tree (dictionary with path of values inside tree as keys). * Multiple widgets to one variable connection * Dual update timing of variable value views: immediate or periodic. * Testing printout logging activity with selectable verbosity * Python package written in pure python * Free software ( GNU GPL license ) -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
ANN: gmpy 1.04 released
Everyone, A new version of gmpy is available. gmpy is a wrapper for the GMP multiple-precision arithmetic library. This version of gmpy also supports the MPIR multiple-precision arithmetic library. gmpy 1.04 is available for download from http://code.google.com/p/gmpy/ There are several new features in this release: - Support for rich comparisons. - Faster conversion to/from Python longs and other formats. - Fixed conversion of very large numbers to a string (only limited by memory). - Support for pickling. - Support for divexact. - Support for bit_length. - Special helper functions to improve the performance of mpmath, an arbitrary-precision floating point library written in Python, (http:// code.google.com/p/mpmath/). - Support for MPIR, an alternative multiple-precision library based on GMP, (http://mpir.org). - Added fround() to round an mpf value. WARNING! A (possibly) significant change was made to the handling of mpf values. GMP would frequently return more bits in a result than requested. This led to bugs such such as mpf(1.1)*mpf(1) != mpf(1.1) but mpf(1.1) / mpf(1) == mpf(1.1). The results of all floating point calculations are now rounded to the requested precision. mpf calculations may now produce slightly different results but the results are still within the bounds of the requested accuracy. As an alternative, the mpmath library provides consistently rounded floating point arithmetic and support a wide variety of transcendental functions. Comments on provided binaries The 32-bit Windows installers were compiled using MPIR 0.9 RC2 and will automatically recognize the CPU type and use code optimized for that CPU. gmpy 1.04 libraries are also provided for 64-bit Windows and Python 2.6. There is no installer; the appropriate gmpy.pyd must be copied to the site-packages directory. casevh -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Financial aid for PyCon 2009 is now available
I'm happy to announce that the Python Software Foundation has allocated funds to help people attend PyCon 2009! If you would like to come to PyCon but can't afford it, the PSF may be able to help you pay for registration, lodging/hotel costs and transportation (flight etc.). Please see http://us.pycon.org/2009/registration/financial-aid/ for full details, or email pycon-...@python.org with questions. -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html