google-analytics-cli 0.2.1__tar.gz → 0.2.2__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 (109) hide show
  1. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/PKG-INFO +15 -2
  2. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/README.md +14 -0
  3. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/pyproject.toml +1 -2
  4. google_analytics_cli-0.2.2/src/ga_cli/config/constants.py +95 -0
  5. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/uv.lock +1 -12
  6. google_analytics_cli-0.2.1/src/ga_cli/config/constants.py +0 -61
  7. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.api-snapshots/analyticsadmin_v1alpha.json +0 -0
  8. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.api-snapshots/analyticsadmin_v1beta.json +0 -0
  9. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.api-snapshots/analyticsdata_v1alpha.json +0 -0
  10. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.api-snapshots/analyticsdata_v1beta.json +0 -0
  11. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.github/workflows/api-watch.yml +0 -0
  12. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.github/workflows/ci.yml +0 -0
  13. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.github/workflows/release.yml +0 -0
  14. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.gitignore +0 -0
  15. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/.python-version +0 -0
  16. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/install.sh +0 -0
  17. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/scripts/check_api_changes.py +0 -0
  18. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/__init__.py +0 -0
  19. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/api/__init__.py +0 -0
  20. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/api/client.py +0 -0
  21. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/auth/__init__.py +0 -0
  22. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/auth/credentials.py +0 -0
  23. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/auth/oauth.py +0 -0
  24. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/auth/service_account.py +0 -0
  25. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/__init__.py +0 -0
  26. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/access_bindings.py +0 -0
  27. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/access_reports.py +0 -0
  28. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/account_summaries.py +0 -0
  29. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/accounts.py +0 -0
  30. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/agent_cmd.py +0 -0
  31. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/annotations.py +0 -0
  32. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/audiences.py +0 -0
  33. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/auth_cmd.py +0 -0
  34. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/bigquery_links.py +0 -0
  35. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/calculated_metrics.py +0 -0
  36. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/channel_groups.py +0 -0
  37. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/completions_cmd.py +0 -0
  38. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/config_cmd.py +0 -0
  39. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/custom_dimensions.py +0 -0
  40. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/custom_metrics.py +0 -0
  41. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/data_retention.py +0 -0
  42. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/data_streams.py +0 -0
  43. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/enhanced_measurement.py +0 -0
  44. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/event_create_rules.py +0 -0
  45. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/event_edit_rules.py +0 -0
  46. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/firebase_links.py +0 -0
  47. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/google_ads_links.py +0 -0
  48. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/key_events.py +0 -0
  49. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/mp_secrets.py +0 -0
  50. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/properties.py +0 -0
  51. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/property_settings.py +0 -0
  52. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/reports.py +0 -0
  53. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/commands/upgrade_cmd.py +0 -0
  54. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/config/__init__.py +0 -0
  55. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/config/store.py +0 -0
  56. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/main.py +0 -0
  57. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/__init__.py +0 -0
  58. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/describe.py +0 -0
  59. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/dry_run.py +0 -0
  60. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/errors.py +0 -0
  61. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/filters.py +0 -0
  62. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/output.py +0 -0
  63. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/src/ga_cli/utils/pagination.py +0 -0
  64. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/__init__.py +0 -0
  65. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/conftest.py +0 -0
  66. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_access_bindings.py +0 -0
  67. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_access_reports.py +0 -0
  68. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_account_summaries.py +0 -0
  69. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_accounts.py +0 -0
  70. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_agent_cmd.py +0 -0
  71. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_annotations.py +0 -0
  72. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_api_client.py +0 -0
  73. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_api_diff.py +0 -0
  74. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_audiences.py +0 -0
  75. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_auth_cmd.py +0 -0
  76. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_bigquery_links.py +0 -0
  77. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_calculated_metrics.py +0 -0
  78. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_channel_groups.py +0 -0
  79. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_completions_cmd.py +0 -0
  80. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_config_cmd.py +0 -0
  81. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_credentials.py +0 -0
  82. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_custom_dimensions.py +0 -0
  83. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_custom_metrics.py +0 -0
  84. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_data_retention.py +0 -0
  85. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_data_streams.py +0 -0
  86. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_describe.py +0 -0
  87. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_dry_run.py +0 -0
  88. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_enhanced_measurement.py +0 -0
  89. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_errors.py +0 -0
  90. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_event_create_rules.py +0 -0
  91. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_event_edit_rules.py +0 -0
  92. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_filters.py +0 -0
  93. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_firebase_links.py +0 -0
  94. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_google_ads_links.py +0 -0
  95. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_install_script.sh +0 -0
  96. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_key_events.py +0 -0
  97. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_mp_secrets.py +0 -0
  98. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_output.py +0 -0
  99. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_pagination.py +0 -0
  100. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_properties.py +0 -0
  101. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_property_settings.py +0 -0
  102. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_quiet_nocolor.py +0 -0
  103. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_reports.py +0 -0
  104. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_reports_batch.py +0 -0
  105. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_reports_funnel.py +0 -0
  106. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_reports_pivot.py +0 -0
  107. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_service_account.py +0 -0
  108. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/tests/test_upgrade_cmd.py +0 -0
  109. {google_analytics_cli-0.2.1 → google_analytics_cli-0.2.2}/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.2.1
3
+ Version: 0.2.2
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
@@ -24,7 +24,6 @@ Requires-Dist: google-api-python-client>=2.0
24
24
  Requires-Dist: google-auth-oauthlib>=1.0
25
25
  Requires-Dist: google-auth>=2.0
26
26
  Requires-Dist: packaging>=23.0
27
- Requires-Dist: platformdirs>=4.0
28
27
  Requires-Dist: questionary>=2.0
29
28
  Requires-Dist: rich>=13.0
30
29
  Requires-Dist: shellingham>=1.3.0
@@ -298,6 +297,20 @@ jobs:
298
297
  rm /tmp/sa-key.json
299
298
  ```
300
299
 
300
+ ## Troubleshooting
301
+
302
+ **`ga` runs `git add` instead of GA CLI.** You have a shell alias shadowing the command — commonly `alias ga='git add'` in `~/.gitconfig`-style setups or `~/.zshrc`/`~/.bashrc`. Run `type ga` to confirm, then `unalias ga` (or remove the alias from your shell config) and restart your shell.
303
+
304
+ **`ga: command not found` after install.** Your Python user bin directory isn't on `PATH`. For `pip install --user`, `pipx`, or `uv tool install`, the binary lives in `~/.local/bin` on Linux/macOS. Add it to your shell config:
305
+
306
+ ```bash
307
+ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
308
+ ```
309
+
310
+ Then restart your shell. `pipx ensurepath` and `uv tool update-shell` can do this automatically.
311
+
312
+ **Upgrading from 0.2.1 or earlier on macOS.** Older versions stored config at `~/Library/Application Support/ga-cli/`. GA CLI now uses `~/.config/ga-cli/` on all platforms and will migrate the directory automatically the first time you run any command. No action required.
313
+
301
314
  ## Privacy
302
315
 
303
316
  GA CLI stores authentication credentials locally on your machine. No data is sent to any third party — all communication is directly between your machine and Google's APIs.
@@ -265,6 +265,20 @@ jobs:
265
265
  rm /tmp/sa-key.json
266
266
  ```
267
267
 
268
+ ## Troubleshooting
269
+
270
+ **`ga` runs `git add` instead of GA CLI.** You have a shell alias shadowing the command — commonly `alias ga='git add'` in `~/.gitconfig`-style setups or `~/.zshrc`/`~/.bashrc`. Run `type ga` to confirm, then `unalias ga` (or remove the alias from your shell config) and restart your shell.
271
+
272
+ **`ga: command not found` after install.** Your Python user bin directory isn't on `PATH`. For `pip install --user`, `pipx`, or `uv tool install`, the binary lives in `~/.local/bin` on Linux/macOS. Add it to your shell config:
273
+
274
+ ```bash
275
+ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
276
+ ```
277
+
278
+ Then restart your shell. `pipx ensurepath` and `uv tool update-shell` can do this automatically.
279
+
280
+ **Upgrading from 0.2.1 or earlier on macOS.** Older versions stored config at `~/Library/Application Support/ga-cli/`. GA CLI now uses `~/.config/ga-cli/` on all platforms and will migrate the directory automatically the first time you run any command. No action required.
281
+
268
282
  ## Privacy
269
283
 
270
284
  GA CLI stores authentication credentials locally on your machine. No data is sent to any third party — all communication is directly between your machine and Google's APIs.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "google-analytics-cli"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "Command-line interface for Google Analytics 4"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -28,7 +28,6 @@ dependencies = [
28
28
  "google-auth>=2.0",
29
29
  "rich>=13.0",
