Skip to content

Commit 0434d80

Browse files
committed
Merge branch 'release/0.0.3'.
2 parents e52362c + d5867fe commit 0434d80

File tree

11 files changed

+510
-138
lines changed

11 files changed

+510
-138
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ prepublish-check: build
1717
python3 -m twine check dist/*
1818

1919
publish: build
20-
python3 -m twine upload dist/*
20+
python3 -m twine upload dist/*
21+
22+
clean:
23+
rm -rf build dist docs

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,35 @@ Install the package from PyPI:
1010
pip3 install autodesk-forge-sdk
1111
```
1212

13-
Start importing from `autodesk_forge_sdk`:
13+
### Authentication
1414

1515
```python
1616
import os
17-
from autodesk_forge_sdk import AuthenticationClient
18-
19-
FORGE_CLIENT_ID = os.environ["FORGE_CLIENT_ID"]
20-
FORGE_CLIENT_SECRET = os.environ["FORGE_CLIENT_SECRET"]
17+
from autodesk_forge_sdk import AuthenticationClient, Scope
2118

2219
client = AuthenticationClient()
23-
auth = client.authenticate(FORGE_CLIENT_ID, FORGE_CLIENT_SECRET, ["viewables:read"])
20+
auth = client.authenticate(os.environ["FORGE_CLIENT_ID"], os.environ["FORGE_CLIENT_SECRET"], [Scope.ViewablesRead])
2421
print(auth["access_token"])
25-
```
22+
```
23+
24+
### Data Management
25+
26+
```python
27+
import os
28+
from autodesk_forge_sdk import OSSClient, OAuthTokenProvider
29+
30+
client = OSSClient(OAuthTokenProvider(os.environ["FORGE_CLIENT_ID"], os.environ["FORGE_CLIENT_SECRET"]))
31+
buckets = client.get_all_buckets()
32+
print(buckets)
33+
```
34+
35+
Or, if you already have an access token:
36+
37+
```python
38+
import os
39+
from autodesk_forge_sdk import OSSClient, SimpleTokenProvider
40+
41+
client = OSSClient(SimpleTokenProvider(os.environ["FORGE_ACCESS_TOKEN"]))
42+
buckets = client.get_all_buckets()
43+
print(buckets)
44+
```

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="autodesk-forge-sdk",
8-
version="0.0.2",
8+
version="0.0.3",
99
author="Petr Broz",
1010
author_email="petr.broz@autodesk.com",
1111
description="Unofficial Autodesk Forge SDK for Python.",

src/autodesk_forge_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .auth import AuthenticationClient, PassiveTokenProvider, ActiveTokenProvider
1+
from .auth import AuthenticationClient, Scope, TokenProviderInterface, SimpleTokenProvider, OAuthTokenProvider
22
from .oss import OSSClient
33
from .md import ModelDerivativeClient, urnify

0 commit comments

Comments
 (0)