{
"info": {
"author": "\u0141ukasz Banasiak",
"author_email": "lukas.banasiak@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "===================\ndjango-cities-teryt\n===================\n\nPolish region and city data for Django.\n\nThis app provides models, admin integration and commands to import region and city data in your database.\n\nThe data is pulled from `TERYT `_ database\n(National Official Register of the Territorial Division of the Country). TERYT is maintained by\nPolish Central Statistical Office (`GUS `_)\n\nDatabase contains:\n - provinces\n - counties\n - municipalities\n - villages\n - cities\n - city districts\n\nInstallation\n------------\n\nInstall django-cities-teryt\n\n.. code:: bash\n\n pip install django-cities-teryt\n\nOr dev version\n\n.. code:: bash\n\n pip install -e git+git@github.com:lukaszbanasiak/django-cities-teryt.git#egg=cities_teryt\n\nAdd ``cities_teryt`` to your ``INSTALLED_APPS``\n\n.. code:: python\n\n INSTALLED_APPS = (\n ...\n 'cities_teryt',\n )\n\nNow, run ``syncdb``, it will only create tables for models\n\n.. code:: bash\n\n ./manage.py syncdb\n\nConfiguration\n-------------\n\n1. Download ``SIMC`` and ``TERC`` xml files from TERYT website http://www.stat.gov.pl/broker/access/prefile/listPreFiles.jspa and save them to one directory.\n2. Setup in your ``settings.py`` full path to above directory\n\n.. code:: python\n\n # Default directory is `import` dir in `django-cities-teryt` app directory\n CITIES_TERYT_IMPORT_DIR = '/path/to/dir'\n\nImporting data\n--------------\n\nTo populate your database with all TERYT data use command\n\n.. code:: bash\n\n ./manage.py cities_teryt --data all --import\n\nTo remove data use command\n\n.. code:: bash\n\n ./manage.py cities_teryt --data all --flush\n\nTo operate on specific type of data enumerate them after ``--data`` argument\n\n.. code:: bash\n\n ./manage.py cities_teryt --data province, county, municipality --import\n ./manage.py cities_teryt --data city, village, district --flush\n\nNotice\n^^^^^^\nData have relations so it's best to import everything.\nData are large and take time to import (there's no progress display).\nVerbosity is controlled through LOGGING.\n\nExamples\n--------\n\nGet ``City`` by name\n\n.. code:: python\n\n >>> City.objects.get(name='Swarz\u0119dz')\n \n\nTo get name of ``Municipality`` of this City we can use ``parent`` method or call directly ``municipality`` attrib\n\n.. code:: python\n\n >>> City.objects.get(name='Swarz\u0119dz').parent\n \n >>> City.objects.get(name='Swarz\u0119dz').municipality\n \n >>> Municipality.objects.get(city__name='Swarz\u0119dz')\n \n\nIn this way we can get also ``Province`` or ``County``\n\n.. code:: python\n\n >>> City.objects.get(name='Swarz\u0119dz').province\n \n >>> Province.objects.get(city__name='Swarz\u0119dz')\n \n\n... or even ``Districts``\n\n.. code:: python\n\n >>> c = City.objects.get(name='Swarz\u0119dz')\n >>> c.district_set.all()\n [, ]\n >>> District.objects.filter(city=c)\n [, ]\n\nList all ``Cities`` in the same ``County``\n\n.. code:: python\n\n >>> County.objects.get(city__name='Swarz\u0119dz').city_set.all()\n [, , , , , , , , , ]\n\nGet pretty display name\n\n.. code:: python\n\n # Village, Municipality, County, Province\n >>> print Village.objects.get(name='Kaczkowo', province__name='wielkopolskie').get_display_name()\n Kaczkowo, Rydzyna, leszczy\u0144ski, wielkopolskie\n # `Municipality` and `County` for \"Pozna\u0144\" is the same so we got only `City` and `Province` name\n >>> print City.objects.get(name='Pozna\u0144').get_display_name()\n Pozna\u0144, wielkopolskie\n\nRequirements\n------------\n\nSee ``requirements.txt``",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/lukaszbanasiak/django-cities-teryt",
"keywords": "django cities teryt gus provinces counties municipalities villages districts",
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "django-cities-teryt",
"package_url": "https://pypi.org/project/django-cities-teryt/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/django-cities-teryt/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/lukaszbanasiak/django-cities-teryt"
},
"release_url": "https://pypi.org/project/django-cities-teryt/1.0.1/",
"requires_dist": null,
"requires_python": null,
"summary": "Polish region and city data for Django.",
"version": "1.0.1"
},
"last_serial": 1244529,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "d1da65d7989ca697518511bf460a650e",
"sha256": "476316418853596f4e8886704f5a4de859813c625b0f9cb0bd2f502a260836af"
},
"downloads": -1,
"filename": "django-cities-teryt-1.0.0.zip",
"has_sig": false,
"md5_digest": "d1da65d7989ca697518511bf460a650e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13859,
"upload_time": "2014-10-01T13:59:11",
"url": "https://files.pythonhosted.org/packages/2f/86/57787a6c80d495c11baf24a3f72f053f3a2b8e11d9cdb394320d8f6063b5/django-cities-teryt-1.0.0.zip"
}
],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "8942f07e7b2531eddfbb219f541ba655",
"sha256": "4cd9ec1fa8474a248ea72c18eb089e7ce59860a1ff8fcd659bf19b964c9d8aad"
},
"downloads": -1,
"filename": "django-cities-teryt-1.0.1.zip",
"has_sig": false,
"md5_digest": "8942f07e7b2531eddfbb219f541ba655",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13879,
"upload_time": "2014-10-01T15:51:58",
"url": "https://files.pythonhosted.org/packages/38/5b/5d8b7990bb612596630470da6f2782558359497c3468f351281d4bd05f12/django-cities-teryt-1.0.1.zip"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "8942f07e7b2531eddfbb219f541ba655",
"sha256": "4cd9ec1fa8474a248ea72c18eb089e7ce59860a1ff8fcd659bf19b964c9d8aad"
},
"downloads": -1,
"filename": "django-cities-teryt-1.0.1.zip",
"has_sig": false,
"md5_digest": "8942f07e7b2531eddfbb219f541ba655",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13879,
"upload_time": "2014-10-01T15:51:58",
"url": "https://files.pythonhosted.org/packages/38/5b/5d8b7990bb612596630470da6f2782558359497c3468f351281d4bd05f12/django-cities-teryt-1.0.1.zip"
}
]
}