This package provides convenient access to the smartextract REST API for Python applications.
This package requires Python 3.9 or higher and is available from PyPI:
pip install smartextract[oauth,cli-extras]You can leave out oauth and cli-extras if you don't plan to use those
features.
To make your first request to the smartextract API, first make sure that you have signed up at https://app.smartextract.ai/. Then, try the following:
import smartextract
client = smartextract.Client()
info = client.get_user_info()
print(info)You may also generate an API key and pass it as an argument when initializing the client. This is necessary if you want to avoid the interactive login via web browser.
For more information, use your IDE to explore the methods of the Client object or
refer to the user guide.
This package also offers a command line interface. To enable a few additional CLI features, install it with:
pip install smartextract[cli-extras]Then type, for instance
smartextract get-user-infoto make a request, and
smartextract --helpfor more information on all available commands and switches.
If you want to use an API key instead of the interactive OAuth authentication,
generate an API key and set
your environment variable SMARTEXTRACT_API_KEY.
Finally, see smartextract completion --help for instructions on how to set up
command-line completion in your shell.