Metadata-Version: 1.0
Name: gocept.country
Version: 0.1
Summary: Zope 3 sources for pycountry databases
Home-page: http://pypi.python.org/pypi/gocept.country/
Author: Sebastian Wehrmann, Christian Theune
Author-email: sw@gocept.com
License: ZPL 2.1
Description: This package lets you use the `pycountry database
        <http://pypi.python.org/pypi/pycountry/>`_ within Zope 3.
        
        
        In practice, this means e.g., that you can easily get a zope.schema.Choice
        field to provide a full list of iso 3166 country codes.
        
        For more information about the database please refer to the
        `pycountry product <http://pypi.python.org/pypi/pycountry/>`_.
        
        
        ==============
        gocept.country
        ==============
        
        
        gocept.country provides Zope 3 sources for the pycountry databases. You can
        use it e.g. to get a zope.schema.Choice field with all iso 3166 countries.
        
        >>> import gocept.country
        
        
        ISO 3166 countries
        ==================
        
        For the iso 3166 countries, use the gocept.pycountry.countries sourcefactory:
        
        >>> country_source = gocept.country.countries
        >>> country_source
        <zc.sourcefactory.source.FactoredSource object at 0x...>
        
        
        Use the getValues() method to get an countries iterator:
        
        >>> country_iterator = country_source.factory.getValues()
        >>> country_iterator
        <listiterator object at 0x...>
        
        
        That iterator can be used to retrieve the countries:
        
        >>> afghanistan = country_iterator.next()
        >>> afghanistan
        <pycountry.db.Country object at 0x...>
        
        
        The method getTitle(country) returns the iso 3166 name of a country.
        getToken(country) returns the alpha 2 value of the given country.
        
        >>> country_source.factory.getTitle(afghanistan)
        u'Afghanistan'
        >>> country_source.factory.getToken(afghanistan)
        'AF'
        
        
        ISO 639 languages
        =================
        
        The iso 639 languages are available similar to the countries:
        
        >>> afar = gocept.country.languages.factory.getValues().next()
        >>> afar
        <pycountry.db.Language object at 0x...>
        >>> gocept.country.languages.factory.getTitle(afar)
        u'Afar'
        >>> gocept.country.languages.factory.getToken(afar)
        'aa'
        
        
        ISO 15924 scripts
        =================
        
        The iso 14924 scripts are available similar to the countries:
        
        >>> arabic = gocept.country.scripts.factory.getValues().next()
        >>> arabic
        <pycountry.db.Script object at 0x...>
        >>> gocept.country.scripts.factory.getTitle(arabic)
        u'Arabic'
        >>> gocept.country.scripts.factory.getToken(arabic)
        'Arab'
        
        
        ISO 4217 currencies
        ===================
        
        The iso 4217 currencies are available similar to the countries:
        
        >>> dirham = gocept.country.currencies.factory.getValues().next()
        >>> dirham
        <pycountry.db.Currency object at 0x...>
        >>> gocept.country.currencies.factory.getTitle(dirham)
        u'UAE Dirham'
        >>> gocept.country.currencies.factory.getToken(dirham)
        'AED'
        
        
        Changes
        =======
        
        
        0.2 (unreleased)
        ------------------
        
        
        0.1 (2008-05-20)
        ------------------
        
        - initial release
        
Keywords: country subdivision language currency iso 3166 639 4217 15924 3166-2 zope
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
