A Unoffical API for OctoEverywhere
Project description
OctoEverywhereAPI
Login into OctoEverywhere and use it in your app, instead of NGROK
We keep the docs of old version here
Usage
Import
from octoeverywhere import OctoEverywhere
octo = OctoEverywhere("email@example.com", "password")
Get current session cookie:
session = octo.currentCookie
Get new session cookie:
session = octo.getSessionCookie("email@example.com", "password")
If we inserted correct login info, we should get something like this:
'dnmdmkjasnmkjkj644kJhjjhhHSIJSAjJKHKJAJSJIUEWUEHXSHWETWQZROO94UZZW'
Otherwise, an exception will be thrown:
Incorrect login info with status code of 400
Get printer info:
You can get Printer IDs, with getUserInfo()
function.
printer = octo.getPrinterInfo("<your printer ID>")
If we inserted correct login info, we should get something like this:
{'Error': '', 'Status': 200, 'Result': {'Id': '<your printer ID>', 'Name': 'example', 'Owners': ['test@example.com'], 'LastConnectionTime': '2021-03-30T15:33:23.4649623Z', 'LastDisconnectTime': '2021-03-30T15:33:13.9014383Z'}}
Otherwise, a following JSON will be thrown:
{'Error': 'No printer found', 'Status': 404, 'Result': None}
Get user info
user = octo.getUserInfo()
Response:
{'Error': '', 'Status': 200, 'Result': {'Email': 'test@example.com', 'PrinterIds': ['<printer ID>'], 'IsMfaEnabled': False, 'HasSeenFirstTimePortalCredsMessage': True}}
Get OctoEverywhere Statistics for their website
stats = octo.getStats()
Response:
{'Error': '', 'Status': 200, 'Result': {'Stats': {'ConnectedPrinters': 5476, 'WebcamMinutesStreamtedInLast24Hours': 3172}}}
Get Messages
messages = octo.getMessages()
Response:
{'Error': '', 'Status': 200, 'Result': {'MessageId': 0, 'HtmlString': None, 'NeedsAck': False, 'OverridePrinterErrors': False}}
Example
Full example is avaiable in test2.py
file
To Do
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
Built Distribution
Close
Hashes for OctoEverywhereAPI-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c279c189e51b24fe2349e14fc979f1b2c0165fa87901d9fd14773aeabdecf8fa |
|
MD5 | b2e4100f48e35ffff1b2f4fc400f9403 |
|
BLAKE2b-256 | 3f03bef2a7ffaf310bd91f72ecada45420969ad714e1578722260b81de3243d4 |