Skip to content

Sites Python Client — User Documentation

Sites Python Client (sites-toolkit) is a Python library for managing websites hosted on the ECMWF Sites platform. With it you can create and configure sites, upload or download content, control who has access, generate temporary tokens, produce signed links, and more — all from Python code or automated scripts.


What can I do with this library?

Task What it means
Manage sites Create, update, enable, disable, and delete websites on the platform
Upload & download content Push files from your computer to a site, pull files back, or list what's there
Verify file integrity Retrieve SHA-256 checksums and verify downloads against server-reported digests
Control access Configure which users and groups can read or write to a site
Issue access tokens Generate short-lived bearer tokens so scripts and integrations can access your site's API
Create signed URLs Produce time-limited, shareable links for individual files on a private site
Create symlinks Add shortcuts inside a site that point to other files or directories
Clone sites Copy an entire site's content to another site in one call
Advanced hosting Run custom Docker applications behind your site

Documentation pages

Page What you'll learn
Getting Started How to install the library and run your first script
Authentication All the ways to prove who you are: password, token, environment variables
Site Management Create, update, list, enable, disable, and delete sites
Content Management Upload, download, list, and delete files inside a site
Access Tokens Generate, inspect, revoke, and audit access tokens for a site
Signed URLs Create and verify time-limited public links to files on a private site
Symlinks Create shortcuts to files or directories inside a site
Advanced Topics Cloning sites, custom apps, CORS, WebDAV, robots.txt
API Reference Quick-reference tables for every class and method

Quick example

from sites.sdk import SitesClient
from sites.sdk.sites import Site, Authenticator

# Authenticate with your username and password
authenticator = Authenticator.from_credentials(username='myuser', password='mypassword')

# Connect to the platform
client = SitesClient(authenticator=authenticator)

# Confirm who you are
print(client.whoami())

# Create a site
site = Site.from_space_and_name(space='docs', name='hello-world')
site.description = 'My first site'
client.create_site(site=site)

# Upload a file
content_manager = site.get_content_manager()
content_manager.upload(local_path='./index.html')

Additional Resources