1 This module is unsuitable for real-world use at this time.
3 pycollate - Collation algorithms for Python
4 -------------------------------------------
6 pycollate is an interface to various collation algorithms for Python.
9 - icu - Based on the IBM ICU toolkit and Jim Fulton's zope.ucol.
10 - syslocale - Native OS collation routines.
11 - codepoint - Raw Unicode codepoint comparison
13 The different backends have varying features and behaviors; which one
14 is best depends on your goals. A specific backend can be used, or a
15 "best" backend is chosen by default.
17 pycollate also provides tools to perform word-wise and numeric sorts.
19 pycollate, as with all Unicode collation tools, is a work in progress.
23 $ sudo apt-get install python-pyrex libicu-dev
25 $ sudo ./setup.py install
30 strings = file("contents.txt").read().decode("utf-8").splitlines()
31 strings.sort(key=collate.key)
38 Copyright (c) 2004 Zope Corporation and Contributors.
41 This software is subject to the provisions of the Zope Public License,
42 Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
43 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
44 WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45 WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
46 FOR A PARTICULAR PURPOSE.
50 Copyright 2010 Joe Wreschnig
52 Permission is hereby granted, free of charge, to any person obtaining a copy
53 of this software and associated documentation files (the "Software"), to deal
54 in the Software without restriction, including without limitation the rights
55 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56 copies of the Software, and to permit persons to whom the Software is
57 furnished to do so, subject to the following conditions:
59 The above copyright notice and this permission notice shall be included in
60 all copies or substantial portions of the Software.
62 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN