speedcurve¶
A python wrapper for around the SpeedCurve API v1. Heavily influenced by github3.py
Example Use¶
from speedcurve import SpeedCurve
sc = SpeedCurve(api_key='your-api-key-here')
# Get all sites for a user
sites = sc.sites()
# Get trends and all tests for a URL
urls = sc.urls()
# Get trends and chrome tests for a URL
urls = sc.url(browser='chrome')
# Get a test
test = sc.test(id='140317_BA_3W8')
# Get all the notes for the main site
notes = sc.notes()
# Add a note. Timestamp defaults to now()
note = sc.create_note(
note="Cleared CDN Cache",
detail="Testing origin response times"
)
# Add a deployment to default Site for API key
sc.add_deployment(
note="Code deployment",
detail="Triggered a deployment to test session capability"
)
# Add a deployment and trigger round of testing specified by site-id
sc.add_deployment(
site_id=123,
note="Code deployment",
detail="Triggered a deployment to test origin response times."""
)
Testing¶
Run pip install -r dev-requirements.txt
. You can then execute tox
.
Welcome to Speedcurve.py’s documentation!¶
API¶
-
class
speedcurve.
SpeedCurve
(api_key=None, session=None)¶ Stored session information.
-
add_deployment
(site_id=None, note=None, detail=None)¶ Add a deployment and trigger round of testing.
Parameters: - site_id (int) – (optional) site id to trigger deploy.
- note (string) – (required) short note used on site
- detail (string) – (optional) detail to display for more context
Returns:
-
get_deployment
(id=None)¶ Retrieve a deployment specified by id.
Params int id: (required) id of deployment Returns: Deployment
-
get_latest_deployment
()¶ Retrieve latest deployment.
Returns: Deployment
-
notes
()¶ Retrieve all notes for main site in User’ account.
Returns: Generator of Note
-
sites
()¶ Retrieve all sites for account.
-
-
class
speedcurve.tests.
Test
(json, session=None, api_key=None)¶ The
Test
object.
-
class
speedcurve.urls.
Url
(json, session=None, api_key=None)¶ The
Url
object.
-
class
speedcurve.deployments.
Deployment
(json, session=None, api_key=None)¶ Deployment class.