Giter Club home page Giter Club logo

prefect's Introduction

prefect

MyFordMobile reverse-engineered API in Python
Sonar Quality Gate Travis (.org) branch
GitHub last commit PyPI GitHub

prefect is a Python library for interacting with your MyFordMobile-enabled vehicle. With prefect, you can:

  • Lock your car
  • Unlock your car
  • Check your gas level, and, if you have one, your EV battery level
  • Start your engine (e.g. to preheat your car in the Blustery Times Of Year), and stop your engine if you decide to stay home after all

prefect uses a reverse-engineered API, and may be unstable. DON'T PANIC.

Examples

Example Description
AWS Lambda Start your car with ford-prefect from an AWS Lambda
๐Ÿšง HomeAssistant Start/stop, lock/unlock your car with Home Assistant

Installation

pip3 install -U ford-prefect

Usage

from prefect import FordAPI

F = FordAPI()
F.authenticate(USERNAME, PASSWORD)
F.get_vehicles() # returns a list of dicts with metadata
my_car = F.get_vehicles()[0]

my_car.start_engine()

print(my_car.status()) # metadata dictionary

Authentication

There are three ways to authenticate:

Plaintext username and password

You can pass credentials directly into the authenticate call:

F.authenticate(USERNAME, PASSWORD)

Environment variables

You can set PREFECT_USERNAME and PREFECT_PASSWORD environment variables. If these are set, pass nothing to the FordAPI#authenticate call and they will be automatically detected.

Config file

You can store credentials in a JSON config file, and pass the filename into the authenticate call:

~/.config/myfordmobile.json

{
    "username": "",
    "password": ""
}
F.authenticate("~/.config/myfordmobile.json")

Or, if you're using that filename (the default), you can omit it entirely:

F.authenticate()

If no arguments are passed to this constructor, environment variables (method 2) will be checked first before the config file is checked. If both techniques fail, and no username and password were provided, the authenticate() call will fail.

Hacking on this repo

  • Submit pull requests for individual features

  • Make sure things work locally before pushing

  • When pushing new changes to the function signatures or new documentation, re-generate the Reference.md file under /docs. You can use docshund to do this, thusly:

docshund prefect/__init__.py > docs/Reference.md

Install docshund with pip3 install -U docshund.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.