Skip to main content

Revolt analytics sdk for Python 3.6+

Install

Revolt is registered in pypi so just use pip.

pip install revolt-sdk

Usage

To create Revolt client you have to provide:

  • tracking_id - Your unique client tracking ID

  • secret_key - Client authorization secret for your tracking ID

  • app_code - Your application name/identifier i.e. ‘com.company.myapp’

  • app_version - Your application version i.e. ‘1.12.4’

If you don’t have tracking_id or secret_key, please contact Revolt Team for assistance.

import revoltsdk

client = revoltsdk.Revolt(
    tracking_id='your_tracking_id',
    secret_key='your_secret_key',
    app_code='com.company.myapp',
    app_version='2.1.11',
)

You may also pass any of additional options:

  • app_instance_id - Unique application instance ID. It will be randomly generated each time if None provided. It should be reused for same device/application instance.

  • timezone - Timezone used to send events. Default is current timezone provided by system.

  • revolt_host - Host name of Revolt server

  • batch_size - Maximum size of event batches sent to server. Events will be sent automatically when queue reaches batch*size. Default is 20.

  • auto_flush_delay - Delay in miliseconds before automatically sending events batch if batch_size was not reached. Calling send_event will reset the timer. Auto flush will be disabled if you pass None instead. If auto flush is disabled events will be flushed only if queue reaches batch_size or manually. Default is 5 seconds (5000).

Revolt client has one public method called send*event used to send analytics events. Events will be queued and sent when flush occours. It might happen if queue size reaches batch_size, if you use auto flush and there was no new event for at least auto_flush_delay time or when explicitly call send_event with flush parameter set to True.

client.send_event('some.empty')  # sends event without additional data

client.send_event(type='some.info', data={'info': 'works in python'})  # sends event with given data

client.send_event(type='some.flushed', flush=True)  # sends event immediately flushing all pending events

Event type name has to have no more than 32 characters. It should use dots for separating domain, object, event (example: ui.activity.started), last element of name should be a verb expressing what happened e.g. signedIn, started, deleted etc. Type of event determines format of event data.

Data associated with event might be any json serializable object (including arrays and nested objects) or None.

Debug

If you wish to debug or examine what and when data is sent to Revolt you can enable debug logs. SDK uses default python logging system. It is required to run application in debug mode (without python optimization) to have access to logs. Logs are omitted in optimized run.

License

Copyright 2019 Miquido

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.

Metadata

Release files for revolt-sdk 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for revolt-sdk 1.0.1
File Size Uploaded
revolt-sdk-1.0.1.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for revolt-sdk 1.0.1
File Interpreter ABI Platform
revolt_sdk-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / revolt-sdk-1.0.1.tar.gz

Download URL revolt-sdk-1.0.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8eac441db08416cc8ea0718ac711459c08a5ce4a2b36c881f0f4618e3750edac
BLAKE2b-256 checksum
How to use checksums
aefec830de16509f8b59e25c14bc161fe134325f025d3550b467ffd54a117145
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / revolt_sdk-1.0.1-py3-none-any.whl

Download URL revolt_sdk-1.0.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68d8a95e774fa17abcb7b34b0d4ff20a6b5f372108388ee3c0e46d3dc0be4e4a
BLAKE2b-256 checksum
How to use checksums
4478da0d3ab23e5b1a5b2d338dcb3458fd09e62790b5ecb4e725fe2955b7c577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page