summaryrefslogtreecommitdiff
path: root/natsort/__init__.py
blob: 787da5f4803685a7235272254d6e7e5f21fcfd01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import sys
import warnings

from natsort.natsort import (
    as_ascii,
    as_utf8,
    decoder,
    humansorted,
    index_humansorted,
    index_natsorted,
    index_realsorted,
    index_versorted,
    natsort_key,
    natsort_keygen,
    natsorted,
    ns,
    order_by_index,
    realsorted,
    versorted,
)
from natsort.utils import chain_functions

if float(sys.version[:3]) < 3:
    from natsort.natsort import natcmp

__version__ = "5.5.0"

__all__ = [
    "natsort_key",
    "natsort_keygen",
    "natsorted",
    "versorted",
    "humansorted",
    "realsorted",
    "index_natsorted",
    "index_versorted",
    "index_humansorted",
    "index_realsorted",
    "order_by_index",
    "decoder",
    "natcmp",
    "as_ascii",
    "as_utf8",
    "ns",
    "chain_functions",
]

# Add the ns keys to this namespace for convenience.
# A dict comprehension is not used for Python 2.6 compatibility.
# We catch warnings from the deprecated ns enum values when adding
# them to natsort's main namespace.
with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    globals().update(ns._asdict())