Skip to content

Commit c68cdf0

Browse files
Kharude, Sachinsackh
authored andcommitted
updated iml docs
Signed-off-by: Kharude, Sachin <[email protected]>
1 parent 3f4a1e4 commit c68cdf0

File tree

4 files changed

+11
-60
lines changed

4 files changed

+11
-60
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Tests
22

33
on:
44
push:
5+
branches:
6+
- master
57
pull_request:
68
branches:
79
- master

README.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,11 @@ You can provide your credentials using any of the following methods:
135135
- Credentials file
136136
137137
#### Default credentials
138+
Place the credentials file into
138139
139-
- Place the credentials file into:
140-
For Linux/MacOS: $HOME/.here/credentials.properties
141-
For Windows: %USERPROFILE%\.here\credentials.properties
140+
For Linux/MacOS: `$HOME/.here/credentials.properties`
142141
143-
##### code snippet to initantiate LS object:
144-
```
145-
# credentials will be picked up from credentials.properties file placed at default location.
146-
from here_location_services import LS
147-
148-
ls = LS()
149-
```
142+
For Windows: `%USERPROFILE%\.here\credentials.properties`
150143
151144
#### Environment Variables
152145
@@ -158,31 +151,11 @@ HERE_ACCESS_KEY_ID
158151
HERE_ACCESS_KEY_SECRET
159152
HERE_TOKEN_ENDPOINT_URL
160153
```
161-
##### code snippet to initantiate LS object:
162-
```
163-
from here_location_services import LS
164-
from here_location_services.platform.credentials import PlatformCredentials
165-
166-
167-
credentials = PlatformCredentials.from_env()
168-
169-
ls = LS(platfrom_credentials=credentials)
170-
```
171154
172155
#### Credentials File
173156
174157
You can specify any credentials file as an alternative to that found in `~/.here/credentials.properties`. An error is generated if there is no file present at the path, or if the file is not properly formatted.
175-
##### code snippet to initantiate LS object:
176-
177-
```
178-
from here_location_services import LS
179-
from here_location_services.platform.credentials import PlatformCredentials
180158
181-
182-
credentials = PlatformCredentials.from_credentials_file("<Path to file>")
183-
184-
ls = LS(platfrom_credentials=credentials)
185-
```
186159
187160
## Documentation
188161
@@ -241,7 +214,7 @@ import geojson
241214
from xyzspaces import IML
242215
from xyzspaces.iml.credentials import Credentials
243216

244-
credentials = Credentials.from_credentials_file("~/.here/credentials.properties")
217+
credentials = Credentials.from_default() # credentials are in either credentials file at default location or in environment variables
245218

246219
layer_details = {
247220
"id": "demo-interactive-layer",

docs/source/prerequisites.rst

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ Prerequisites
33

44
Before you install the ``xyzspaces`` package make sure you meet the following prerequisites:
55

6+
* A Python installation, 3.7+ recommended, with the ``pip`` or ``conda`` command available to install dependencies.
7+
68
Data Hub
79
--------
8-
* A Python installation, 3.7+ recommended, with the ``pip`` or ``conda`` command available to install dependencies.
910
* A HERE developer account, free and available under `HERE Developer Portal`_.
1011
* An XYZ API access token from your XYZ Hub server or the `XYZ portal`_ (see also its `Getting Started`_ section) in an environment variable named XYZ_TOKEN which you can set like this (with a valid value, of course)::
1112

@@ -18,7 +19,6 @@ Data Hub
1819

1920
Interactive Map Layer
2021
---------------------
21-
* A Python installation, 3.7+ recommended, with the ``pip`` or ``conda`` command available to install dependencies.
2222

2323
* To interact with Interactive Map Layers you will need an account on the HERE Platform. To get more details on the HERE Platform account please check our documentation `Get a HERE account <https://developer.here.com/documentation/identity-access-management/dev_guide/topics/obtain-user-credentials.html>`_.
2424

@@ -56,12 +56,6 @@ Default credentials
5656

5757
%USERPROFILE%\.here\credentials.properties
5858

59-
code snippet to initantiate LS object::
60-
61-
# credentials will be picked up from credentials.properties file placed at default location.
62-
from here_location_services import LS
63-
64-
ls = LS()
6559

6660
Environment Variables
6761
~~~~~~~~~~~~~~~~~~~~~~
@@ -73,27 +67,8 @@ You can override default credentials by assigning values to the following enviro
7367
HERE_ACCESS_KEY_SECRET
7468
HERE_TOKEN_ENDPOINT_URL
7569

76-
code snippet to initantiate LS object::
77-
78-
from here_location_services import LS
79-
from here_location_services.platform.credentials import PlatformCredentials
80-
81-
82-
credentials = PlatformCredentials.from_env()
83-
84-
ls = LS(platfrom_credentials=credentials)
8570

8671
Credentials File
8772
~~~~~~~~~~~~~~~~
88-
You can specify any credentials file as an alternative to that found in `~/.here/credentials.properties`. An error is generated if there is no file present at the path, or if the file is not properly formatted.
89-
code snippet to initantiate LS object::
90-
91-
from here_location_services import LS
92-
from here_location_services.platform.credentials import PlatformCredentials
93-
94-
95-
credentials = PlatformCredentials.from_credentials_file("<Path to file>")
96-
97-
ls = LS(platfrom_credentials=credentials)
98-
73+
You can specify any credentials file as an alternative to that found in ``~/.here/credentials.properties``. An error is generated if there is no file present at the path, or if the file is not properly formatted.
9974

xyzspaces/iml/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def from_catalog_hrn_and_layer_id(
3333
:return: Object of IML
3434
"""
3535
obj = cls()
36-
catalog = Catalog(hrn=catalog_hrn, credentials=credentials)
36+
cred = credentials or Credentials.from_default()
37+
catalog = Catalog(hrn=catalog_hrn, credentials=cred)
3738
obj.catalog = catalog
3839
obj.layer = InteractiveMapLayer(layer_id=layer_id, catalog=catalog)
3940
return obj

0 commit comments

Comments
 (0)