| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Google Analytics Data: Accesses report data in Google Analytics. Warning: Creating multiple Customer Applications, Accounts, or Projects to simulate or act as a single Customer Application, Account, or Project (respectively) or to circumvent Service-specific usage limits or quotas is a direct violation of Google Cloud Platform Terms of Service as well as Google APIs Terms of Service. These actions can result in immediate termination of your GCP project(s) without any warning.
In order to use this library, you first need to go through the following steps:
Install this library in a virtual environment using venv. venv is a tool that creates isolated Python environments. These isolated environments can have separate versions of Python packages, which allows you to isolate one project's dependencies from the dependencies of other projects.
With venv, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.
Code samples and snippets live in the samples/ folder.
Our client libraries are compatible with all current active and maintenance versions of Python.
Python >= 3.10, including 3.14
Python <= 3.9
If you are using an end-of-life version of Python, we recommend that you update as soon as possible to an actively supported version.
python3 -m venv <your-env>
source <your-env>/bin/activate
pip install google-analytics-datapy -m venv <your-env>
.\<your-env>\Scripts\activate
pip install google-analytics-dataThis library uses the standard Python logging functionality to log some RPC events that could be of interest for debugging and monitoring purposes. Note the following:
To enable logging for this library without any changes in your code, set the GOOGLE_SDK_PYTHON_LOGGING_SCOPE environment variable to a valid Google logging scope. This configures handling of logging events (at level logging.DEBUG or higher) from this library in a default manner, emitting the logged messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging event.
A logging scope is a period-separated namespace that begins with google, identifying the Python module or package to log.
NOTE: If the logging scope is invalid, the library does not set up any logging handlers.
export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=googleexport GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1You can also configure a valid logging scope using Python's standard logging mechanism.
import logging
from google.cloud import library_v1
base_logger = logging.getLogger("google")
base_logger.addHandler(logging.StreamHandler())
base_logger.setLevel(logging.DEBUG)import logging
from google.cloud import library_v1
base_logger = logging.getLogger("google.cloud.library_v1")
base_logger.addHandler(logging.StreamHandler())
base_logger.setLevel(logging.DEBUG)| Back | FazBrowse Home | New Git URL |