Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Gapy is a thin service account client for Google Analytics.
First you need to create either a service account <https://developers.google.com/accounts/docs/OAuth2ServiceAccount>
_ or client ID in your
Google API Console <https://code.google.com/apis/console>
_. If you're
authenticating as a service account you'll need to download your private key.
If you're authenticating as a web or installed application you'll need to
download your client secrets file. Use the Google Developers Console <https://console.developers.google.com/>
_ to do this:
Then just create a gapy client and start querying.
storage_path
is the location where you want gapy to keep the storage.db
file that it will generate the first time it runs... code :: python
import gapy.client
# For a service account
client = gapy.client.from_private_key(
"your account name",
private_key="your private key",
storage_path="path/to/storage.db")
# For a web or installed application
client = gapy.client.from_secrets_file(
"/path/to/client_secrets.json",
storage_path="/path/to/storage.db")
)
reach_data = client.query.get("12345",
datetime(2012, 1, 1),
datetime(2012, 2, 2),
['ga:visits', 'ga:visitors'],
'ga:date')
This library is a layer over the Google Python API. If you wish to work on it, it may be necessary to consult the Google Analytics API documentation <https://developers.google.com/resources/api-libraries/documentation/analytics/v3/python/latest/analytics_v3.data.ga.html>
_.
FAQs
Painless Google Analytics
We found that gapy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.