@@ -11,23 +11,27 @@ for Python applications.
1111This 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
1922To make your first request to the smartextract API, first make sure that you
2023have signed up at < https://app.smartextract.ai/ > . Then, try the following:
2124
2225``` python
2326import smartextract
24- client = smartextract.Client(username = YOUR_USERNAME , password = YOUR_PASSWORD )
27+ client = smartextract.Client()
2528info = client.get_user_info()
2629print (info)
2730```
2831
2932You 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
3236For more information, use your IDE to explore the methods of the ` Client ` object or
3337refer to the [ user guide] ( https://docs.smartextract.ai/guide ) .
@@ -55,16 +59,9 @@ smartextract --help
5559
5660for 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
6966Finally, see ` smartextract completion --help ` for instructions on how to set up
7067command-line completion in your shell.
0 commit comments