Git Product home page Git Product logo

aioga's Introduction

aioga
=====

:info: Google Analytics client for asyncio

.. image:: https://travis-ci.com/aio-libs/aioga.svg?branch=master
   :target: https://travis-ci.com/aio-libs/aioga
   :alt: Travis status for master branch

.. image:: https://img.shields.io/pypi/v/aioga.svg
    :target: https://pypi.python.org/pypi/aioga

Installation
============

.. code-block:: shell

    pip install aioga

Usage
=====

.. code-block:: python

    import asyncio
    import uuid

    from aioga import GA

    TRACKING_ID = 'XX-XXXXXXXX-X'


    async def go():
        cid = uuid.uuid4()

        async with GA(TRACKING_ID) as ga:
            ga.event(str(cid), ec='tests', ea='success from context manager')
            # all methods returns asynio.Tasks, which can be awaited if needed


    loop = asyncio.get_event_loop()
    loop.run_until_complete(go())
    loop.close()


Documentation
=============

The library is asynchronous client for measurement protocol.
All available hit types are supported.

`Full documentation <https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide>`_ of measurement protocol provides by google


Available methods
-----------------

* pageview
* screenview
* event
* transaction
* item
* social
* exception
* timing

Available parameters
--------------------

All methods require cid (Client ID). The value of this field
should be a random UUID (version 4) as described in
`<http://www.ietf.org/rfc/rfc4122.txt>`_


Library support all available parametes for measurement protocol
(documentation `here <https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters>`_)

aioga's People

Contributors

asvetlov avatar dependabot[bot] avatar eventh avatar froosty avatar hellysmile avatar jettify avatar webknjaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aioga's Issues

Fix compatibility with aiohttp3

Aiohttp3 replaces the built-in timeout method with the async-timeout module

Traceback (most recent call last):
File "test.py", line 18, in
loop.run_until_complete(go())
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
return future.result()
File "test.py", line 13, in go
ga.event(str(cid), ec='tests', ea='success from context manager')
File "/usr/local/lib/python3.6/site-packages/aioga/init.py", line 129, in aexit
yield from self.close()
File "/usr/local/lib/python3.6/site-packages/aioga/init.py", line 118, in close
yield from asyncio.gather(*self.futs, loop=self.loop)
File "/usr/local/lib/python3.6/site-packages/aioga/init.py", line 65, in __request
with aiohttp.Timeout(self.timeout, loop=self.loop):

AttributeError: module 'aiohttp' has no attribute 'Timeout'

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x10f2abba8>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.