Skip to main content

Open sournce application analytics tracking library

Project description

Open-Analytics

An open-source analytical data capturing pacakge.

Open-Analytics lib enables you to capture and track analyitical data of your application at real-time into your own data-source. You can use your own or open-source tools to visualize the capture data.

Installation

Install the dependencies and devDependencies and start the server.

pip install open-analytics

Initalize

from openanalytics.client import Client
client = Client(connector=connector, sync_mode=False, debug=True)

Connecting to data-source

As of now the open-analytics library provide Connector Plugins for three types of databases.

MongoDBConnector

from openanalytics.connectors.MongoDBConnector import MongoDBConnector
connector = MongoDBConnector(host="mongodb://localhost:27017/", dbname="demobucket")

InfluxDBConnector

from openanalytics.connectors.InfluxDBConnector import InfluxDBConnector
connector = InfluxDBConnector(
    token="5wttcrwYX3COT8OQaorbOKUYAmPPNE-7oC_2itF60bBqIfC33L9g4k3APNjcCkCAuBuwWurOVEBo6gNYP0cAuA==",
    org="demoorg",
    url="http://localhost:8086",
    bucket="demobucket",
)

SQLiteConnector

from openanalytics.connectors.SQLiteConnector import SQLiteConnector
connector = SQLiteConnector(db="handshake.sqlite3")

Features

Identify

The Identify method lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.

from openanalytics.models.Identify import Identify
client.idetify(
    Identify(
        userID="UserName / UserEmail", 
        event="Custom Event", 
        metadata={"data": "query data", "location": "query location"},
        timestamp=datetime.now(timezone.utc),
    )
)

Token

Useful in Generative AI token processing. The Token method lets you record token utlization for you events, along with optional extra information about the token processing.

from openanalytics.models.Token import Token
client.token(
    Token(
        event="LLM Query Event",
        action="Similarity Search",
        count=134,
        metadata={
            "query": "llm prompt",
            "location": {"context": "context of the prompt", "rag": "enabled"},
        },
    )
)

Track

Track lets you record the actions your users perform. Every action triggers what Segment calls an “event”, which can also have associated properties.

from openanalytics.models.Track import Track
client.track(
    Track(
        endpoint="http:localhost:8080/search",
        event="Profile Search",
        properties={"params": "q=username"},
        timestamp=datetime.now(timezone.utc),
    )
)

Page

The Page method lets you record page views on your website, along with optional extra information about the page being viewed.

from openanalytics.models.Page import Page
client.page(
    Page(
        name="Dashboard", 
        category="AdminGroup", 
        properties={"status": True}
    )
)

Logger

The Log method lets you record log events of your actions, along with optional extra information about the log event.

from openanalytics.models.Logger import Logger
client.logger(
    Log(
        summary="Log Message",
        level="Debug",
        event="Process Login Function",
        metadata={"user": "username"},
    )
)

License

Apache License v2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_analytics-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_analytics-0.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file open_analytics-0.1.0.tar.gz.

File metadata

  • Download URL: open_analytics-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for open_analytics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a82137d41a0eb2f11891a609c66667a4cd4e18c0b75316de22317975b450f08
MD5 647871857ea91d6a6429ac12b0196ece
BLAKE2b-256 15123f17d103532eab28178de0fc93eb4f4a34e4e42a9365c2760c4f44572bbf

See more details on using hashes here.

File details

Details for the file open_analytics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: open_analytics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for open_analytics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35634272aadff4a77909bdc70db19e199f6c919d793f3330c8fdceb41746e73a
MD5 014b3888b641678c9655dfc69e572ee4
BLAKE2b-256 1d8f580a0c770cf8c4bdb7ca58d61dddf9fdd4dfffb591484c871ae33017c968

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page