Skip to content

Commit

Permalink
Added CONTRIBUtiNG doc. Updated README example and added liscense inf…
Browse files Browse the repository at this point in the history
…o to setup.py
  • Loading branch information
mcohoon committed Feb 10, 2016
1 parent 2729183 commit 73cb2a1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 7 deletions.
27 changes: 27 additions & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Want to contribute? Great! First, read this page (including the small print at the end).

### Before you contribute
Before we can use your code, you must sign the
[Google Individual Contributor License Agreement]
(https://cla.developers.google.com/about/google-individual)
(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]
(https://cla.developers.google.com/about/google-corporate).
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,34 @@ Library for converting V3 API request to v4 API requests.

## 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.
There are two methods of using the gav4 library. You can `apply` the library to an authorized Google Analytics Service object, which exposes a get method that operates much like the current Core Reporting API V3.


from gcloud import datastore
import gav4

gav4.apply_gav4(analytics)

# Call the gav4_get method with a V3 request and get a V3 response.
v3_response = analytics.gav4_get(v3_request).execute()

# Alternatively you can convert the request directly

Alternatively you can convert the requests and responses directly.


# Convert a V3 request into a V4 request.
v4_request = gav4.convert_request(v3_request)

# Call the V4 API.
v4_response = analytics.reports().batchGet(body=v4_request).execute()

# Convert the V4 API response into a V3 response.
v3_response = gav4.convert_report(v4_response.get('reports', [])[0])


## Contributing

1. **Please sign one of the contributor license agreements below.**
2. Fork the repo, develop and test your code changes, add docs.
2. Fork the repository, develop and test your code changes, add docs.
3. Make sure that your commit messages clearly describe the changes.
4. Send a pull request.

Expand Down
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/usr/bin/env python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# 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.

import os

Expand Down

0 comments on commit 73cb2a1

Please sign in to comment.