{ "info": { "author": "Makina Corpus", "author_email": "terralego-pypi@makina-corpus.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# Django GEOSource\n\nThis django application provide a Rest Framework API that allow to manage many geo data\nsources and integrate that data wherever you need, like a Django model or any output\npipeline. Its provided with necessary celery jobs that do the job.\n\n\n## Configure and run Celery\n\nYou must define in your project settings the variables CELERY_BROKER_URL and CELERY_RESULT_BACKEND as specified in Celery documentation.\n\nTo run the celery worker:\n`$ celery worker -A django_geosource -l info`\n\nTo run the celery beat worker that allow to synchronize periodically sources, launch this command:\n`$ celery beat --scheduler django_geosource.celery.schedulers.GeosourceScheduler -A django_geosource -l info`\n\n## Configure data destination\nNow, you must set the callback methods that are used to insert data in your destination database.\n\n### GEOSOURCE_LAYER_CALLBACK\nThe callback signature receive as first argument the SourceModel object, and must return your Layer object.\nExample:\n```python\ndef layer_callback(geosource):\n return Layer.objects.get_or_create(name=geosource.name)[0]\n```\n\n### GEOSOURCE_FEATURE_CALLBACK\nThis one, define a feature creation callback method.\nExample:\n```python\ndef feature_callback(geosource, layer, identifier, geometry, attributes):\n return Feature.objects.get_or_create(layer=layer, identifier=identifier, geom=geometry, properties=attributes)[0]\n```\n\n### GEOSOURCE_CLEAN_FEATURE_CALLBACK\nThis callback is called when the refresh is done, to clear old features that are not anymore present in the database.\nIt receives as parametter the geosource, layer and begin update date, so you can advise what to do depending of your\nmodels.\nExample:\n```python\ndef clear_features(geosource, layer, begin_date):\n return layer.features.filter(updated_at__lt=begin_date).delete()\n```\n\n### GEOSOURCE_DELETE_LAYER_CALLBACK\nThis is called when a Source is deleted, so you are able to do what you want with the loaded content in database, when\nthe source doesn't exist anymore. It's executed before real deletion.\nExample:\n```python\ndef delete_layer(geosource, layer):\n if layer.features.count() > 0:\n layer.features.delete()\n return layer.delete()\n```\n\n\n0.3.0 (2019-10-18)\n-----------------------\n\n### Release\n\n* First release\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Terralego/django-geosource.git", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-geosource", "package_url": "https://pypi.org/project/django-geosource/", "platform": "", "project_url": "https://pypi.org/project/django-geosource/", "project_urls": { "Homepage": "https://github.com/Terralego/django-geosource.git" }, "release_url": "https://pypi.org/project/django-geosource/0.3.0/", "requires_dist": [ "Django (<3.0,>=2.2)", "Fiona (<1.9,>=1.8)", "celery (<4.4,>=4.3)", "django-polymorphic (<2.1,>=2.0)", "djangorestframework (<3.9,>=3.8)", "psycopg2 (>=2.7)" ], "requires_python": "", "summary": "Django geographic asynchrone data sources loading", "version": "0.3.0" }, "last_serial": 5995551, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "973c2320613887c302a3fb7711a36314", "sha256": "40cb6bcece17867532d38133ccc10489b2c332d7c968c5a0ecb5c08a3d1c2f97" }, "downloads": -1, "filename": "django_geosource-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "973c2320613887c302a3fb7711a36314", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30447, "upload_time": "2019-10-18T13:00:26", "url": "https://files.pythonhosted.org/packages/c6/ed/01bcbbfc531472f8202dca8c8684e847dee6022ab642fa2f21025864edb2/django_geosource-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df55baaaeded6bce799dc84e597262a2", "sha256": "4897fd7c45722bae86edf721d4fda42dfff8e6d154e5e9408e52af472a21cf5b" }, "downloads": -1, "filename": "django-geosource-0.3.0.tar.gz", "has_sig": false, "md5_digest": "df55baaaeded6bce799dc84e597262a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18187, "upload_time": "2019-10-18T13:00:28", "url": "https://files.pythonhosted.org/packages/48/6c/074543eaaff693ea3f111c733411f1e74be52c14b023c3131db707d67e52/django-geosource-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "973c2320613887c302a3fb7711a36314", "sha256": "40cb6bcece17867532d38133ccc10489b2c332d7c968c5a0ecb5c08a3d1c2f97" }, "downloads": -1, "filename": "django_geosource-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "973c2320613887c302a3fb7711a36314", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30447, "upload_time": "2019-10-18T13:00:26", "url": "https://files.pythonhosted.org/packages/c6/ed/01bcbbfc531472f8202dca8c8684e847dee6022ab642fa2f21025864edb2/django_geosource-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df55baaaeded6bce799dc84e597262a2", "sha256": "4897fd7c45722bae86edf721d4fda42dfff8e6d154e5e9408e52af472a21cf5b" }, "downloads": -1, "filename": "django-geosource-0.3.0.tar.gz", "has_sig": false, "md5_digest": "df55baaaeded6bce799dc84e597262a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18187, "upload_time": "2019-10-18T13:00:28", "url": "https://files.pythonhosted.org/packages/48/6c/074543eaaff693ea3f111c733411f1e74be52c14b023c3131db707d67e52/django-geosource-0.3.0.tar.gz" } ] }