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)
Get related maps for a specific map
cartes.Maps('048eebe4-8dac-46e2-a947-50b6b8062fec').related().get()
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.6.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for py_cartes_io-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c85bb894087db01364222d43f8890ae88d6c82c615acd14ec09c1840f504ce3 |
|
MD5 | 6dc48c634d588f8cadebb186bcfe0480 |
|
BLAKE2b-256 | 827d3a251989c47e740d3e7fd0e0145d2e68cc137c953032381d94d35dad9a5b |