[GIS] Adding shapefile directly to geoserver

geoserverpostgispython

I have py script which is creating shapefiles using shapefile.py. Once the shapefile is created I have to add them manually to the geoserver. Is there a way to add it dynamically to the geoserver? through postgis or something?

UPDATE

Ok so seems my project manager has changed his plan, he wants me to add the shapefiles to the PostGIS Database which will update the newly added shapefiles to the geoserver where there will be a connection to the PostGIS Database. Is it possible to update the newly added shapefiles to reflect in the Geoserver?

Best Answer

You can use the REST API of GeoServer.

The REST extension provides a RESTful interface through which clients can configure a GeoServer instance through simple HTTP calls. With it clients can programatically configure the data served by GeoServer.

This example explains how to upload a shapefile in GeoServer using cURL.