Skip to content

Commit 4f3d39d

Browse files
committed
Update README
1 parent 30885e0 commit 4f3d39d

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,27 @@ for Python applications.
1111
This package requires Python 3.9 or higher and is available from PyPI:
1212

1313
```sh
14-
pip install smartextract
14+
pip install smartextract[oauth,cli-extras]
1515
```
1616

17+
You can leave out `oauth` and `cli-extras` if you don't plan to use those
18+
features.
19+
1720
## Usage
1821

1922
To make your first request to the smartextract API, first make sure that you
2023
have signed up at <https://app.smartextract.ai/>. Then, try the following:
2124

2225
```python
2326
import smartextract
24-
client = smartextract.Client(username=YOUR_USERNAME, password=YOUR_PASSWORD)
27+
client = smartextract.Client()
2528
info = client.get_user_info()
2629
print(info)
2730
```
2831

2932
You may also generate an [API key](https://app.smartextract.ai/settings/api-keys)
30-
and use it instead of your username and password to initialize the client.
33+
and pass it as an argument when initializing the client. This is necessary if
34+
you want to avoid the interactive login via web browser.
3135

3236
For more information, use your IDE to explore the methods of the `Client` object or
3337
refer to the [user guide](https://docs.smartextract.ai/guide).
@@ -55,16 +59,9 @@ smartextract --help
5559

5660
for more information on all available commands and switches.
5761

58-
To avoid typing your username and password every time, generate an [API
59-
key](https://app.smartextract.ai/settings/api-keys) and set your environment
60-
variable `SMARTEXTRACT_API_KEY`. Alternatively, you can use short-lived API
61-
tokens, for example like this:
62-
63-
```sh
64-
export SMARTEXTRACT_API_KEY="$(smartextract login YOUR_USERNAME)"
65-
# or, to avoid typing your password interactively
66-
export SMARTEXTRACT_API_KEY="$(cat my-password.txt | smartextract login YOUR_USERNAME)"
67-
```
62+
If you want to use an API key instead of the interactive OAuth authentication,
63+
generate an [API key](https://app.smartextract.ai/settings/api-keys) and set
64+
your environment variable `SMARTEXTRACT_API_KEY`.
6865

6966
Finally, see `smartextract completion --help` for instructions on how to set up
7067
command-line completion in your shell.

0 commit comments

Comments
 (0)