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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_module_datasets-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 c324d17048a2cd61db4546ac28305ed7f1d990210be99fc134fe35c2f509634a
MD5 cb9352a89b34d221c029dcde7b8ed86f
BLAKE2b-256 163d6c6d3466175436db21c912044c145538868de0b41ec81be8c4837e272d7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for simple_module_datasets-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df0456f93e25cb8126126e31c750cde122aeca8c42a33ce1b9a925253dfa0dd7
MD5 a91306901f1ad7486f8dca3bb48108d8
BLAKE2b-256 ede6c763106f3ef3b0bdfe168ce0c2f0ebfddd68a0a28c94598e1501c0c5bbcc

See more details on using hashes here.

Provenance

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