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.3.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.3-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_module_datasets-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 b87c13cd8f81cc12d2dc6522fa35cf44b2f97e0899467706fc483857c85f75a7
MD5 6e129d621bb6a809d0615a0fc890bba4
BLAKE2b-256 f46fa2880c36f04ad4dd1a2fe20d3aecf5feaf6a34f6b73e4a4197ada974a25e

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_module_datasets-0.0.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_module_datasets-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e267539c4b559061eff9ef0ffa9bca4b48786e7889f109a84628e9b187e46140
MD5 b236b17eda1fa32657d05a020289cf6e
BLAKE2b-256 abafd8c1c176e7a69a46d0d3f081a008d39c4eab897a52a4a1063bfc893ac06b

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_module_datasets-0.0.3-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