Added tag 0.2 Release for changeset 0a75c795453a
[python-collate.git] / README.txt
1 pycollate - Collation algorithms for Python
2 -------------------------------------------
3
4 pycollate is an interface to various collation algorithms for Python.
5
6 Supported backends:
7 - icu - Based on the IBM ICU toolkit and Jim Fulton's zope.ucol.
8 - syslocale - Native OS collation routines.
9 - codepoint - Raw Unicode codepoint comparison
10
11 If available, you'll probably want to use the ICU backend. If it's not
12 available, syslocale should work on most Python installations. A
13 specific backend can be used, or a "best" backend is chosen by
14 default.
15
16 pycollate also provides tools to perform word-wise and numeric sorts.
17
18 pycollate, as with all Unicode collation tools, is a work in progress.
19
20 Installing
21 ----------
22 $ sudo apt-get install python-pyrex libicu-dev
23 $ ./setup.py build
24 $ sudo ./setup.py install
25
26 Example
27 -------
28 import collate
29 strings = open("contents.txt").read().decode("utf-8").splitlines()
30 strings.sort(key=collate.key)
31
32 License
33 -------
34
35 icu/_icu.pyx:
36
37 Copyright (c) 2004 Zope Corporation and Contributors.
38 All Rights Reserved.
39
40 This software is subject to the provisions of the Zope Public License,
41 Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
42 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
43 WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
44 WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
45 FOR A PARTICULAR PURPOSE.
46
47 All else:
48
49 Copyright 2010 Joe Wreschnig
50
51 Permission is hereby granted, free of charge, to any person obtaining a copy
52 of this software and associated documentation files (the "Software"), to deal
53 in the Software without restriction, including without limitation the rights
54 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55 copies of the Software, and to permit persons to whom the Software is
56 furnished to do so, subject to the following conditions:
57
58 The above copyright notice and this permission notice shall be included in
59 all copies or substantial portions of the Software.
60
61 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
67 THE SOFTWARE.