Skip to content

Commit

Permalink
Merge pull request #5 from miermans/release/1.0.0a3
Browse files Browse the repository at this point in the history
Rename library to aio_snowplow_tracker
  • Loading branch information
mmiermans committed Jul 4, 2022
2 parents 3e690ea + 51d00e1 commit eba8661
Show file tree
Hide file tree
Showing 30 changed files with 157 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Tests
run: |
pytest --cov=snowplow_tracker --cov-report=xml
pytest --cov=aio_snowplow_tracker --cov-report=xml
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
Expand Down
6 changes: 5 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Version 1.0.0a2 (2022-06-01)
Version 1.0.0a3 (2022-06-03)
--------------------------
Breaking: Changed import from `snowplow_tracker` to `aio_snowplow_tracker` to support installing both libraries.

Version 1.0.0a2 (2022-06-02)
--------------------------
Breaking: Emitter and Tracker leverage asyncio. `Tracker.track_*` calls must now be awaited.
Breaking: Remove AsyncEmitter. Use `asyncio.gather` instead.
Expand Down
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

The Snowplow Python Tracker is maintained by the Engineering team at Snowplow Analytics. We welcome suggestions for improvements and bug fixes to all Snowplow Trackers.
The Aio Snowplow Python Tracker is maintained by individual contributors unaffiliated with the team at Snowplow Analytics. We welcome suggestions for improvements and bug fixes to all Snowplow Trackers.

We are extremely grateful for all contributions we receive, whether that is reporting an issue or a change to the code which can be made in the form of a pull request.

Expand Down Expand Up @@ -62,12 +62,6 @@ If you feel your pull request has been forgotten, please ping one or more mainta

If your pull request is fairly chunky, there might be a non-trivial delay between the moment the pull request is approved and the moment it gets merged. This is because your pull request will have been scheduled for a specific milestone which might or might not be actively worked on by a maintainer at the moment.

### Contributor license agreement

