{
"info": {
"author": "Gautam Mishra",
"author_email": "gautam.mishra@hotmail.com",
"bugtrack_url": null,
"classifiers": [],
"description": "********************************\nUnofficial Lyft Rides Python SDK\n********************************\n\nPython SDK (beta) to support the `Lyft Rides API `_.\n\nInstallation\n------------\n\nTo use the Unofficial Lyft Rides Python SDK:\n\n.. code-block:: bash\n\n $ pip install lyft_rides\n\n\nHead over to `pip-installer `_ for instructions on installing pip.\n\nTo run from source, you can `download the source code `_ for lyft-rides, and then run:\n\n.. code-block:: bash\n\n $ python setup.py install\n\n\nWe recommend using `virtualenv `_ when setting up your project environment. You may need to run the above commands with `sudo` if you\u2019re not using it.\n\nRead-Only Use\n-------------\n\nIf you just need access to resources that are not user-specific (eg. ETA, cost, ride types) you will go through a \"2-legged\" flow. In this case, you can create a Session using ClientCredentialGrant with the Client ID and Client Secret you received after `registering your app `_.\n\n.. code-block:: python\n\n from lyft_rides.auth import ClientCredentialGrant\n from lyft_rides.session import Session\n\n auth_flow = ClientCredentialGrant(\n\tYOUR_CLIENT_ID,\n\tYOUR_CLIENT_SECRET,\n\tYOUR_PERMISSION_SCOPES,\n\t)\n session = auth_flow.get_session()\n\nUse this Session to create an LyftRidesClient and fetch API resources:\n\n.. code-block:: python\n\n from lyft_rides.client import LyftRidesClient\n\n client = LyftRidesClient(session)\n response = client.get_ride_types(37.7833, -122.4167)\n ride_types = response.json.get('ride_types')\n\nAuthorization\n-------------\n\nIf you need access to a Lyft user's account in order to make requests on their behalf, you will go through a \"3-legged\" flow. In this case, you will need the user to grant access to your application through the OAuth 2.0 Authorization Code flow. See `Lyft API docs `_.\n\nThe Authorization Code flow is a two-step authorization process. The first step is having the user authorize your app and the second involves requesting an OAuth 2.0 access token from Lyft. This process is mandatory if you want to take actions on behalf of a user or access their information.\n\n.. code-block:: python\n\n from lyft_rides.auth import AuthorizationCodeGrant\n auth_flow = AuthorizationCodeGrant(\n YOUR_CLIENT_ID,\n YOUR_CLIENT_SECRET,\n\tYOUR_PERMISSION_SCOPES,\n )\n auth_url = auth_flow.get_authorization_url()\n\nNavigate the user to the `auth_url` where they can grant access to your application. After, they will be redirected to a `redirect_url` with the format REDIRECT_URL?code=UNIQUE_AUTH_CODE. Use this `redirect_url` to create a session and start LyftRidesClient.\n\n.. code-block:: python\n\n session = auth_flow.get_session(redirect_url)\n client = LyftRidesClient(session)\n credentials = session.oauth2credential\n\nKeep `credentials` information in a secure data store and reuse them to make API calls on behalf of your user. The SDK will handle the token refresh for you automatically when it makes API requests with a LyftRidesClient.\n\n\nExample Usage\n-------------\n\nNavigate to the `examples` folder to access the python scripts examples. Before you can run an example, you must edit the `example/config.yaml` file and add your app credentials.\n\nTo get an LyftRidesClient through the Authorization Code flow, run:\n\n.. code-block:: bash\n\n $ python examples/authorization_code_grant.py\n\nThe example above stores user credentials in `examples/oauth2_session_store.yaml`.\n\nGet Available Products\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n.. code-block:: python\n\n response = client.get_ride_types(37.7833, -122.4167)\n ride_types = response.json.get('ride_types')\n ride_type = ride_types[0].get('ride_type')\n\nRequest a Ride\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n.. code-block:: python\n\n response = client.request_ride(\n ride_type=ride_type,\n start_latitude=37.77,\n start_longitude=-122.41,\n end_latitude=37.79,\n end_longitude=-122.41,\n )\n ride_details = response.json\n ride_id = ride_details.get('ride_id')\n\n\nThis does not make a real-time request. It makes a request to the sandbox environment.\n\nTo send a real-time request to send a Lyft driver to the specified start location, make sure to instantiate your ClientCredentialGrant with\n\n.. code-block:: python\n\n auth_flow = ClientCredentialGrant(\n\tYOUR_CLIENT_ID,\n\tYOUR_CLIENT_SECRET,\n\tYOUR_PERMISSION_SCOPES,\n\tsandbox_mode=False)\n\nor AuthorizationCodeGrant with\n\n.. code-block:: python\n\n auth_flow = AuthorizationCodeGrant(\n YOUR_CLIENT_ID,\n YOUR_CLIENT_SECRET,\n\tYOUR_PERMISSION_SCOPES,\n\tsandbox_mode=False,\n )\n\nThe default for `sandbox_mode` is set to `True`. See the `documentation `_ to read more about using the Sandbox Environment.\n\nGetting help\n------------\n\nFor full documentation about Lyft Rides API, visit the `Lyft Developer Site `_.\n\nContributing\n------------\n\nIf you've found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repository.\n",
"description_content_type": null,
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/gautammishra/lyft-rides-python-sdk",
"keywords": "lyft",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "lyft_rides",
"package_url": "https://pypi.org/project/lyft_rides/",
"platform": "",
"project_url": "https://pypi.org/project/lyft_rides/",
"project_urls": {
"Homepage": "https://github.com/gautammishra/lyft-rides-python-sdk"
},
"release_url": "https://pypi.org/project/lyft_rides/0.2/",
"requires_dist": null,
"requires_python": "",
"summary": "Unofficial Lyft Rides API Python SDK",
"version": "0.2"
},
"last_serial": 3199501,
"releases": {
"0.1.0b0": [
{
"comment_text": "",
"digests": {
"md5": "45b17b32e039902728fe7e2076a8b73c",
"sha256": "db2ca3f079dacbd1e6b962cf512e73e01ae646091f20de235792b302247ed822"
},
"downloads": -1,
"filename": "lyft_rides-0.1.0b0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "45b17b32e039902728fe7e2076a8b73c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 26402,
"upload_time": "2016-09-17T14:41:36",
"url": "https://files.pythonhosted.org/packages/1c/2e/d887c3e03e1a3c322b66879f1cb754527102aab98326c943c799126c9417/lyft_rides-0.1.0b0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "f15ebc1ca6dfcbe093ffd2727e5fe5cc",
"sha256": "a671a027969e1b69af978d7fbddad86c4514198d158d97e85836044ea8ee2bb5"
},
"downloads": -1,
"filename": "lyft_rides-0.1.0b0.zip",
"has_sig": false,
"md5_digest": "f15ebc1ca6dfcbe093ffd2727e5fe5cc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29454,
"upload_time": "2016-09-17T14:41:38",
"url": "https://files.pythonhosted.org/packages/9c/bb/85d62a16c3006054dd60539a4449619af7423a71b00df2b5f1ad68afd22a/lyft_rides-0.1.0b0.zip"
}
],
"0.2": [
{
"comment_text": "",
"digests": {
"md5": "984411a64be14bcb1d4590b6a79a4083",
"sha256": "36b2bab971814c4a9bb14f7f02b3c5a5594ed1519ee34872fde9a6167694cc8a"
},
"downloads": -1,
"filename": "lyft_rides-0.2.tar.gz",
"has_sig": false,
"md5_digest": "984411a64be14bcb1d4590b6a79a4083",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17070,
"upload_time": "2017-09-25T02:07:41",
"url": "https://files.pythonhosted.org/packages/bb/1f/907e932ff73a7a96fb256d70f16a0d41d2d3c4fc17c9a74ee42fb42b11bb/lyft_rides-0.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "984411a64be14bcb1d4590b6a79a4083",
"sha256": "36b2bab971814c4a9bb14f7f02b3c5a5594ed1519ee34872fde9a6167694cc8a"
},
"downloads": -1,
"filename": "lyft_rides-0.2.tar.gz",
"has_sig": false,
"md5_digest": "984411a64be14bcb1d4590b6a79a4083",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17070,
"upload_time": "2017-09-25T02:07:41",
"url": "https://files.pythonhosted.org/packages/bb/1f/907e932ff73a7a96fb256d70f16a0d41d2d3c4fc17c9a74ee42fb42b11bb/lyft_rides-0.2.tar.gz"
}
]
}