semvec/pypi-packages huggingface dataset:
django-shapefileimport 1.0
Django APP to automate GeoDjango shapefile importations and management without affecting migrations.
License: BSD-3-Clause
Requires Python: >=3.6

# Django-shapefileimport

GeoDjango includes a helper function to import ESRI shapefiles to PostGIS enabled DB:  [LayerMapping]
It works as intended but it's still a boring process. Moreover, the usual importing procedure means creating new migrations for each imported shapefile. This is problably OK for sparse importings of a couple of shapefiles. But as I needed to manage many shapefiles and/or keep adding/deleting them it doesn't sounded to me very sane to keep afecting migration files (and migration history).
This APP proposes an alternative to manage such shapefiles:
- Adds shapefile ZIP import option in admin page. Imports will include feature fields.
- Loads shapefiles by name on demand without touching migrations (so you can use all nice GeoDjango API features)
- Delete shapefiles from admin panel
- Option to keep or discard uploaded ZIP files while importing to DB

## Installation
Clone this repo:
```sh
git clone https://github.com/Rodrigo-NH/django-shapefileimport
```
Enter the 'django-shapefileimport' directory, install de dependencies, enter shell and start a new project (For simplicity I reccomend keeping the ending dot at the django-admin startproject command, it makes project folder to be created at same level as the APP [not nested])
```sh
pipenv install
pipenv shell
django-admin startproject mysite .
```
edit './mysite/settings.py' and add to INSTALLED_APPS:
```sh
'django.contrib.gis',
'shapefileimport'
```
Still at './mysite/settings.py', configure the database connection:
```py
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'shapeimportsDB',
'USER': 'geo',
'HOST': '192.168.0.40',
'PORT': '5432',
'PASSWORD': 'dbpassword',
#'CONN_MAX_AGE': 0,
},
}
```
Run migrations, create superuser and start the APP:
```sh
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```
It must be done at this point. Enter admin panel and start importing your shapefiles.
After importing, use 'loadShape()' function to load the shapefile and use. Example:
```sh
from shapefileimport.shapetasks import loadShape
from django.core.serializers import serialize
ds = loadShape('MyShapeName')
ff = serialize('geojson', ds.objects.all(), geometry_field='geom',)
```

## Notes
- You must have a propper GeoDjango setup environment, refer to https://docs.djangoproject.com/en/3.2/ref/contrib/gis/
- You must have PostGIS enabled, refer to https://postgis.net/install/
- This APP uses GeoDjango's LayerMapping helper to extract fields among other operations
- Only tested against PostreSQL

[LayerMapping]: https://docs.djangoproject.com/en/3.2/ref/contrib/gis/layermapping/
Werkzeug-zack 0.16.1.1
The comprehensive WSGI web application library.
License: BSD-3-Clause
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*

Werkzeug
========

*werkzeug* German noun: "tool". Etymology: *werk* ("work"), *zeug* ("stuff")

Werkzeug is a comprehensive `WSGI`_ web application library. It began as
a simple collection of various utilities for WSGI applications and has
become one of the most advanced WSGI utility libraries.

It includes:

-   An interactive debugger that allows inspecting stack traces and
    source code in the browser with an interactive interpreter for any
    frame in the stack.
-   A full-featured request object with objects to interact with
    headers, query args, form data, files, and cookies.
-   A response object that can wrap other WSGI applications and handle
    streaming data.
-   A routing system for matching URLs to endpoints and generating URLs
    for endpoints, with an extensible system for capturing variables
    from URLs.
-   HTTP utilities to handle entity tags, cache control, dates, user
    agents, cookies, files, and more.
-   A threaded WSGI server for use while developing applications
    locally.
-   A test client for simulating HTTP requests during testing without
    requiring running a server.

Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up
to the developer to choose a template engine, database adapter, and even
how to handle requests. It can be used to build all sorts of end user
applications such as blogs, wikis, or bulletin boards.

`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while
providing more structure and patterns for defining powerful
applications.


Installing
----------

Install and update using `pip`_:

.. code-block:: text

    pip install -U Werkzeug


A Simple Example
----------------

.. code-block:: python

    from werkzeug.wrappers import Request, Response

    @Request.application
    def application(request):
        return Response('Hello, World!')

    if __name__ == '__main__':
        from werkzeug.serving import run_simple
        run_simple('localhost', 4000, application)


Links
-----

-   Website: https://palletsprojects.com/p/werkzeug/
-   Documentation: https://werkzeug.palletsprojects.com/
-   Releases: https://pypi.org/project/Werkzeug/
-   Code: https://github.com/pallets/werkzeug
-   Issue tracker: https://github.com/pallets/werkzeug/issues
-   Test status: https://dev.azure.com/pallets/werkzeug/_build
-   Official chat: https://discord.gg/t6rrQZH

.. _WSGI: https://wsgi.readthedocs.io/en/latest/
.. _Flask: https://www.palletsprojects.com/p/flask/
.. _pip: https://pip.pypa.io/en/stable/quickstart/