{ "info": { "author": "Alexander Bohn", "author_email": "fish2000@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved", "Operating System :: OS Independent", "Programming Language :: C++", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Internationalization", "Topic :: Software Development :: Localization" ], "description": "---------------------\nREADME file for PyICU\n---------------------\n\n.. contents::\n\n\nWelcome\n-------\n\nWelcome to PyICU, a Python extension wrapping IBM's International\nComponents for Unicode C++ library (ICU).\n\nPyICU is a project maintained by the Open Source Applications Foundation.\n\nThe ICU homepage is: http://site.icu-project.org/\n\n\nBuilding PyICU\n--------------\n\nBefore building PyICU the ICU libraries must be built and installed. Refer\nto each system's instructions for more information.\n\nPyICU is built with distutils or setuptools:\n - verify that the ``INCLUDES``, ``LFLAGS``, ``CFLAGS`` and ``LIBRARIES``\n dictionaries in ``setup.py`` contain correct values for your platform\n - ``python setup.py build``\n - ``sudo python setup.py install``\n\n\nRunning PyICU\n-------------\n\n - Mac OS X\n Make sure that ``DYLD_LIBRARY_PATH`` contains paths to the directory(ies)\n containing the ICU libs.\n\n - Linux & Solaris\n Make sure that ``LD_LIBRARY_PATH`` contains paths to the directory(ies)\n containing the ICU libs or that you added the corresponding ``-rpath``\n argument to ``LFLAGS``.\n\n - Windows\n Make sure that ``PATH`` contains paths to the directory(ies)\n containing the ICU DLLs.\n\n\nWhat's available\n----------------\n\nSee the ``CHANGES`` file for an up to date log of changes and additions.\n\n\nAPI Documentation\n-----------------\n\nThere is no API documentation for PyICU. The API for ICU is documented at\nhttp://icu-project.org/apiref/icu4c/ and the following patterns can be\nused to translate from the C++ APIs to the corresponding Python APIs.\n\n - strings\n\n The ICU string type, ``UnicodeString``, is a type pointing at a mutable\n array of ``UChar`` Unicode 16-bit wide characters. The Python unicode type\n is an immutable string of 16-bit or 32-bit wide Unicode characters.\n\n Because of these differences, ``UnicodeString`` and Python's ``unicode``\n type are not merged into the same type when crossing the C++ boundary.\n ICU APIs taking ``UnicodeString`` arguments have been overloaded to also\n accept Python str or unicode type arguments. In the case of ``str``\n objects, ``utf-8`` encoding is assumed when converting them to\n ``UnicodeString`` objects.\n\n To convert a Python ``str`` encoded in a encoding other than ``utf-8`` to\n an ICU ``UnicodeString`` use the ``UnicodeString(str, encodingName)``\n constructor.\n\n ICU's C++ APIs accept and return ``UnicodeString`` arguments in several\n ways: by value, by pointer or by reference.\n When an ICU C++ API is documented to accept a ``UnicodeString`` reference\n parameter, it is safe to assume that there are several corresponding\n PyICU python APIs making it accessible in simpler ways:\n\n For example, the\n ``'UnicodeString &Locale::getDisplayName(UnicodeString &)'`` API,\n documented at\n http://icu-project.org/apiref/icu4c/classLocale.html\n can be invoked from Python in several ways:\n\n 1. The ICU way\n\n >>> from icu import UnicodeString, Locale\n >>> locale = Locale('pt_BR')\n >>> string = UnicodeString()\n >>> name = locale.getDisplayName(string)\n >>> name\n \n >>> name is string\n True <-- string arg was returned, modified in place\n\n 2. The Python way\n\n >>> from icu import Locale\n >>> locale = Locale('pt_BR')\n >>> name = locale.getDisplayName()\n >>> name\n u'Portuguese (Brazil)'\n\n A ``UnicodeString`` object was allocated and converted to a Python\n ``unicode`` object.\n\n A UnicodeString can be coerced to a Python unicode string with Python's\n ``unicode()`` constructor. The usual ``len()``, ``str()``, comparison,\n ``[]`` and ``[:]`` operators are all available, with the additional\n twists that slicing is not read-only and that ``+=`` is also available\n since a UnicodeString is mutable. For example:\n\n >>> name = locale.getDisplayName()\n u'Portuguese (Brazil)'\n >>> name = UnicodeString(name)\n >>> name\n \n >>> unicode(name)\n u'Portuguese (Brazil)'\n >>> len(name)\n 19\n >>> str(name) <-- works when chars fit with default encoding\n 'Portuguese (Brazil)'\n >>> name[3]\n u't'\n >>> name[12:18]\n \n >>> name[12:18] = 'the country of Brasil'\n >>> name\n \n >>> name += ' oh joy'\n >>> name\n \n\n - error reporting\n\n The C++ ICU library does not use C++ exceptions to report errors. ICU\n C++ APIs return errors via a ``UErrorCode`` reference argument. All such\n APIs are wrapped by Python APIs that omit this argument and throw an\n ``ICUError`` Python exception instead. The same is true for ICU APIs\n taking both a ``ParseError`` and a ``UErrorCode``, they are both to be\n omitted.\n\n For example, the ``'UnicodeString &DateFormat::format(const Formattable &,\n UnicodeString &, UErrorCode &)'`` API, documented at\n http://icu-project.org/apiref/icu4c/classDateFormat.html\n is invoked from Python with:\n\n >>> from icu import DateFormat, Formattable\n >>> df = DateFormat.createInstance()\n >>> df\n \n >>> f = Formattable(940284258.0, Formattable.kIsDate)\n >>> df.format(f)\n u'10/18/99 3:04 PM'\n \n Of course, the simpler ``'UnicodeString &DateFormat::format(UDate,\n UnicodeString &)'`` documented here:\n http://icu-project.org/apiref/icu4c/classDateFormat.html\n can be used too:\n\n >>> from icu import DateFormat\n >>> df = DateFormat.createInstance()\n >>> df\n \n >>> df.format(940284258.0)\n u'10/18/99 3:04 PM'\n\n - dates\n\n ICU uses a double floating point type called ``UDate`` that represents the\n number of milliseconds elapsed since 1970-jan-01 UTC for dates.\n\n In Python, the value returned by the ``time`` module's ``time()``\n function is the number of seconds since 1970-jan-01 UTC. Because of this\n difference, floating point values are multiplied by 1000 when passed to\n APIs taking ``UDate`` and divided by 1000 when returned as ``UDate``.\n\n Python's ``datetime`` objects, with or without timezone information, can\n also be used with APIs taking ``UDate`` arguments. The ``datetime``\n objects get converted to ``UDate`` when crossing into the C++ layer.\n\n - arrays\n\n Many ICU API take array arguments. A list of elements of the array\n element types is to be passed from Python.\n\n - StringEnumeration\n\n An ICU ``StringEnumeration`` has three ``next`` methods: ``next()`` which\n returns a ``str`` objects, ``unext()`` which returns ``unicode`` objects\n and ``snext()`` which returns ``UnicodeString`` objects.\n Any of these methods can be used as an iterator, using the Python\n built-in ``iter`` function. \n\n For example, let ``e`` be a ``StringEnumeration`` instance::\n\n [s for s in e] is a list of 'str' objects\n [s for s in iter(e.unext, None)] is a list of 'unicode' objects\n [s for s in iter(e.snext, None)] is a list of 'UnicodeString' objects\n\n - timezones\n\n The ICU ``TimeZone`` type may be wrapped with an ``ICUtzinfo`` type for\n usage with Python's ``datetime`` type. For example::\n\n tz = ICUtzinfo(TimeZone.createTimeZone('US/Mountain'))\n datetime.now(tz)\n\n or, even simpler::\n\n tz = ICUtzinfo.getInstance('Pacific/Fiji')\n datetime.now(tz)\n\n To get the default time zone use::\n\n defaultTZ = ICUtzinfo.getDefault()\n\n To get the time zone's id, use the ``tzid`` attribute or coerce the time\n zone to a string::\n\n ICUtzinfo.getInstance('Pacific/Fiji').tzid -> 'Pacific/Fiji'\n str(ICUtzinfo.getInstance('Pacific/Fiji')) -> 'Pacific/Fiji'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pyicu.osafoundation.org/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pyicu-praxa", "package_url": "https://pypi.org/project/pyicu-praxa/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyicu-praxa/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pyicu.osafoundation.org/" }, "release_url": "https://pypi.org/project/pyicu-praxa/1.7/", "requires_dist": null, "requires_python": null, "summary": "Python extension wrapping the ICU C++ API (Praxa fork)", "version": "1.7" }, "last_serial": 1050263, "releases": { "1.7": [ { "comment_text": "", "digests": { "md5": "3e188280f57f877f2cbac0fff8ef77be", "sha256": "e676055a85e36438836baca46d64c0f0ac27e648a8ce63e8088dc8fd8b36ccae" }, "downloads": -1, "filename": "pyicu-praxa-1.7.tar.gz", "has_sig": false, "md5_digest": "3e188280f57f877f2cbac0fff8ef77be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211442, "upload_time": "2014-04-03T14:38:41", "url": "https://files.pythonhosted.org/packages/c3/de/fecd3d717181c4de2d254924450b12f1ea8410f7a8d5c0d5f7195900a1e9/pyicu-praxa-1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3e188280f57f877f2cbac0fff8ef77be", "sha256": "e676055a85e36438836baca46d64c0f0ac27e648a8ce63e8088dc8fd8b36ccae" }, "downloads": -1, "filename": "pyicu-praxa-1.7.tar.gz", "has_sig": false, "md5_digest": "3e188280f57f877f2cbac0fff8ef77be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211442, "upload_time": "2014-04-03T14:38:41", "url": "https://files.pythonhosted.org/packages/c3/de/fecd3d717181c4de2d254924450b12f1ea8410f7a8d5c0d5f7195900a1e9/pyicu-praxa-1.7.tar.gz" } ] }