{"id":15017309,"url":"https://github.com/jtg-code/anki-overdrive-windows-sdk","last_synced_at":"2025-04-12T11:42:23.486Z","repository":{"id":81168221,"uuid":"606145502","full_name":"jtg-code/anki-overdrive-windows-sdk","owner":"jtg-code","description":"Anki overdrive skd for windows","archived":false,"fork":false,"pushed_at":"2023-09-25T10:41:55.000Z","size":145,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T06:24:18.760Z","etag":null,"topics":["anki","anki-overdrive","ankioverdrive","api","asyncio","ble","bleak","libary","python","sdk"],"latest_commit_sha":null,"homepage":"https://www.buymeacoffee.com/AnkiOverdrive","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtg-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T17:48:46.000Z","updated_at":"2024-02-23T02:06:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbad2835-2b2c-43b2-81b8-041b20a3939a","html_url":"https://github.com/jtg-code/anki-overdrive-windows-sdk","commit_stats":{"total_commits":97,"total_committers":4,"mean_commits":24.25,"dds":0.4639175257731959,"last_synced_commit":"2eae856ff20f78c5079778bfd05e9f8fd5bd1e3e"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtg-code%2Fanki-overdrive-windows-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtg-code%2Fanki-overdrive-windows-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtg-code%2Fanki-overdrive-windows-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtg-code%2Fanki-overdrive-windows-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtg-code","download_url":"https://codeload.github.com/jtg-code/anki-overdrive-windows-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248563721,"owners_count":21125339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","anki-overdrive","ankioverdrive","api","asyncio","ble","bleak","libary","python","sdk"],"created_at":"2024-09-24T19:50:17.462Z","updated_at":"2025-04-12T11:42:23.467Z","avatar_url":"https://github.com/jtg-code.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anki Overdrive windows SDK\n\n## Installation\n1. Download the newest release\u003c/li\u003e\n2. Extract the ```anki_sdk``` directory\n3. Run ```pip install -r requirements.txt``` \u003cb\u003eOR\u003c/b\u003e run ```python setup.py```\n4. For update run ```python setup.py --update --upgrade```\n\n\n## .anki code language\n### Syntax\n````json\n{\n    \"function\": \"def\",\n    \"#include utils\": \"import anki_sdk.utils as utils\",\n    \"#include cars\": \"import anki_sdk.cars as cars\",\n    \"#include controllers\": \"import anki_sdk.controllers as controllers\",\n    \"#include api\": \"import anki_sdk.api as api\",\n    \"new Car\": \"cars.CarClass\",\n    \"new Controller\": \"controllers.ControllerClass\",\n    \"#import\": \"import\",\n    \"#\": \"@\",\n    \"//\": \"#\",\n    \"log\": \"print\",\n    \".end\": \"exit()\"\n}\n````\n\n## Default Example\n```python\nimport anki_sdk as sdk\nimport time\n\ndef controll_car(address: str):\n    # Create a new car object with the given address\n    car = sdk.cars.CarClass(address)\n    car.connect()  # Connect to the car\n    car.start_notify()  # Start receiving notifications from the car\n    controller = sdk.controller.ControllerClass(car)\n    print(f\"Pong! {car.ping()}ms\")  # Print the ping time to the car\n    controller.set_speed(500, 500)  # Set the speed of the car\n    time.sleep(10)  # Wait for 10 seconds\n    controller.left_lane(1.0)  # Move the car to the left lane\n    time.sleep(10)  # Wait for 10 seconds\n    controller.right_lane(1.0)  # Move the car to the right lane\n    time.sleep(10)  # Wait for 10 seconds\n    \n    # Define a callback function for when a new track is detected\n    @car.notifycallback(sdk.cars.Receive.Track.TRACK_CHANGE)\n    def new_track(sender, data):\n        print(\"New Track!\")\n        \n    # Define a callback function for when the car crosses the finish line\n    @car.notifycallback(sdk.cars.Receive.Track.FINISHLINE)\n    def finish_line(sender, data):\n        print(\"Finish!\")\n        \n    # Define a callback function for when a special track is encountered\n    @car.notifycallback(sdk.cars.Receive.Track.SPECIAL_TRACK)\n    def special_track(sender, data):\n        print(\"Special Track!\")\n        \n    # Define a callback function for when a straight track is detected\n    @car.notifycallback(sdk.cars.Receive.Track.STRAIGHT_TRACK)\n    def straight_track(sender, data):\n        print(\"New Straight Track!\")\n        \n    # Define a callback function for when a ping response is received\n    @car.notifycallback(sdk.cars.Receive.Connection.PING_RESPONSE)\n    def ping_response(sender, data):\n        print(\"Ping Response!\")\n    \n    car.stop_notify()  # Stop receiving notifications from the car\n    car.disconnect()  # Disconnect from the car\n```\n\n## API Example\n### Python\n#### Client\n````python\nfrom anki_sdk import api\n# Create the client and establish a connection to the server\nclient = api.Client(\"localhost\")\n\n# Create a car and get the token\ntoken = client.create_car(\"AA:BB:CC:DD:EE:FF\")\nprint(\"Token:\", token)\n\n# Set the speed of the car\nspeed = 500  # Speed value (in millimeters per second)\naccel = 1000  # Acceleration value (in millimeters per second squared)\nresponse = client.set_speed(speed, accel)\nprint(\"Set Speed Response:\", response)\n\n# Make the car switch to the left lane\nlanes = 0.5  # Number of lanes to switch (can be a decimal value)\nresponse = client.left_lane(lanes)\nprint(\"Left Lane Response:\", response)\n\n# Make the car switch to the right lane\nlanes = 1.0  # Number of lanes to switch (can be a decimal value)\nresponse = client.right_lane(lanes)\nprint(\"Right Lane Response:\", response)\n\n# Get a list of available cars\nactive = True  # Flag to retrieve only active cars\ncar_list = client.get_cars(active=active)\nprint(\"Available Cars:\")\nfor car in car_list:\n    print(car)\n````\n\n### Javascript\n#### Client\n````javascript\nconst { Client } = require(\"./api/anki_api\");\n\nasync function main() {\n  // Create the client and establish a connection to the server\n  const client = new Client(\"localhost\");\n\n  // Create a car and get the token\n  const token = await client.create_car(\"AA:BB:CC:DD:EE:FF\");\n  console.log(\"Token:\", token);\n\n  // Set the speed of the car\n  const setSpeedResponse = await client.set_speed(500);\n  console.log(\"Set Speed Response:\", setSpeedResponse);\n\n  // Make the car switch to the left lane\n  const leftLaneResponse = await client.left_lane(0.5);\n  console.log(\"Left Lane Response:\", leftLaneResponse);\n\n  // Make the car switch to the right lane\n  const rightLaneResponse = await client.right_lane(1.0);\n  console.log(\"Right Lane Response:\", rightLaneResponse);\n\n  // Get a list of available cars\n  const carList = await client.get_cars(true);\n  console.log(\"Available Cars:\");\n  for (const car of carList) {\n    console.log(car);\n  }\n}\nmain();\n````","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtg-code%2Fanki-overdrive-windows-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtg-code%2Fanki-overdrive-windows-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtg-code%2Fanki-overdrive-windows-sdk/lists"}