Skip to content

Commit 5f40950

Browse files
jorisvandenbosschejreback
authored andcommitted
CLN: remove deprecated google-analytics module (GH11308) (#15223)
1 parent fe255d8 commit 5f40950

File tree

5 files changed

+3
-722
lines changed

5 files changed

+3
-722
lines changed

doc/source/remote_data.rst

-60
Original file line numberDiff line numberDiff line change
@@ -29,63 +29,3 @@ modules to be independently updated to your pandas installation. The API for
2929
.. code-block:: python
3030
3131
from pandas_datareader import data, wb
32-
33-
34-
.. _remote_data.ga:
35-
36-
Google Analytics
37-
----------------
38-
39-
The :mod:`~pandas.io.ga` module provides a wrapper for
40-
`Google Analytics API <https://developers.google.com/analytics/devguides>`__
41-
to simplify retrieving traffic data.
42-
Result sets are parsed into a pandas DataFrame with a shape and data types
43-
derived from the source table.
44-
45-
Configuring Access to Google Analytics
46-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47-
48-
The first thing you need to do is to setup accesses to Google Analytics API. Follow the steps below:
49-
50-
#. In the `Google Developers Console <https://console.developers.google.com>`__
51-
#. enable the Analytics API
52-
#. create a new project
53-
#. create a new Client ID for an "Installed Application" (in the "APIs & auth / Credentials section" of the newly created project)
54-
#. download it (JSON file)
55-
#. On your machine
56-
#. rename it to ``client_secrets.json``
57-
#. move it to the ``pandas/io`` module directory
58-
59-
The first time you use the :func:`read_ga` function, a browser window will open to ask you to authentify to the Google API. Do proceed.
60-
61-
Using the Google Analytics API
62-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63-
64-
The following will fetch users and pageviews (metrics) data per day of the week, for the first semester of 2014, from a particular property.
65-
66-
.. code-block:: python
67-
68-
import pandas.io.ga as ga
69-
ga.read_ga(
70-
account_id = "2360420",
71-
profile_id = "19462946",
72-
property_id = "UA-2360420-5",
73-
metrics = ['users', 'pageviews'],
74-
dimensions = ['dayOfWeek'],
75-
start_date = "2014-01-01",
76-
end_date = "2014-08-01",
77-
index_col = 0,
78-
filters = "pagePath=~aboutus;ga:country==France",
79-
)
80-
81-
The only mandatory arguments are ``metrics,`` ``dimensions`` and ``start_date``. We strongly recommend that you always specify the ``account_id``, ``profile_id`` and ``property_id`` to avoid accessing the wrong data bucket in Google Analytics.
82-
83-
The ``index_col`` argument indicates which dimension(s) has to be taken as index.
84-
85-
The ``filters`` argument indicates the filtering to apply to the query. In the above example, the page URL has to contain ``aboutus`` AND the visitors country has to be France.
86-
87-
Detailed information in the following:
88-
89-
* `pandas & google analytics, by yhat <http://blog.yhathq.com/posts/pandas-google-analytics.html>`__
90-
* `Google Analytics integration in pandas, by Chang She <http://quantabee.wordpress.com/2012/12/17/google-analytics-pandas/>`__
91-
* `Google Analytics Dimensions and Metrics Reference <https://developers.google.com/analytics/devguides/reporting/core/dimsmets>`_

doc/source/whatsnew/v0.15.2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Other enhancements:
163163
p.all()
164164

165165
- Added support for ``utcfromtimestamp()``, ``fromtimestamp()``, and ``combine()`` on `Timestamp` class (:issue:`5351`).
166-
- Added Google Analytics (`pandas.io.ga`) basic documentation (:issue:`8835`). See :ref:`here<remote_data.ga>`.
166+
- Added Google Analytics (`pandas.io.ga`) basic documentation (:issue:`8835`). See `here<http://pandas.pydata.org/pandas-docs/version/0.15.2/remote_data.html#remote-data-ga>`__.
167167
- ``Timedelta`` arithmetic returns ``NotImplemented`` in unknown cases, allowing extensions by custom classes (:issue:`8813`).
168168
- ``Timedelta`` now supports arithemtic with ``numpy.ndarray`` objects of the appropriate dtype (numpy 1.8 or newer only) (:issue:`8884`).
169169
- Added ``Timedelta.to_timedelta64()`` method to the public API (:issue:`8884`).

doc/source/whatsnew/v0.20.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ Removal of prior version deprecations/changes
351351
- The ``pandas.rpy`` module is removed. Similar functionality can be accessed
352352
through the `rpy2 <https://rpy2.readthedocs.io/>`__ project.
353353
See the :ref:`R interfacing docs <rpy>` for more details.
354+
- The ``pandas.io.ga`` module with a ``google-analytics`` interface is removed (:issue:`11308`).
355+
Similar functionality can be found in the `Google2Pandas <https://github.com/panalysis/Google2Pandas>`__ package.
354356
- ``pd.to_datetime`` and ``pd.to_timedelta`` have dropped the ``coerce`` parameter in favor of ``errors`` (:issue:`13602`)
355357

356358

0 commit comments

Comments
 (0)