Skip to content

Commit 4172575

Browse files
author
Jonathan Wenger
committed
Update readme with latest calling patterns.
1 parent 47452d3 commit 4172575

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

README.md

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@ Python >= 3.6
1313
If the python package is hosted on a repository, you can install directly using:
1414

1515
```sh
16-
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
17-
```
18-
19-
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
20-
21-
Then import the package:
22-
23-
```python
24-
import Avalara.SDK
16+
pip install Avalara.SDK==24.12.1
2517
```
2618

2719
### Setuptools
@@ -32,36 +24,29 @@ Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
3224
python setup.py install --user
3325
```
3426

35-
(or `sudo python setup.py install` to install the package for all users)
36-
37-
Then import the package:
38-
39-
```python
40-
import Avalara.SDK
41-
```
42-
4327
## Getting Started
4428

4529
Please follow the [installation procedure](#installation--usage) and then run the following:
4630

4731
```python
4832

4933
import time
50-
import Avalara.SDK
51-
from Avalara.SDK import api_client
34+
from Avalara.SDK.configuration import Configuration
35+
from Avalara.SDK.api_client import ApiClient
36+
from Avalara.SDK.exceptions import ApiException
5237
from Avalara.SDK.api.EInvoicing.V1.mandates_api import MandatesApi # noqa: E501
5338
from pprint import pprint
5439

5540
# Define configuration object with parameters specified to your application.
56-
configuration = Avalara.SDK.Configuration(
57-
app_name='test app'
58-
app_version='1.0'
59-
machine_name='some machine'
60-
access_token='YOUR_BEARER_TOKEN'
41+
configuration = Configuration(
42+
app_name='test app',
43+
app_version='1.0',
44+
machine_name='some machine',
45+
access_token='',
6146
environment='sandbox'
6247
)
6348
# Enter a context with an instance of the API client
64-
with Avalara.SDK.ApiClient(configuration) as api_client:
49+
with ApiClient(configuration) as api_client:
6550
# Create an instance of the API class
6651
api_instance = MandatesApi(api_client)
6752
x_avalara_client = "Swagger UI; 22.7.0; Custom; 1.0" # str | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) if omitted the server will use the default value of "Swagger UI; 22.7.0; Custom; 1.0"
@@ -72,7 +57,7 @@ with Avalara.SDK.ApiClient(configuration) as api_client:
7257
# Retrieve geolocation information for a specified address
7358
api_response = api_instance.get_mandates(avalara_version="1.2", x_avalara_client=x_avalara_client)
7459
pprint(api_response)
75-
except Avalara.SDK.ApiException as e:
60+
except ApiException as e:
7661
print("Exception when calling MandatesApi->get_mandates: %s\n" % e)
7762
```
7863

0 commit comments

Comments
 (0)