google-analytics-cli 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/PKG-INFO +1 -1
  2. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/pyproject.toml +1 -1
  3. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/agent_cmd.py +25 -3
  4. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/uv.lock +1 -1
  5. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/.github/workflows/ci.yml +0 -0
  6. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/.github/workflows/release.yml +0 -0
  7. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/.gitignore +0 -0
  8. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/.python-version +0 -0
  9. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/README.md +0 -0
  10. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/install.sh +0 -0
  11. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/__init__.py +0 -0
  12. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/api/__init__.py +0 -0
  13. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/api/client.py +0 -0
  14. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/auth/__init__.py +0 -0
  15. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/auth/credentials.py +0 -0
  16. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/auth/oauth.py +0 -0
  17. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/auth/service_account.py +0 -0
  18. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/__init__.py +0 -0
  19. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/access_bindings.py +0 -0
  20. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/access_reports.py +0 -0
  21. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/account_summaries.py +0 -0
  22. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/accounts.py +0 -0
  23. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/annotations.py +0 -0
  24. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/audiences.py +0 -0
  25. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/auth_cmd.py +0 -0
  26. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/bigquery_links.py +0 -0
  27. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/calculated_metrics.py +0 -0
  28. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/channel_groups.py +0 -0
  29. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/completions_cmd.py +0 -0
  30. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/config_cmd.py +0 -0
  31. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/custom_dimensions.py +0 -0
  32. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/custom_metrics.py +0 -0
  33. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/data_retention.py +0 -0
  34. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/data_streams.py +0 -0
  35. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/event_create_rules.py +0 -0
  36. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/event_edit_rules.py +0 -0
  37. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/firebase_links.py +0 -0
  38. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/google_ads_links.py +0 -0
  39. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/key_events.py +0 -0
  40. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/mp_secrets.py +0 -0
  41. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/properties.py +0 -0
  42. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/property_settings.py +0 -0
  43. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/reports.py +0 -0
  44. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/commands/upgrade_cmd.py +0 -0
  45. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/config/__init__.py +0 -0
  46. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/config/constants.py +0 -0
  47. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/config/store.py +0 -0
  48. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/main.py +0 -0
  49. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/utils/__init__.py +0 -0
  50. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/utils/describe.py +0 -0
  51. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/utils/dry_run.py +0 -0
  52. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/utils/errors.py +0 -0
  53. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/utils/output.py +0 -0
  54. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/src/ga_cli/utils/pagination.py +0 -0
  55. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/__init__.py +0 -0
  56. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/conftest.py +0 -0
  57. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_access_bindings.py +0 -0
  58. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_access_reports.py +0 -0
  59. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_account_summaries.py +0 -0
  60. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_accounts.py +0 -0
  61. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_agent_cmd.py +0 -0
  62. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_annotations.py +0 -0
  63. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_api_client.py +0 -0
  64. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_audiences.py +0 -0
  65. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_auth_cmd.py +0 -0
  66. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_bigquery_links.py +0 -0
  67. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_calculated_metrics.py +0 -0
  68. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_channel_groups.py +0 -0
  69. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_completions_cmd.py +0 -0
  70. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_config_cmd.py +0 -0
  71. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_credentials.py +0 -0
  72. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_custom_dimensions.py +0 -0
  73. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_custom_metrics.py +0 -0
  74. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_data_retention.py +0 -0
  75. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_data_streams.py +0 -0
  76. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_describe.py +0 -0
  77. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_dry_run.py +0 -0
  78. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_errors.py +0 -0
  79. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_event_create_rules.py +0 -0
  80. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_event_edit_rules.py +0 -0
  81. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_firebase_links.py +0 -0
  82. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_google_ads_links.py +0 -0
  83. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_install_script.sh +0 -0
  84. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_key_events.py +0 -0
  85. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_mp_secrets.py +0 -0
  86. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_output.py +0 -0
  87. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_pagination.py +0 -0
  88. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_properties.py +0 -0
  89. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_property_settings.py +0 -0
  90. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_quiet_nocolor.py +0 -0
  91. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_reports.py +0 -0
  92. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_reports_batch.py +0 -0
  93. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_reports_funnel.py +0 -0
  94. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_reports_pivot.py +0 -0
  95. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_service_account.py +0 -0
  96. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_upgrade_cmd.py +0 -0
  97. {google_analytics_cli-0.1.0 → google_analytics_cli-0.1.1}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-analytics-cli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Command-line interface for Google Analytics 4
5
5
  Project-URL: Homepage, https://github.com/daidalytics/google-analytics-cli
