Skip to main content

Cartes.io official Python API wrapper

Project description

Official Cartes.io Python package

Usage

Install Cartes.io Python package:

pip install py-cartes-io

First, import the package:

import py_cartes_io as cartes

Create a map

newMap = cartes.Maps().create()
print(newMap['uuid'])
print(newMap['token'])

Get a list of maps

cartes.Maps().get()

You can use the add_param method to add parameters to the request, especially useful for pagination:

cartes.Maps().add_param('page', 2).get()

# There is also a shorthand for this
cartes.Maps().page(2).get()

Get a specific map

cartes.Maps('048eebe4-8dac-46e2-a947-50b6b8062fec').get()

Get a maps markers

cartes.Maps('048eebe4-8dac-46e2-a947-50b6b8062fec').markers().get()

You can also add parameters to the request with add_param method:

map = cartes \
    .Maps('651107a9-1d22-46a8-8254-111f7ac74a2b') \
    .markers() \
    .add_param('show_expired', True) \
    .get()

print(map)

Create markers

params = {
    'lat': row['lat'],
    'lng': row['lng'],
    'description': row['description'],
    'category_name': row['category_name'],
    'link': row['link']
}

cartes.Maps('048eebe4-8dac-46e2-a947-50b6b8062fec').markers().create(params)

# you can also pass a map_token (or api_key) if your map settings require it
cartes.Maps('048eebe4-8dac-46e2-a947-50b6b8062fec', map_token="xxx").markers().create(params)

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

py_cartes_io-0.0.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

py_cartes_io-0.0.5-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file py_cartes_io-0.0.5.tar.gz.

File metadata

  • Download URL: py_cartes_io-0.0.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for py_cartes_io-0.0.5.tar.gz
Algorithm Hash digest
SHA256 cd6e41de4d95663c7b9e6a3ade9d3859b56f8475df8d01bbf8058de046484c40
MD5 84aeb7361c8c473437c020fe0a805eb7
BLAKE2b-256 667a4e538c6facafc442f925a7a98aa2e634d0868ccd48c8d84005241b05ea57

See more details on using hashes here.

File details

Details for the file py_cartes_io-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: py_cartes_io-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for py_cartes_io-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2ba06187bf4ffb6401cfd3f0223c1fd945c820f6e12e90ec8cb20ef26c14bf39
MD5 a272b56a8f6c6ed1a6e3a8ae6260bb92
BLAKE2b-256 3700b3dc8000b11ffd1a5d3af74cf106a9f16c0b8f2edcfa781fc50e62b27de5

See more details on using hashes here.

Supported by

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