Skip to content

Commit 08077c7

Browse files
authored
Merge pull request #22 from bugout-dev/rename-entrypoint
Renamed entry point of bugout module
2 parents 23c14b3 + ed83a8c commit 08077c7

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

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()

bugout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
__email__ = "engineering@bugout.dev"
99
__license__ = "MIT"
10-
__version__ = "0.1.8"
10+
__version__ = "0.1.9"
1111

1212
__all__ = (
1313
"__author__",

bugout/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

3-
BUGOUT_BROOD_URL = "https://auth.bugout.dev"
4-
BUGOUT_SPIRE_URL = "https://spire.bugout.dev"
3+
BUGOUT_BROOD_URL = os.environ.get("BUGOUT_BROOD_URL", "https://auth.bugout.dev")
4+
BUGOUT_SPIRE_URL = os.environ.get("BUGOUT_SPIRE_URL", "https://spire.bugout.dev")
55

66
REQUESTS_TIMEOUT = 5
77
REQUESTS_TIMEOUT_RAW = os.environ.get("BUGOUT_TIMEOUT_SECONDS")

sample.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
export BUGOUT_BROOD_URL="https://auth.bugout.dev"
2+
export BUGOUT_SPIRE_URL="https://spire.bugout.dev"
13
export BUGOUT_TIMEOUT_SECONDS=5

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040
zip_safe=False,
4141
install_requires=["pydantic>=1.6", "requests"],
4242
extras_require={"dev": ["black", "mypy"]},
43-
entry_points={"console_scripts": ["{0} = {0}.__main__:main".format(MODULE_NAME)]},
43+
entry_points={"console_scripts": ["{0}-py = {0}.__main__:main".format(MODULE_NAME)]},
4444
)

0 commit comments

Comments
 (0)