30
30
  "questionary>=2.0",
31
- "platformdirs>=4.0",
32
31
  "packaging>=23.0",
33
32
  ]
34
33
 
@@ -0,0 +1,95 @@
1
+ """Application constants and configuration paths."""
2
+
3
+ import os
4
+ import shutil
5
+ from pathlib import Path
6
+
7
+ # App identity
8
+ APP_NAME = "ga-cli"
9
+
10
+ # OAuth 2.0 scopes
11
+ OAUTH_SCOPES = [
12
+ "openid",
13
+ "https://www.googleapis.com/auth/analytics.readonly",
14
+ "https://www.googleapis.com/auth/analytics.edit",
15
+ "https://www.googleapis.com/auth/analytics.manage.users",
16
+ "https://www.googleapis.com/auth/userinfo.email",
17
+ "https://www.googleapis.com/auth/userinfo.profile",
18
+ ]
19
+
20
+ # OAuth callback server
21
+ OAUTH_CALLBACK_PORT = 8085
22
+
23
+ # Track whether we've already attempted the legacy macOS migration this process.
24
+ _legacy_migration_attempted = False
25
+
26
+
27
+ def _migrate_legacy_macos_config(new_dir: Path) -> None:
28
+ """Move config from the legacy macOS path to the new XDG-style path.
29
+
30
+ Versions <=0.2.1 used ``platformdirs``, which on macOS resolves to
31
+ ``~/Library/Application Support/ga-cli/``. We now standardize on
32
+ ``~/.config/ga-cli/`` across all platforms. If the legacy directory exists
33
+ and the new one doesn't, move it. Runs at most once per process.
34
+ """
35
+ global _legacy_migration_attempted
36
+ if _legacy_migration_attempted:
37
+ return
38
+ _legacy_migration_attempted = True
39
+
40
+ legacy_dir = Path.home() / "Library" / "Application Support" / APP_NAME
41
+ if legacy_dir.is_dir() and not new_dir.exists():
42
+ try:
43
+ new_dir.parent.mkdir(parents=True, exist_ok=True)
44
+ shutil.move(str(legacy_dir), str(new_dir))
45
+ except OSError:
46
+ # Migration is best-effort; fall through and let callers create
47
+ # the new directory themselves if needed.
48
+ pass
49
+
50
+
51
+ # Configuration directory
52
+ # Priority: GA_CLI_CONFIG_DIR env var > ~/.config/ga-cli/ (all platforms)
53
+ def get_config_dir() -> Path:
54
+ """Get the configuration directory path.
55
+
56
+ Resolution order:
57
+ 1. ``GA_CLI_CONFIG_DIR`` environment variable (used in tests too).
58
+ 2. ``~/.config/ga-cli/`` on all platforms.
59
+ """
60
+ env_dir = os.environ.get("GA_CLI_CONFIG_DIR")
61
+ if env_dir:
62
+ return Path(env_dir)
63
+ config_dir = Path.home() / ".config" / APP_NAME
64
+ _migrate_legacy_macos_config(config_dir)
65
+ return config_dir
66
+
67
+
68
+ def get_credentials_path() -> Path:
69
+ """Path to stored OAuth credentials."""
70
+ return get_config_dir() / "credentials.json"
71
+
72
+
73
+ def get_config_path() -> Path:
74
+ """Path to user configuration file."""
75
+ return get_config_dir() / "config.json"
76
+
77
+
78
+ def get_auth_method_path() -> Path:
79
+ """Path to auth method tracking file."""
80
+ return get_config_dir() / "auth-method.json"
81
+
82
+
83
+ def get_client_secret_path() -> Path:
84
+ """Path to OAuth client secret file (alternative to env vars)."""
85
+ return get_config_dir() / "client_secret.json"
86
+
87
+
88
+ def get_update_check_path() -> Path:
89
+ """Path to update-check timestamp file."""
90
+ return get_config_dir() / "update-check.json"
91
+
92
+
93
+ # Pagination defaults
94
+ DEFAULT_PAGE_SIZE = 50
95
+ MAX_PAGE_SIZE = 200
@@ -306,7 +306,7 @@ wheels = [
306
306
 
307
307
  [[package]]
308
308
  name = "google-analytics-cli"
309
- version = "0.1.4"
309
+ version = "0.2.1"
310
310
  source = { editable = "." }
311
311
  dependencies = [
312
312
  { name = "click" },
@@ -314,7 +314,6 @@ dependencies = [
314
314
  { name = "google-auth" },
315
315
  { name = "google-auth-oauthlib" },
316
316
  { name = "packaging" },
317
- { name = "platformdirs" },
318
317
  { name = "questionary" },
319
318
  { name = "rich" },
320
319
  { name = "shellingham" },
@@ -334,7 +333,6 @@ requires-dist = [
334
333
  { name = "google-auth", specifier = ">=2.0" },
335
334
  { name = "google-auth-oauthlib", specifier = ">=1.0" },
336
335
  { name = "packaging", specifier = ">=23.0" },
337
- { name = "platformdirs", specifier = ">=4.0" },
338
336
  { name = "questionary", specifier = ">=2.0" },
339
337
  { name = "rich", specifier = ">=13.0" },
340
338
  { name = "shellingham", specifier = ">=1.3.0" },
@@ -499,15 +497,6 @@ wheels = [
499
497
  { url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" },
500
498
  ]
501
499
 
502
- [[package]]
503
- name = "platformdirs"
504
- version = "4.9.4"
505
- source = { registry = "https://pypi.org/simple" }
506
- sdist = { url = "https://files.pythonhosted.org/packages/19/56/8d4c30c8a1d07013911a8fdbd8f89440ef9f08d07a1b50ab8ca8be5a20f9/platformdirs-4.9.4.tar.gz", hash = "sha256:1ec356301b7dc906d83f371c8f487070e99d3ccf9e501686456394622a01a934", size = 28737, upload-time = "2026-03-05T18:34:13.271Z" }
507
- wheels = [
508
- { url = "https://files.pythonhosted.org/packages/63/d7/97f7e3a6abb67d8080dd406fd4df842c2be0efaf712d1c899c32a075027c/platformdirs-4.9.4-py3-none-any.whl", hash = "sha256:68a9a4619a666ea6439f2ff250c12a853cd1cbd5158d258bd824a7df6be2f868", size = 21216, upload-time = "2026-03-05T18:34:12.172Z" },
509
- ]
510
-
511
500
  [[package]]
512
501
  name = "pluggy"
513
502
  version = "1.6.0"
@@ -1,61 +0,0 @@
1
- """Application constants and configuration paths."""
2
-
3
- import os
4
- from pathlib import Path
5
-
6
- from platformdirs import user_config_dir
7
-
8
- # App identity
9
- APP_NAME = "ga-cli"
10
-
11
- # OAuth 2.0 scopes
12
- OAUTH_SCOPES = [
13
- "openid",
14
- "https://www.googleapis.com/auth/analytics.readonly",
15
- "https://www.googleapis.com/auth/analytics.edit",
16
- "https://www.googleapis.com/auth/analytics.manage.users",
17
- "https://www.googleapis.com/auth/userinfo.email",
18
- "https://www.googleapis.com/auth/userinfo.profile",
19
- ]
20
-
21
- # OAuth callback server
22
- OAUTH_CALLBACK_PORT = 8085
23
-
24
- # Configuration directory
25
- # Priority: GA_CLI_CONFIG_DIR env var > platformdirs (XDG-compliant)
26
- def get_config_dir() -> Path:
27
- """Get the configuration directory path."""
28
- env_dir = os.environ.get("GA_CLI_CONFIG_DIR")
29
- if env_dir:
30
- return Path(env_dir)
31
- return Path(user_config_dir(APP_NAME)) # ~/.config/ga-cli/ on Linux/macOS
32
-
33
-
34
- def get_credentials_path() -> Path:
35
- """Path to stored OAuth credentials."""
36
- return get_config_dir() / "credentials.json"
37
-
38
-
39
- def get_config_path() -> Path:
40
- """Path to user configuration file."""
41
- return get_config_dir() / "config.json"
42
-
43
-
44
- def get_auth_method_path() -> Path:
45
- """Path to auth method tracking file."""
46
- return get_config_dir() / "auth-method.json"
47
-
48
-
49
- def get_client_secret_path() -> Path:
50
- """Path to OAuth client secret file (alternative to env vars)."""
51
- return get_config_dir() / "client_secret.json"
52
-
53
-
54
- def get_update_check_path() -> Path:
55
- """Path to update-check timestamp file."""
56
- return get_config_dir() / "update-check.json"
57
-
58
-
59
- # Pagination defaults
60
- DEFAULT_PAGE_SIZE = 50
61
- MAX_PAGE_SIZE = 200