Unofficial package for making OnStar API requests
Project description
PyOnStar
Unofficial Python package for making OnStar API requests. This is a Python port of the original OnStarJS package.
Note: This project was primarily developed through AI-assisted "vibe-coding" - using AI tools to help port the JavaScript codebase to Python while maintaining the original functionality.
Installation
pip install pyonstar
Usage
import asyncio
from pyonstar import OnStar
async def main():
# Create OnStar instance
onstar = OnStar.create({
"username": "your_username",
"password": "your_password",
"device_id": "your_device_id",
"vin": "your_vin",
"onstar_pin": "your_pin", # Optional
"totp_secret": "your_totp_secret" # Optional
})
# Get account vehicles
result = await onstar.get_account_vehicles()
print(result)
# Start vehicle
result = await onstar.start()
print(result)
# Lock doors
result = await onstar.lock_door()
print(result)
# Get vehicle location
result = await onstar.location()
print(result)
if __name__ == "__main__":
asyncio.run(main())
Features
- Account vehicle information
- Remote start/stop
- Door lock/unlock
- Trunk lock/unlock
- Vehicle alerts
- Charging profile management
- Vehicle diagnostics
- Location tracking
Requirements
- Python 3.10 or higher
- Required packages (automatically installed):
- httpx
- pyjwt
- pyotp
Credits
This project is a Python port of:
- OnStarJS - NodeJS Library for making OnStar API requests
License
MIT License - See LICENSE file for details
Running Tests
This project uses pytest for testing. To run the tests:
-
Install development dependencies:
pip install -r requirements-dev.txt
-
Run tests:
pytest
-
Run tests with coverage:
pytest --cov=pyonstar
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyonstar-0.0.14.tar.gz.
File metadata
- Download URL: pyonstar-0.0.14.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c818b35ccc88c3350cc6d96936bf110dc89099decd8053804b36c0be6ed309a
|
|
| MD5 |
d92e0373ebeab3e554d21b427dd43d0c
|
|
| BLAKE2b-256 |
323a911900370801ed6b4c701d4dd916562d19f9c2ac078b86c76ca4977d970b
|
Provenance
The following attestation bundles were made for pyonstar-0.0.14.tar.gz:
Publisher:
publish-pypi.yml on leboff/pyonstar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyonstar-0.0.14.tar.gz -
Subject digest:
5c818b35ccc88c3350cc6d96936bf110dc89099decd8053804b36c0be6ed309a - Sigstore transparency entry: 210151868
- Sigstore integration time:
-
Permalink:
leboff/pyonstar@198379740db7f4593e714240a362642f87e15bd7 -
Branch / Tag:
refs/tags/v0.0.14 - Owner: https://github.com/leboff
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@198379740db7f4593e714240a362642f87e15bd7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyonstar-0.0.14-py3-none-any.whl.
File metadata
- Download URL: pyonstar-0.0.14-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd33ff703bbb184a65c60b61ee73c4db2690949c1918d0d0bc421b56b3f9bb68
|
|
| MD5 |
9221826132ccd8b093a65fd23adc3458
|
|
| BLAKE2b-256 |
bc3cb0f484b3483c4624b11d5b4da4bff3d307072f46b03ab6f491de8f53165a
|
Provenance
The following attestation bundles were made for pyonstar-0.0.14-py3-none-any.whl:
Publisher:
publish-pypi.yml on leboff/pyonstar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyonstar-0.0.14-py3-none-any.whl -
Subject digest:
bd33ff703bbb184a65c60b61ee73c4db2690949c1918d0d0bc421b56b3f9bb68 - Sigstore transparency entry: 210151870
- Sigstore integration time:
-
Permalink:
leboff/pyonstar@198379740db7f4593e714240a362642f87e15bd7 -
Branch / Tag:
refs/tags/v0.0.14 - Owner: https://github.com/leboff
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@198379740db7f4593e714240a362642f87e15bd7 -
Trigger Event:
push
-
Statement type: