Closed Eh2406 closed 7 years ago
Hi,
I guess you have to get the dataset, delete it and reupload it. It should be something like this:
from carto.datasets import DatasetManager
from carto.auth import APIKeyAuthClient
USERNAME="type here your username"
ORGANIZATION="type here your organization"
BASE_URL = "https://{organization}.carto.com/user/{user}/". \
format(organization=ORGANIZATION,
user=USERNAME)
auth_client = APIKeyAuthClient(api_key="myapikey", base_url=BASE_URL, organization=ORGANIZATION)
# write here the name of the dataset to overwrite
DATASET_ID = ""
dataset_manager = DatasetManager(auth_client)
dataset = dataset_manager.get(DATASET_ID)
dataset.delete()
# write here the path to a local file or remote URL
LOCAL_FILE_OR_URL = ""
dataset = dataset_manager.create(LOCAL_FILE_OR_URL)
Thank you for that workaround. That really gets us moving on this project. cartoframes lets me upload it with a different name than the file, but I can just rename the file before uploading.
I spent some time trying to find how carto frames accomplishes it, but I don't see the call to delete.
Hi,
I have a csv that I want to upload to my account. I am using the overwrite arg in cartoframes.
How can I do the equivalent using the carto-python library directly?