31f5bb6a3fe14e99c962d640aec50c047db75aaf
[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 The different backends have varying features and behaviors; which one
12 is best depends on your goals. A specific backend can be used, or a
13 "best" backend is chosen by default.
14
15 pycollate also provides tools to perform word-wise and numeric sorts.
16
17 pycollate, as with all Unicode collation tools, is a work in progress.
18
19 Installing
20 ----------
21 $ sudo apt-get install python-pyrex libicu-dev
22 $ ./setup.py build
23 $ sudo ./setup.py install
24
25 Example
26 -------
27 import collate
28 strings = file("contents.txt").read().decode("utf-8").splitlines()
29 strings.sort(key=collate.key)
30
31 License
32 -------
33
34 icu/_icu.pyx:
35
36 Copyright (c) 2004 Zope Corporation and Contributors.
37 All Rights Reserved.
38
39 This software is subject to the provisions of the Zope Public License,
40 Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
41 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
42 WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
43 WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
44 FOR A PARTICULAR PURPOSE.
45
46 All else:
47
48 Copyright 2010 Joe Wreschnig
49
50 Permission is hereby granted, free of charge, to any person obtaining a copy
51 of this software and associated documentation files (the "Software"), to deal
52 in the Software without restriction, including without limitation the rights
53 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
54 copies of the Software, and to permit persons to whom the Software is
55 furnished to do so, subject to the following conditions:
56
57 The above copyright notice and this permission notice shall be included in
58 all copies or substantial portions of the Software.
59
60 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
63 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
65 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
66 THE SOFTWARE.