We require outside contributors to sign a Contributor license agreement (or CLA) before we can merge their pull requests.
You can find more information on the topic in [the dedicated wiki page](https://github.com/snowplow/snowplow/wiki/CLA).
The @snowplowcla bot will guide you through the process.

## Getting in touch

### Community support requests
Expand Down
56 changes: 34 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ asyncio Python Analytics for Snowplow
Overview
########

This is a fork of to the official `Snowplow Python Tracker`_ that applies asyncio_ for high-performance event tracking.
This is a fork of to the official `Snowplow Python Tracker`_ that leverages asyncio_ for high-performance event tracking.

.. _`Snowplow Python Tracker`: https://github.com/snowplow/snowplow-python-tracker
.. _asyncio: https://realpython.com/async-io-python/
Expand All @@ -38,48 +38,60 @@ Example

.. code-block:: python
from snowplow_tracker import Tracker, Emitter, Subject
from aio_snowplow_tracker import Tracker, Emitter, Subject
import asyncio
async def main():
e = Emitter('d3rkrsqld9gmqf.cloudfront.net')
s = Subject().set_user_id('5432')
t = Tracker(e, subject=s, app_id='example-app')
await t.track_page_view('http://example.com', 'Example Page')
await t.track_page_view('http://example.com', 'Title')
asyncio.run(main())
Installation
#############
To install the Snowplow Python Tracker locally, assuming you already have Pip installed:

.. code-block:: shell
$ pip install aio-snowplow-tracker --upgrade
To install the Snowplow Tracker with extras:

.. code-block:: shell
# Redis extra
$ pip install aio-snowplow-tracker[redis]
# Celery extra
$ pip install aio-snowplow-tracker[celery]
Find out more
#############
The official Snowplow Python Tracker documentation is applicable to this library as well, with some minor changes:

1. :code:`import aio_snowplow_tracker` instead of :code:`import snowplow_tracker`.

+---------------------------------+---------------------------+-----------------------------------+
| Technical Docs | Setup Guide | Contributing |
+=================================+===========================+===================================+
| |techdocs|_ | |setup|_ | |contributing| |
+---------------------------------+---------------------------+-----------------------------------+
| `Technical Docs`_ | `Setup Guide`_ | `Contributing`_ |
+---------------------------------+---------------------------+-----------------------------------+
2. :code:`await` Tracker calls.

+---------------------------------+-----------------------------------+
| Technical Docs | Contributing |
+=================================+===================================+
| |techdocs|_ | |contributing| |
+---------------------------------+-----------------------------------+
| `Technical Docs`_ | `Contributing`_ |
+---------------------------------+-----------------------------------+

.. |techdocs| image:: https://d3i6fms1cm1j0i.cloudfront.net/github/images/techdocs.png
.. |setup| image:: https://d3i6fms1cm1j0i.cloudfront.net/github/images/setup.png
.. |contributing| image:: https://d3i6fms1cm1j0i.cloudfront.net/github/images/contributing.png

.. _techdocs: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/python-tracker/
.. _setup: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/python-tracker/setup/

.. _`Technical Docs`: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/python-tracker/
.. _`Setup Guide`: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/python-tracker/setup/
.. _`Contributing`: https://github.com/snowplow/snowplow-python-tracker/blob/master/CONTRIBUTING.md

Python Support
##############

+----------------+--------------------------+
| Python version | snowplow-tracker version |
+================+==========================+
| >=3.7 | 1.0.0 |
+----------------+--------------------------+
.. _`Contributing`: https://github.com/miermans/aio-snowplow-python-tracker/blob/master/CONTRIBUTING.md

Maintainer Quickstart
#######################
Expand Down
12 changes: 12 additions & 0 deletions aio_snowplow_tracker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from aio_snowplow_tracker._version import __version__
from aio_snowplow_tracker.subject import Subject
from aio_snowplow_tracker.emitters import logger, Emitter
from aio_snowplow_tracker.self_describing_json import SelfDescribingJson
from aio_snowplow_tracker.tracker import Tracker
from aio_snowplow_tracker.contracts import disable_contracts, enable_contracts

# celery extra
from .celery import CeleryEmitter

# redis extra
from .redis import RedisEmitter, RedisWorker
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
License: Apache License Version 2.0
"""

__version_info__ = (1, 0, '0a2')
__version_info__ = (1, 0, '0a3')
__version__ = ".".join(str(x) for x in __version_info__)
__build_version__ = __version__ + ''
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import logging
from typing import Any, Optional

from snowplow_tracker.emitters import Emitter
from snowplow_tracker.typing import HttpProtocol, Method
from aio_snowplow_tracker.emitters import Emitter
from aio_snowplow_tracker.typing import HttpProtocol, Method

_CELERY_OPT = True
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import traceback
import re
from typing import Any, Dict, Iterable, Callable, Sized
from snowplow_tracker.typing import FORM_TYPES, FORM_NODE_NAMES
from aio_snowplow_tracker.typing import FORM_TYPES, FORM_NODE_NAMES

_CONTRACTS_ENABLED = True
_MATCH_FIRST_PARAMETER_REGEX = re.compile(r"\(([\w.]+)[,)]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import aiohttp
from typing import Optional, Union, Tuple

from snowplow_tracker.self_describing_json import SelfDescribingJson
from snowplow_tracker.typing import PayloadDict, PayloadDictList, HttpProtocol, Method, SuccessCallback, FailureCallback
from snowplow_tracker.contracts import one_of
from snowplow_tracker._timer import Timer
from aio_snowplow_tracker.self_describing_json import SelfDescribingJson
from aio_snowplow_tracker.typing import PayloadDict, PayloadDictList, HttpProtocol, Method, SuccessCallback, FailureCallback
from aio_snowplow_tracker.contracts import one_of
from aio_snowplow_tracker._timer import Timer

# logging
logging.basicConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import json
import base64
from typing import Any, Optional
from snowplow_tracker.typing import PayloadDict, JsonEncoderFunction
from aio_snowplow_tracker.typing import PayloadDict, JsonEncoderFunction


class Payload:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import json
import logging
from typing import Any, Optional
from snowplow_tracker.typing import PayloadDict, RedisProtocol
from aio_snowplow_tracker.typing import PayloadDict, RedisProtocol

_REDIS_OPT = True
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import signal
from typing import Any, Optional

from snowplow_tracker.typing import EmitterProtocol, PayloadDict, RedisProtocol
from aio_snowplow_tracker.typing import EmitterProtocol, PayloadDict, RedisProtocol

_REDIS_OPT = True
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import json
from typing import Union

from snowplow_tracker.typing import PayloadDict, PayloadDictList
from aio_snowplow_tracker.typing import PayloadDict, PayloadDictList


class SelfDescribingJson(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
License: Apache License Version 2.0
"""

from snowplow_tracker.contracts import one_of, greater_than
from snowplow_tracker.typing import SupportedPlatform, SUPPORTED_PLATFORMS
from aio_snowplow_tracker.contracts import one_of, greater_than
from aio_snowplow_tracker.typing import SupportedPlatform, SUPPORTED_PLATFORMS

DEFAULT_PLATFORM = "pc"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
from freezegun import freeze_time
from typing import Dict, Optional

from snowplow_tracker import tracker, _version, emitters, subject
from snowplow_tracker.self_describing_json import SelfDescribingJson
from snowplow_tracker.redis import redis_emitter
from aio_snowplow_tracker import tracker, _version, emitters, subject
from aio_snowplow_tracker.self_describing_json import SelfDescribingJson
from aio_snowplow_tracker.redis import redis_emitter


@pytest.fixture
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import unittest

from snowplow_tracker.contracts import form_element, greater_than, non_empty, non_empty_string, one_of, satisfies
from aio_snowplow_tracker.contracts import form_element, greater_than, non_empty, non_empty_string, one_of, satisfies


class TestContracts(unittest.TestCase):
Expand Down

0 comments on commit eba8661

Please sign in to comment.