-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update docs Get schedules working Update example Update to allow ToO deletes Check minimal server version Add image download Cleanup * Add targname * Finalise new syntax * Finish API upgrading * Update tests * Update tests
- Loading branch information
1 parent
27ae189
commit fe8f966
Showing
20 changed files
with
4,790 additions
and
1,019 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "3fb54b95", | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import logging\n", | ||
"from winterapi import WinterAPI\n", | ||
"from winterapi.endpoints import BASE_URL" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "84869822", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"logging.getLogger(\"winterapi\").setLevel(\"DEBUG\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "b7024bc4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"winter = WinterAPI()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "25197a54", | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Using server http://winter.caltech.edu:82\n", | ||
"Pinging server: True\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(f\"Using server {BASE_URL}\") # Should show the URL of the API\n", | ||
"print(f\"Pinging server: {winter.ping()}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "88d1d907", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"User is [email protected]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"try:\n", | ||
" print(f\"User is {winter.get_user()}\")\n", | ||
"except KeyError:\n", | ||
" print(\"No user credentials found. Please add these first!\")\n", | ||
" winter.add_user_details(overwrite=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "f0dc0b3f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Uncomment to add new credentials\n", | ||
"# winter.add_user_details(user=x, password=y, overwrite=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"id": "64797375", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Found the following saved programs: ['2024A001']\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(f\"Found the following saved programs: {winter.get_programs()}\")\n", | ||
"if len(winter.get_programs()) == 0:\n", | ||
" print(\"No programs found. Add one to get started:\")\n", | ||
" winter.add_program(overwrite=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "42f4d81b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Uncomment to add additional programs\n", | ||
"winter.add_program(overwrite=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b16a0900", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# A fake local program I have created\n", | ||
"winter.get_program_details(\"202XA000\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "1023561f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "winterapi", | ||
"language": "python", | ||
"name": "winterapi" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.