Skip to content

Commit e86bf43

Browse files
committed
In README.md is working example of code
1 parent 23c14b3 commit e86bf43

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@ Python client library for Bugout API
77
export BUGOUT_TIMEOUT_SECONDS=5
88
```
99

10+
- Example of usage, just fill `token`, `group_id`, `journal_id` and `entry_id` with proper values from your account. Or remove unnecessary variables and API calls.
1011
```python
1112
from bugout.app import Bugout
1213

14+
1315
def main():
14-
bugout = Bugout(brood_api_url="http://localhost:9001", spire_api_url="http://localhost:9002")
15-
16-
user = bugout.get_user(<user token ID>)
16+
bugout = Bugout()
17+
18+
token = ""
19+
group_id = ""
20+
journal_id = ""
21+
entry_id = ""
22+
23+
user = bugout.get_user(token=token)
1724
print(f"User name is {user.username}")
18-
19-
group = bugout.get_group(<user token ID>, <group ID>)
20-
21-
journal = bugout.get_journal(<user token ID>, <journal ID>)
22-
entry = bugout.get_entry(<user token ID>, <journal ID>, <entry ID>)
23-
24-
search_res = bugout.search(<user token ID>, <journal ID>, query="your query", content=False)
25+
26+
group = bugout.get_group(token=token, group_id=group_id)
27+
28+
journal = bugout.get_journal(token=token, journal_id=journal_id)
29+
entry = bugout.get_entry(token=token, journal_id=journal.id, entry_id=entry_id)
30+
31+
search_res = bugout.search(
32+
token=token, journal_id=journal.id, query="your query", content=False
33+
)
34+
print(f"Search results: {search_res}")
35+
2536

2637
if __name__ == "__main__":
2738
main()

0 commit comments

Comments
 (0)