Skip to content

Commit f31bbfe

Browse files
Update dependencies and enhance documentation
- Bumped `setuptools` version requirement in `pyproject.toml` to ensure compatibility with newer features. - Added `license-files` entry in `pyproject.toml` for better license management. - Expanded `README.md` with additional usage examples for the `auralog` helper function, improving clarity for users. - Updated `dev-docs/README.md` to include project description, package naming conventions, and publishing setup details for maintainers.
1 parent beb2aaf commit f31bbfe

5 files changed

Lines changed: 120 additions & 33 deletions

File tree

‎LICENSE‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ISC License
2+
3+
Copyright (c) 2026, Bhanu Vardhan Reddy Nanavala
4+
5+
Contact: nbhanuvardhanreddy@gmail.com
6+
7+
Permission to use, copy, modify, and/or distribute this software for any
8+
purpose with or without fee is hereby granted, provided that the above
9+
copyright notice and this permission notice appear in all copies.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

‎README.md‎

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
Command-line client for [Auralogger](https://auralogger.com): `init`, `server-check`, `client-check`, `test-serverlog`, `test-clientlog`, and `get-logs`, plus the `aura_log` helper for Python apps.
44

5+
```text
6+
├── LICENSE
7+
├── pyproject.toml
8+
├── README.md
9+
```
10+
11+
## Package naming (Node vs Python)
12+
13+
- Python distribution name: `auralogger` (install with `pip install auralogger`)
14+
- Node distribution name: `auralogger-cli` (install with `npm install auralogger-cli`)
15+
- Both expose the CLI command `auralogger`, but package names on package indexes are intentionally different.
16+
517
## Install
618

719
From [PyPI](https://pypi.org/) (once published):
@@ -22,8 +34,6 @@ The CLI uses **your shell’s current working directory** as the project root. I
2234

2335
Configuration is **environment variables** only — see **`user-docs/environment.md`** for **`AURALOGGER_PROJECT_TOKEN`**, **`AURALOGGER_USER_SECRET`**, and the publishable `AURALOGGER_PROJECT_*` keys. There is no `auralogger.config.json`.
2436

25-
**Wire contract (matches Node):** `proj_auth` is **`POST /api/{project_token}/proj_auth`** with the token in the path only. **`get-logs`** uses **`POST /api/{project_token}/logs`** with headers **`secret`** and **`user_secret`** both set to your **user secret**. The server ingest socket is **`WS /{project_token}/create_log`** with **`Authorization: Bearer <user_secret>`**. Set **`AURALOGGER_PROJECT_TOKEN`** and **`AURALOGGER_USER_SECRET`**; legacy **`AURALOGGER_PROJECT_SECRET`** is treated as the user secret (with a deprecation warning) if **`AURALOGGER_USER_SECRET`** is unset.
26-
2737
```bash
2838
cd /path/to/my-app
2939
auralogger init
@@ -63,6 +73,28 @@ auralog(
6373
)
6474
```
6575

76+
## Using the generated `auralog(...)` helper
77+
78+
After `auralogger init`, paste the server snippet into your app (for example `your_server_auralog_file.py`), then use it like this:
79+
80+
```python
81+
from your_server_auralog_file import auralog
82+
83+
auralog(
84+
"info",
85+
"Request completed",
86+
"api/orders#create",
87+
{"order_id": "ord_123", "status": 201},
88+
)
89+
# expected: [info] Request completed @ api/orders#create {"order_id": "ord_123", "status": 201}
90+
91+
auralog("warn", "Cache miss")
92+
# expected: [warn] Cache miss
93+
94+
auralog("error", "Payment gateway timeout", data={"provider": "stripe"})
95+
# expected: [error] Payment gateway timeout {"provider": "stripe"}
96+
```
97+
6698
## Commands
6799

68100
```text
@@ -93,21 +125,3 @@ Install editable package + development tooling (currently Ruff):
93125
cd python
94126
pip install -e ".[dev]"
95127
```
96-
97-
## Publishing (maintainers)
98-
99-
Releases are automated through `.github/workflows/python-publish.yml`.
100-
101-
- The workflow runs on GitHub release publish events only when the tag matches `python-v*` (for example, `python-v0.1.1`), or through manual `workflow_dispatch`.
102-
- Configure repository secret `PYPI_API_TOKEN` with a PyPI API token.
103-
- Before tagging, bump `version` in `python/pyproject.toml` and update `python/CHANGELOG.md`.
104-
105-
Manual fallback from this directory, after configuring PyPI credentials (`twine`):
106-
107-
```bash
108-
python -m pip install build twine
109-
python -m build
110-
twine upload dist/*
111-
```
112-
113-
End users only need `pip install auralogger` once the release is on PyPI.

‎auralogger/cli/commands/init.py‎

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,28 +172,26 @@ def _build_server_integration_snippet() -> str:
172172
[
173173
"import os",
174174
"from typing import Any, Dict, Literal, Optional",
175-
"from pydantic import BaseModel, Field",
176175
"from auralogger import AuraServer",
177176
"",
178-
"class LogInputs(BaseModel):",
179-
" type: Literal['debug', 'info', 'warn', 'error'] = 'info'",
180-
" message: str = Field(..., min_length=1)",
181-
" location: Optional[str] = None",
182-
" data: Optional[Dict[str, Any]] = None",
183-
"",
184177
"def configure_auralogger() -> None:",
185178
" project_token = os.environ.get('AURALOGGER_PROJECT_TOKEN', '').strip()",
186179
" user_secret = os.environ.get('AURALOGGER_USER_SECRET', '').strip()",
187180
" if not project_token or not user_secret:",
188181
" raise RuntimeError('Missing Auralogger server env variables')",
189182
" AuraServer.sync_from_secret(project_token, user_secret)",
190183
"",
191-
"def auralog(loginputs: LogInputs) -> None:",
184+
"def auralog(",
185+
" type: Literal['debug', 'info', 'warn', 'error'],",
186+
" message: str,",
187+
" location: Optional[str] = None,",
188+
" data: Optional[Dict[str, Any]] = None,",
189+
") -> None:",
192190
" AuraServer.log(",
193-
" loginputs.type,",
194-
" loginputs.message,",
195-
" loginputs.location,",
196-
" loginputs.data,",
191+
" type,",
192+
" message,",
193+
" location,",
194+
" data,",
197195
" )",
198196
]
199197
)
@@ -226,6 +224,28 @@ def _build_client_integration_snippet() -> str:
226224
)
227225

