Skip to content

Commit

Permalink
Note about environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
s2t2 committed Jul 21, 2024
1 parent 0514cbb commit 1ccad3d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/reference/api.Api.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ A client for interfacing with the Truth Social API.
>>> client = Api(username="yourname", password="yourpass")
```

To avoid hard-coding your secret credentials, you are encouraged to use environment variables
`TRUTHSOCIAL_USERNAME` and `TRUTHSOCIAL_PASSWORD`, for example stored in a local ".env" file.
You could then pass these environment variables, or omit because they are used by default:

```python
>>> from truthbrush import Api
>>> client = Api() # assuming you have set env vars
```

## Methods

| Name | Description |
Expand Down Expand Up @@ -66,7 +75,7 @@ Lookup a user's information.
Pull the given user's statuses.

Use the `created_after` or `since_id` parameters to filter posts,
retaining only those created since.
retaining only the posts created afterwards.

Returns a generator of posts in reverse chronological order,
or an empty list if not found.
Expand Down
7 changes: 7 additions & 0 deletions truthbrush/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class Api:
Examples:
>>> from truthbrush import Api
>>> client = Api(username="yourname", password="yourpass")
To avoid hard-coding your secret credentials, you are encouraged to use environment variables
`TRUTHSOCIAL_USERNAME` and `TRUTHSOCIAL_PASSWORD`, for example stored in a local ".env" file.
You could then pass these environment variables, or omit because they are used by default:
>>> from truthbrush import Api
>>> client = Api() # assuming you have set env vars
"""

def __init__(
Expand Down

0 comments on commit 1ccad3d

Please sign in to comment.