{ "info": { "author": "Luc Saffre", "author_email": "luc.saffre@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "====================================\nThe ``commondata`` namespace package\n====================================\n\nNote: we are discussing whether this package is meaningful. See\nhttp://lino-framework.org/tickets/109.html\n\nThis package is the heart of \"common data\", a sustainable way of\nmaintaining and sharing structured common knowledge. The Python\npackage itself contains just some utilities_ and defines the\n``commondata`` namespace. It is the base for packages like\n\n- `commondata.be `_ : \n Common knowledge about Belgium\n- `commondata.ee `_: \n Common knowledge about Estonia\n- `commondata.eg `_: \n Common knowledge about Egypt\n\nFeatures\n========\n\n\nMaintained in Python\n--------------------\n\nThe Python programming language brings together two qualities \n\n- a syntax which makes it easy (or at least possible) to be used by\n non-programmers\n- a powerful programming language working behind the scenes\n\n\nFreely available under the GPL\n------------------------------\n\nFree software should not depend on non-free material.\n\nDesigned to be imported\n-----------------------\n\nThe library does **not** provide much querying functionality. Just\nthe basic minimum, used to write test cases. This is a design\nchoice. This data is meant to be imported into existing systems which\noffer their own querying facilities.\n\n\nInstallation\n============\n\n- The easiest way is to type::\n\n pip install commondata.ee commondata.be\n\n- Alternatively you might prefer to use the development version::\n\n $ git clone https://github.com/lsaffre/commondata.git\n $ git clone https://github.com/lsaffre/commondata-ee.git\n $ git clone https://github.com/lsaffre/commondata-be.git\n\n $ pip install -e commondata\n $ pip install -e commondata.ee\n $ pip install -e commondata.be\n\nOnline version of this document on https://github.com/lsaffre/commondata\n\n\nUtilities\n=========\n\nHow to use the Place and PlaceGenerator classes.\n\nYou define a subclass of Place for each \"type\" of place:\n\n>>> from commondata.utils import Place, PlaceGenerator\n>>> class PlaceInFoo(Place):\n... def __str__(self):\n... return self.name\n>>> class Kingdom(PlaceInFoo):\n... value = 1\n>>> class County(PlaceInFoo):\n... value = 2\n>>> class Borough(PlaceInFoo):\n... value = 3\n>>> class Village(PlaceInFoo):\n... value = 3\n\nThe PlaceGenerator is used to instantiate to populate\n\nPart 1 : configuration:\n\n>>> pg = PlaceGenerator()\n>>> pg.install(Kingdom, County, Borough, Village)\n>>> pg.set_args('name')\n\nPart 2 : filling data\n\n>>> root = pg.kingdom(\"Kwargia\")\n>>> def fill(pg):\n... pg.county(\"Kwargia\")\n... pg.borough(\"Kwargia\")\n... pg.village(\"Virts\")\n... pg.village(\"Vinks\")\n... pg.county(\"Gorgia\")\n... pg.village(\"Girts\")\n... pg.village(\"Ginks\")\n\n>>> fill(pg)\n\nPart 3 : using the data\n\n>>> [str(x) for x in root.children]\n['Kwargia', 'Gorgia']\n>>> kwargia = root.children[0]\n>>> [str(x) for x in kwargia.children]\n['Kwargia', 'Virts', 'Vinks']\n\n\nMultilingual place names\n-------------------------\n\nYou use the `commondata.utils.PlaceGenerator.set_args()` method to\nspecify the names of the fields of subsequent places.\n\n>>> pg = PlaceGenerator()\n>>> pg.install(Kingdom, County, Borough, Village)\n>>> pg.set_args('name name_ar')\n>>> root = pg.kingdom(\"Egypt\", u'\\u0645\\u0635\\u0631')\n>>> print(root.name_ar)\n\u0645\u0635\u0631", "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/lsaffre/commondata", "keywords": null, "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "commondata", "package_url": "https://pypi.org/project/commondata/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/commondata/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/lsaffre/commondata" }, "release_url": "https://pypi.org/project/commondata/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "A structured collection of common knowledge", "version": "0.0.2" }, "last_serial": 4195129, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a952b45c1bd89c124308b11e1e74afe8", "sha256": "e18a25ca4b9939cb69ef75a500025d3efc710d6a9752556775a89990df336ad7" }, "downloads": -1, "filename": "commondata-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a952b45c1bd89c124308b11e1e74afe8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3156, "upload_time": "2014-09-11T23:35:50", "url": "https://files.pythonhosted.org/packages/ce/54/15920abfa15983a9015ce4b81d60baf78a1c158e3d56563bcbe13ccfe304/commondata-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "f7a7803fcfa557b25a22dc70b5b3712f", "sha256": "249d22e288532fb3364648b7b389b267d73b5867149ebc2fae1b03bc241f658a" }, "downloads": -1, "filename": "commondata-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f7a7803fcfa557b25a22dc70b5b3712f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4134, "upload_time": "2016-08-21T03:02:37", "url": "https://files.pythonhosted.org/packages/0d/62/5bc9340f4043be75f0c9dc18b1efa54eab6b7c717e19141bf2b08038a9a3/commondata-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7a7803fcfa557b25a22dc70b5b3712f", "sha256": "249d22e288532fb3364648b7b389b267d73b5867149ebc2fae1b03bc241f658a" }, "downloads": -1, "filename": "commondata-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f7a7803fcfa557b25a22dc70b5b3712f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4134, "upload_time": "2016-08-21T03:02:37", "url": "https://files.pythonhosted.org/packages/0d/62/5bc9340f4043be75f0c9dc18b1efa54eab6b7c717e19141bf2b08038a9a3/commondata-0.0.2.tar.gz" } ] }