Skip to content

Commit

Permalink
Initial commit of gav4, the Google Analytics V4compatibility library.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcohoon committed Dec 22, 2015
1 parent 059f4a0 commit 1ee0f2a
Show file tree
Hide file tree
Showing 7 changed files with 981 additions and 4 deletions.
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2015 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -199,4 +199,3 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# gav4-python
# Google Analytics V4 Compatibility Library

Library for converting V3 API request to v4 API requests.

## Quick Start

$ pip install --upgrade gav4


## Typical usage example

There are two methods of using the gav4 libary. The first being you can
`apply` the library to an authorized Google Analytics Service object, which
exposes a get method that operates much like the current v3 Core Reporting
API. Alternatively you can call the conversion methods directly.


from gcloud import datastore
import gav4
gav4.apply_gav4(analytics)

v3_response = analytics.gav4_get(v3_request).execute()

# Alternatively you can convert the request directly
v4_request = gav4.convert_request(v3_request)

v4_response = analytics.reports().batchGet(body=v4_request).execute()

v3_response = gav4.convert_report(v4_response.get('reports', [])[0])


## Contributing

Before we can use your code, you must sign the
[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
(CLA), which you can do online. The CLA is necessary mainly because you own the
copyright to your changes, even after your contribution becomes part of our
codebase, so we need your permission to use and distribute your code. We also
need to be sure of various other things—for instance that you'll tell us if you
know that your code infringes on other people's patents. You don't have to sign
the CLA until after you've submitted your code for review and a member has
approved it, but you must do it before we can put your code into our codebase.
Before you start working on a larger contribution, you should get in touch with
us first through the issue tracker with your idea so that we can help out and
possibly guide you. Coordinating up front makes it much easier to avoid
frustration later on.

### Code reviews
All submissions, including submissions by project members, require review. We
use Github pull requests for this purpose.

### The small print
Contributions made by corporations are covered by a different agreement than
the one above, the Software Grant and Corporate Contributor License Agreement.
Loading

0 comments on commit 1ee0f2a

Please sign in to comment.