https://github.com/aweirddev/revilo
The Revilo Computer API.
https://github.com/aweirddev/revilo
Last synced: 8 months ago
JSON representation
The Revilo Computer API.
- Host: GitHub
- URL: https://github.com/aweirddev/revilo
- Owner: AWeirdDev
- Created: 2024-06-08T13:19:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T14:34:45.000Z (almost 2 years ago)
- Last Synced: 2025-03-18T05:45:22.839Z (about 1 year ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# revilo AI
Revilo Computer API. Will support AI soon.
## Windows API
The Revilo Windows API plays some tricks with Powershell and provides clean APIs. What's more, it's: ✨ LIGHTWEIGHT! ✨
To import, -
```python
from revilo.windows import ... # import item (e.g., ps, mouse, ...)
```
### Run Powershell
This is the core building block of the Revilo Computer API for Windows — Powershell.
```python
ps.run("Write-Host I love chocolate!") # 'I love chocolate!\n'
ps.run('Write-Host "Yo: $({c})"', vars={"c": "6*9 + 6+9"}) # 'Yo: 69\n'
```
### Keyboard API * AI
The keyboard API provides a clean interface for sending keys to the current foreground application.
It provides both text and hotkeys API.
```python
# Simple write API
keyboard.write("I love Texas!")
keyboard.write("Multi-\nlines work, too!")
# Hotkey (equivalents)
keyboard.hotkey("⌘", "shift", "esc") # Opens Task Manager
keyboard.hotkey("ctrl", "shift", "esc") # Seriously, again!
```
### Mouse API * AI
The mouse API is elegant, too!
```python
mouse.move(100, 200) # (x, y)
mouse.click()
mouse.click(100, 200) # (x, y)
mouse.get_position() # -> (x, y)
```
### Screen API * AI
The screen API will be integrated with AI soon!
Just a quick note: don't copy Microsoft's idea of stalking people's history (it's a decent idea for privacy leaks) because everyone loves their idea and will definitely go stonks!
```python
# Takes a screenshot
screen.take_screenshot("./my-screenshot.png")
# Gets the current app name (foreground)
screen.get_current_app()
```
### Notifications (Toast) API
The toast API is not 100% covered (for ``), but overall it's clean!
```python
# Send a simple toast
toast.notify("Epic title!", "Epic text")
# Add a sound
toast.notify(
"Hear me!",
"Yes you will.",
audio="ms-winsoundevent:Notification.Looping.Call9", # don't worry: type hints!
audio_loops=True,
duration="long", # or short
scenario="incomingCall" # "reminder" | "alarm" | "incomingCall" | "urgent"
)
# Add actions
toast.notify(
"📈 Time to increase traffic!",
"Click to open Google for no reason!!!",
actions=[
toast.Action("Google Time", "https://google.com")
]
)
```