6
6
  Project-URL: Repository, https://github.com/daidalytics/google-analytics-cli
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "google-analytics-cli"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Command-line interface for Google Analytics 4"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -74,7 +74,7 @@ ga account-summaries list [-o json]
74
74
 
75
75
  ### Properties
76
76
  ```bash
77
- ga properties list [-a ACCOUNT_ID] [-o json]
77
+ ga properties list [-a ACCOUNT_ID] [-o json] # pipe: | jq '.[] | select(.displayName | test("prod"; "i"))'
78
78
  ga properties get [-p PROPERTY_ID] [-o json]
79
79
  ga properties create -a ACCOUNT_ID --name "Name" [--timezone TZ] [--currency CODE]
80
80
  ga properties update -p PROPERTY_ID [--name NAME] [--timezone TZ] [--currency CODE] [--industry CAT]
@@ -237,7 +237,7 @@ Get/set hybrid: no update flags = GET, any update flag = PATCH. Enhanced measure
237
237
 
238
238
  ### Reports
239
239
  ```bash
240
- ga reports run [-p PROPERTY_ID] -m metrics -d dimensions --start-date DATE --end-date DATE [--limit N] [-o json]
240
+ ga reports run [-p PROPERTY_ID] -m metrics -d dimensions --start-date DATE --end-date DATE [--limit N] [-o json] # pipe: | jq '[.[] | {date, sessions, users}]'
241
241
  ga reports pivot [-p PROPERTY_ID] -m metrics -d dimensions --pivot-field FIELD [--start-date DATE] [-o json]
242
242
  ga reports check-compatibility [-p PROPERTY_ID] [-m metrics] [-d dimensions] [-o json]
243
243
  ga reports metadata [-p PROPERTY_ID] [--type metrics|dimensions] [--search TEXT] [-o json]
@@ -263,6 +263,28 @@ ga completions bash|zsh|fish
263
263
  | `GA_CLI_CONFIG_DIR` | Override config directory |
264
264
  | `NO_COLOR` | Disable colored output |
265
265
 
266
+ ## Parsing Output
267
+
268
+ `-o json` produces machine-parseable output **meant for jq**. Always pipe through jq — never parse raw JSON manually.
269
+
270
+ ### Reusable jq recipes
271
+ ```bash
272
+ # Extract numeric IDs from resource names ("accounts/123" → "123")
273
+ ga accounts list -o json | jq -r '.[].name' | grep -o '[0-9]*$'
274
+
275
+ # Filter resources by display name (case-insensitive regex)
276
+ ga properties list -o json | jq '.[] | select(.displayName | test("prod"; "i"))'
277
+
278
+ # Pick specific fields
279
+ ga data-streams list -o json | jq '[.[] | {id: (.name | split("/") | last), displayName, type}]'
280
+
281
+ # Count results
282
+ ga custom-dimensions list -o json | jq 'length'
283
+
284
+ # Get first result's ID (useful for chaining)
285
+ ga properties list -o json | jq -r '.[0].name' | grep -o '[0-9]*$'
286
+ ```
287
+
266
288
  ## Agent Workflow
267
289
  Typical discover → act pattern:
268
290
  ```bash
@@ -299,7 +321,7 @@ ga data-streams list -o json | jq -r '.[].name' | grep -o '[0-9]*$'
299
321
  - **Start with `ga --describe`** — discover every command, parameter, type, and flag in one JSON call; cache the result
300
322
  - **Use `--dry-run` before mutations** — preview the exact API request before executing creates, updates, and deletes
301
323
  - **Set defaults first** — eliminates repetitive `--account-id` / `--property-id` flags from every command
302
- - **Always use `-o json`** — structured output is easier to parse than tables
324
+ - **Always use `-o json` and pipe through `jq`** — JSON output is machine-parseable; always pipe through `jq` to filter, extract IDs, or reshape — never parse raw output manually (see "Parsing Output" above)
303
325
  - **Use `check-compatibility` before complex reports** — avoids API errors from incompatible metric/dimension combos
304
326
  - **Use `metadata` to discover available metrics/dimensions** — `ga reports metadata -p ID --search revenue -o json`
305
327
  - **Parallelize independent operations** — run creates/deletes concurrently with `&` and `wait`
@@ -306,7 +306,7 @@ wheels = [
306
306
 
307
307
  [[package]]
308
308
  name = "google-analytics-cli"
309
- version = "0.1.0rc1"
309
+ version = "0.1.1"
310
310
  source = { editable = "." }
311
311
  dependencies = [
312
312
  { name = "click" },