Skip to main content

Geospatial + tabular dataset upload, parsing (shapely) and slugging for simple_module apps

Project description

simple_module_datasets

Geospatial + tabular dataset upload module for simple_module apps. Users upload CSV/GeoJSON/Shapefile; the module parses, slugs a canonical name, and stores geometry using shapely.

Install

pip install simple_module_datasets

Also needs simple_module_file_storage + simple_module_background_tasks (declared as deps).

What it provides

  • POST /api/datasets — multipart upload; the file is staged via simple_module_file_storage, then a Celery job parses it in the background.
  • Dataset SQLModel record with name, slug (via python-slugify), geometry_type, row_count, bbox.
  • Shapely-backed parsers for GeoJSON, CSV with lat/lon columns, and zipped Shapefiles.
  • Admin UI for browsing + deleting datasets.

Usage

Upload from a form:

curl -X POST -F "file=@cities.geojson" http://localhost:8000/api/datasets

Query parsed datasets:

from datasets.service import DatasetService   # type: ignore[import-not-found]

async def list_by_bbox(svc: DatasetService = Depends(DatasetService), ...):
    return await svc.intersects(bbox=(-74.1, 40.6, -73.8, 40.9))

Depends on

  • simple_module_core, simple_module_db, simple_module_hosting
  • simple_module_file_storage, simple_module_background_tasks
  • shapely>=2.0, python-slugify>=8.0, celery>=5.4

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_module_datasets-0.0.1.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_module_datasets-0.0.1-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file simple_module_datasets-0.0.1.tar.gz.

File metadata

  • Download URL: simple_module_datasets-0.0.1.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for simple_module_datasets-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5a41580618689eebab4fdc5a179ad672a7d4dea9ca6072be858a7659b14dd9bb
MD5 81ddb48d2f6e0aa5b7772c101dcc9ef5
BLAKE2b-256 121a5620fd1871e0ee7c5284e3d2245b4b8cbb34591d11c435f30071eb5fa0b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_module_datasets-0.0.1.tar.gz:

Publisher: release.yml on antosubash/simple_module_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_module_datasets-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_module_datasets-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72d91eaeb845525ede339fc155157873516b4b912e1495be133aff44bbb510ab
MD5 9b9dc9fce09e4d6215e46b07b036f602
BLAKE2b-256 e07e5cfc9794661272084b08e383e573c426e285a3f8f0bef96095d1978ed02a

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_module_datasets-0.0.1-py3-none-any.whl:

Publisher: release.yml on antosubash/simple_module_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page