Skip to content

Commit

Permalink
Doc Rev 7 Nov 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
miballe committed Nov 7, 2024
1 parent bbd383a commit 74d299a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/source/concepts/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,33 @@ Depending on thte service intended to be used, an operation object will need eit
ENV variables to store values to instantiate these objects (see Getting Started
> Environment Variables > :ref:`gettingstarted_envvariables_auth`).

However, most class constructors look automatically for relevant environment variables
and perform the authentication automatically.

If an explicit user creation is needed, the following classes can be used:

UserKey
-------

Used by all services except the Article Retrieval Service. Usually it's not required to
be instantiated independently as the creation of a `parent` object will get the value
from the environment.

If using this class explicitly, the following code snippets can be found helpful:
If using this class explicitly, the following code snippet can be helpful:

.. code-block:: python
from factiva.analytics import UserKey, SnapshotExplain
u = UserKey('abcd1234abcd1234abcd1234abcd1234')
se = SnapshotExplain(user_key=u)
When using ENV variables, the above snippet requires only the constructor call from the parent
class, in this case `SnapshotExplain()`.

.. code-block:: python
from factiva.analytics import SnapshotExplain
ar = SnapshotExplain()
OAuthUser
---------
Expand All @@ -41,9 +53,10 @@ class explicitly:
ar = ArticleRetrieval(oauth_user=ou)
...
When using ENV variables, the above snippet becomes shorter.
When using ENV variables, the above snippet requires only the constructor call from the parent
class, in this case `ArticleRetrieval()`.

.. code-block:: python
from factiva.analytics import SrticleRetrieval
from factiva.analytics import ArticleRetrieval
ar = ArticleRetrieval()

0 comments on commit 74d299a

Please sign in to comment.