228226

227+
def _build_server_usage_snippet() -> str:
228+
return "\n".join(
229+
[
230+
"from your_server_auralog_file import auralog",
231+
"",
232+
"auralog(",
233+
" 'info',",
234+
" 'Request completed',",
235+
" 'api/orders#create',",
236+
" {'order_id': 'ord_123', 'status': 201},",
237+
")",
238+
"# expected: [info] Request completed @ api/orders#create {'order_id': 'ord_123', 'status': 201}",
239+
"",
240+
"auralog('warn', 'Cache miss')",
241+
"# expected: [warn] Cache miss",
242+
"",
243+
"auralog('error', 'Payment gateway timeout', data={'provider': 'stripe'})",
244+
"# expected: [error] Payment gateway timeout {'provider': 'stripe'}",
245+
]
246+
)
247+
248+
229249
def print_two_auralog_explainer() -> None:
230250
print()
231251
print(
@@ -274,6 +294,10 @@ def print_init_helper_snippets_with_character_voices() -> None:
274294
"Server-side AuraLog — auralogger (AuraServer)",
275295
_build_server_integration_snippet(),
276296
)
297+
_print_python_code_story(
298+
"Using your generated auralog helper (server example logs)",
299+
_build_server_usage_snippet(),
300+
)
277301
print(
278302
dim(
279303
" If your frontend runtime is JavaScript/TypeScript, use the Node package "

‎dev-docs/README.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,44 @@
22

33
Contributor-oriented notes for the Python `auralogger` package.
44

5+
## Python package repo
6+
7+
- Source/publishing repo: [Beever-Labs/auralogger-python](https://github.com/Beever-Labs/auralogger-python)
8+
9+
## Project description
10+
11+
`auralogger` (Python): command-line client for Auralogger: `init`, `server-check`, `client-check`, `test-serverlog`, `test-clientlog`, and `get-logs`, plus the `aura_log` helper for Python apps.
12+
13+
```text
14+
├── LICENSE
15+
├── pyproject.toml
16+
├── README.md
17+
```
18+
19+
## Package naming (Node vs Python)
20+
21+
- Python distribution name: `auralogger` (`pip install auralogger`)
22+
- Node distribution name: `auralogger-cli` (`npm install auralogger-cli`)
23+
- Both expose the CLI command `auralogger`, but package-index names are intentionally different.
24+
525
## Start here
626

727
- `file-map.md`: quick map of what each important module does
828
- `routes.md`: HTTP + WebSocket routes and where they are used in this package
929

1030
Auth contract (match Node / hosted API): **`POST /api/{project_token}/proj_auth`** — token in path only. **`POST /api/{project_token}/logs`** — headers **`secret`** and **`user_secret`** both set to the **user secret**. Server ingest WebSocket — **`Authorization: Bearer <user_secret>`** on **`/{project_token}/create_log`**.
1131

32+
## Publishing setup (maintainers)
33+
34+
- Automated release workflow: `.github/workflows/python-publish.yml`
35+
- Trigger: GitHub release publish for tags matching `python-v*` (for example, `python-v0.1.1`) or manual `workflow_dispatch`
36+
- Required secret: `PYPI_API_TOKEN`
37+
- Before release: bump `version` in `pyproject.toml` and update `CHANGELOG.md`
38+
- Manual fallback:
39+
- `python -m pip install build twine`
40+
- `python -m build`
41+
- `twine upload dist/*`
42+
1243
## Related folders
1344

1445
- `user-docs/commands.md`: end-user setup and command reference (keep in sync when behavior changes)

‎pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61", "wheel"]
2+
requires = ["setuptools>=77", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -8,6 +8,7 @@ version = "0.1.0"
88
description = "CLI for Auralogger: init, logs, and websocket checks (project-scoped to your cwd)."
99
readme = "README.md"
1010
license = "ISC"
11+
license-files = ["LICENSE"]
1112
requires-python = ">=3.8"
1213
authors = [
1314
{ name = "Bhanu Vardhan Reddy Nanavala" },

0 commit comments

Comments
 (0)