semvec/pypi-packages huggingface dataset:
syncconnect 2.1.0
Sync Connect Python SDK
License: MIT

![Sync Connect Python SDK Logo](https://user-images.githubusercontent.com/35158392/111222780-4bf1bb80-85aa-11eb-8be2-271ae5f32936.png)

The Sync Connect Python SDK is an open-source, python package that provides the ability to send commands to your Ford Sync Connect connected vehicle.
# Installation [![PyPI version](https://badge.fury.io/py/syncconnect.svg)](https://badge.fury.io/py/syncconnect)
```sh
python3 -m pip install syncconnect
```

Requirements
- To make requests to a vehicle, the end user must have signed up for an account using [Ford Pass](https://owner.ford.com/fordpass/fordpass-sync-connect.html). These credentials will be used to authenticate your requests.
# Getting Started

Import the Sync Connect SDK
```python
import syncconnect
```


Create a new syncconnect `client`
- Note the default Sync Connect client_id is 
`9fb503e0-715b-47e8-adfd-ad4b7770f73b`

```python
client = syncconnect.AuthClient('9fb503e0-715b-47e8-adfd-ad4b7770f73b', None, None)
```

Use `client.get_user_access_token()` to exchange your user credentials for an **access object**. To make any vehicle data request to the Ford Sync Connect API, you'll need to give the SDK a valid **access token**. 

```python
access = client.get_user_access_token('<username>', '<password>')
```

This access object will look like this:

```json
{
  "access_token": "...",
  "token_type": "Bearer",
  "expiration": "2021-03-01T18:04:25+00:00",
  "refresh_token": "...",
  "refresh_expiration": "2021-03-02T18:03:25+00:00",
  "expires_in": "..."
}
```

Access tokens will expire every 2 hours, so you'll need to constantly refresh them by calling `client.exchange_refresh_token()`

```python
refreshToken = client.exchange_refresh_token(access['refreshToke'])
```

With your access token in hand, use `syncconnect.User()` to get a User object representing the user.
```python
user = syncconnect.User(access['access_token'])
```

Use `user.vehicles()` to return an array of all the vehicles associated with a users account. The response will include the **vehicle vin**.
```python
vehicles = user.vehicles()

vehicleList = [] # Array of vehicles

for userVehicle in vehicles: # For each user vehicle
    vehicleList.append(userVehicle['vin'])
```

Now with a **vehicle vin** in hand, use `syncconnect.Vehicle()` to get a Vehicle object representing the user's vehicle.
```python
currentVehicle = syncconnect.Vehicle(vehicleList[0], access['access_token']) # First Vehicle in vehicleList
```

Now you can ask the car to do things, or ask it for some data! For example:
```python
currentVehicle.start()
```

# Examples & Documentation
For more examples on what you can do with Sync Connected car, see the [examples](/examples) folder or take a peek at the [documentation](https://ianjwhite99.github.io/sync-connect-sdk/).

# Funding & Support
If you are interested in supporting the development of my projects check out my [patreon](https://www.patreon.com/ianjwhite99) or [buy me a coffee](https://www.buymeacoffee.com/ianjwhite9). 

# Disclaimer
THIS CODEBASE IS NOT ENDORSED, AFFILIATED, OR ASSOCIATED WITH FORD, FOMOCO OR THE FORD MOTOR COMPANY.
spatial-autocorrelation 0.0.1a0
Topological spatial autocorrelation analysis
License: MIT
Keywords: pypi,spatial_autocorrelation,Moran's I,LISA,geometrical,topological,spatial autocorrelation,spatial correlation,correlation,spatial weighted matrix

# spatial_autocorrelation
Performing Moran's I to conduct correlation analysis on topological relationship.

In statistics, Moran's I is a measure of spatial autocorrelation developed by Patrick Alfred Pierce Moran. Spatial autocorrelation is characterized by a correlation in a signal among nearby locations in space. Spatial autocorrelation is more complex than one-dimensional autocorrelation because spatial correlation is multi-dimensional (i.e. 2 or 3 dimensions of space) and multi-directional.[1]

From the example.py, you can see how the values of blocks are correlated with the values of neighbours spatially
![image](https://user-images.githubusercontent.com/69416199/143538881-3c6db158-74ba-4f41-a32c-428d06193475.png)


Reference(s):
[1] https://en.wikipedia.org/wiki/Moran%27s_I
[2] https://www.statology.org/morans-i/
[3] https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-statistics/h-how-spatial-autocorrelation-moran-s-i-spatial-st.htm