Skip to main content

A Python wrapper for the MapHub API

Project description

MapHub

PyPI Version PyPI Downloads

Installation

pip

pip install maphub

Usage

Python package

This example demonstrates how to upload a Map from the local path to a MapHub folder with the name France.

from maphub import MapHubClient

client = MapHubClient(api_key="your-api-key")
personal_workspace = client.workspace.get_personal_workspace()
root_folder = client.folder.get_root_folder(personal_workspace["id"])
france_folder = client.folder.create_folder("France", root_folder["folder"]["id"])

client.maps.upload_map(
    map_name="France Population",
    folder_id=france_folder['id'],
    public=False,
    path="path/to/GIS/data.gpkg"
)

Note: The direct endpoint methods (e.g., client.create_project(), client.upload_map()) are deprecated and will be removed in a future version. Use the endpoint classes instead (e.g., client.folder.create_folder(), client.map.upload_map()).

CLI

The MapHub CLI provides a command-line interface for interacting with the MapHub API. It allows you to authenticate with an API key and upload maps to your folders.

Authentication

Before using the CLI, you need to authenticate with your MapHub API key:

maphub auth YOUR_API_KEY

This will save your API key to ~/.maphub/config.json for future use.

Uploading Maps

To upload a GIS file to your root folder:

maphub upload path/to/your/file.gpkg

The map name will be extracted from the file name (without extension).

To upload a GIS file to a specific folder:

maphub upload path/to/your/file.gpkg --folder-id YOUR_FOLDER_ID

If you don't specify a folder ID, the map will be uploaded to your root folder.

To upload a GIS file with a custom map name:

maphub upload path/to/your/file.gpkg --map-name "My Custom Map Name"

If you don't specify a map name, it will be extracted from the file name (without extension).

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

maphub-0.2.4.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

maphub-0.2.4-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file maphub-0.2.4.tar.gz.

File metadata

  • Download URL: maphub-0.2.4.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for maphub-0.2.4.tar.gz
Algorithm Hash digest
SHA256 757450fce19a707288beb536ed73c1c45e7f65479a75e6ded0f5c51d87094b35
MD5 f68d7a1a9eb683a18bdd64245a7494a0
BLAKE2b-256 51f96415bd55d54b2d90f3a2474f47ebc61e5d0fb160f2c9239e86bd2038641a

See more details on using hashes here.

File details

Details for the file maphub-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: maphub-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for maphub-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 305473be1895b8a85fb8169e5ae60ad5ac0d4562d108a3173f09f897f43830f4
MD5 f846eda2090966a4751912863e1a8f33
BLAKE2b-256 a7583f23614221c5e85ecfebeaaf87098e40970d4bb979e511ea63f98f2c671e

See more details on using hashes here.

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