Package: xlocale
This package exposes part of the xlocale-family of C functions to Python. This
is particularly useful to set the locale per-thread.Normally you use thelocale.setlocalefunction to change the locale for the entire process:import locale

locale.setlocale(locale.LC_ALL, 'nl_NL')This may not be desirable for webservers or other applications that use
multiple threads. To change the locale for just the current thread you
do this:import xlocale

loc = xlocale.Locale(xlocale.LC_ALL_MASK, 'nl_NL')
loc.use()Creating a locale objectxlocale.Locale([mask[, locale[, base]])Create a new locale object. The new locale is created by taken
a base locale and changing one or more locale categories. If
no base is given the C locale will be used.maskis a bitmask build from theLC_*_MASKconstants. Normally you
will want to useLC_ALL_MASKto change the locale completely.localeis a string with the locale name. If not provided the C locale
will be used.xlocale.Locale.current_locale()Return a Locale instance for the currently locale.Locale instancesLocale.use()Switch the locale for the current thread.Locale.name(mask)Return the name for a locale category.maskis a bitmask of locale
categories, and the name for the first configured category will be returned.This method is not available on all platforms, and will raise an exception
on unsupported platforms.Locale.lconv()Return information describing how numbers and currency values must be
displayed in the current locale. This is an object with the following
attributes:decimal_pointThe decimal point character, except for currency
values, cannot be an empty string.thousands_sepThe separator between groups of digits before the
decimal point, except for currency values.groupingThe sizes of the groups of digits, except for currency
This is a list of integers representing group size
from low order digit groups to high order (right to
left). The list may be terminated with 0 or CHAR_MAX.
If the list is terminated with 0 the last group size
before the 0 is repeated to account for all the
digits. If the list isterminated with CHAR_MAX, no
more grouping  is performed.int_curr_symbolThe standardized international currency symbol.currency_symbolThe local currency symbol.mon_decimal_pointThe decimal point character for currency values.mon_thousands_sepThe separator for digit groups in currency values.mon_groupingLike grouping but for currency values.positive_signThe character used to denote nonnegative currency
values, usually the empty string.negative_signThe character used to denote negative currency values,
usually a minus sign.int_frac_digitsThe number of digits after the decimal point in an
international-style currency value.frac_digitsThe number of digits after the decimal point in the
locale style for currency values.p_cs_precedesTrue if the currency symbol precedes the currency
value for nonnegative values, False if it follows.p_sep_by_spaceTrue if a space is inserted between the currency
symbol and the currency value for nonnegative values,
False otherwise.n_cs_precedesLike p_cs_precedes but for negative values.n_sep_by_spaceLike p_sep_by_space but for negative values.p_sign_posnThe location of the positive_sign with respect to a
nonnegative quantity and the currency_symbol, coded as
follows:0 - Parentheses around the entire string.1 - Before the string.2 - After the string.3 - Just before currency_symbol.4 - Just after currency_symbol.n_sign_posnLike p_sign_posn but for negative currency values.int_p_cs_precedesSame as p_cs_precedes, but for internationally
monetary quantities.
formatted monetary quantities.int_n_cs_precedesSame as n_cs_precedes, but for internationally
monetary quantities.
formatted monetary quantities.int_p_sep_by_spaceSame as p_sep_by_space, but for internationally
formatted monetary quantities.int_n_sep_by_spaceSame as n_sep_by_space, but for internationally
formatted monetary quantities.int_p_sign_posnSame as p_sign_posn, but for internationally formatted
monetary quantities.int_n_sign_posnSame as n_sign_posn, but for internationally formatted
monetary quantities.ConstantsConstantDescriptionLC_COLLATE_MASKCollationLC_CTYPE_MASKCharacter typeLC_MESSAGES_MASKMessagesLC_MONETARY_MASKMonetaryLC_NUMERIC_MASKNumericLC_TIME_MASKTimeLC_ALL_MASKCombination of all of the above.Changelog1.3.4 - February 25, 2018More Python 3 compilation fixes.1.3.3 - February 25, 2018Python 3 has no PyInt.1.3.2 - February 25, 2018Fix handling of exceptions raised when creating a Locale: they are now
correctly seen as being raised in the constructor.1.3.1 - February 23, 2018Add Python 3 support.Add manylinux support.1.2 - November 15, 2014No longer return the current locale from Locale.use(). This created
unsolvable double free problems.1.1 - October 10, 2014Fix a memory handling error in Locale.use() which could result in a segfault
when using a locale instance multiple times.1.0 - August 27, 2014First release