Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
parafoxia committed Jul 26, 2021
1 parent 49928a4 commit f97ae0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sphinx.ext.intersphinx",
"sphinx_rtd_dark_mode",
]
autodoc_member_order = 'bysource'
autodoc_member_order = "bysource"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
8 changes: 7 additions & 1 deletion docs/starting/first-report.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ You can retrieve reports using the client's :code:`retrieve` method. This method
dimensions=("day",),
)
In this example, the first argument (:code:`dt.date.today() - dt.timedelta(days=28)`) is the date in which data should be collected from. You need to supply this for every request you make. It must also be a :code:`datetime.date` object, and *not* a :code:`datetime.datetime` object.

.. note::

If you're retrieving reports containing revenue data, some dates may be missing as revenue analytics are typically delayed by a few days. analytix does not account for this.

In this example, the first argument (:code:`dt.date.today() - dt.timedelta(days=28)`) is the date in which data should be collected from. You need to supply this for every request you make. It must also be a :code:`datetime.date` object, and *not* a :code:`datetime.datetime` object.
From version 2.1, there is an easier way of retrieving some simple reports in the form of factory methods. These are limited in their capabilites, but can massively speed up common retrievals. These factory methods also account for delayed revenue analytics in some situations. Here's the previous example done again taking advantage of one of these factory methods:

.. code-block:: python
report = client.daily_analytics(metrics=("views", "likes", "comments"))
Once the report has been retrieved, you can either save it as a JSON file, save it as a CSV file, or convert it to a pandas DataFrame (provided pandas is currently installed). Note that the JSON file would contain the raw data from the API:

Expand Down

0 comments on commit f97ae0e

Please sign in to comment.