GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Openpanel-dev/python-sdk

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
openpanel
openpanel
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
publish.sh
publish.sh
 
 
setup.py
setup.py
 
 

Repository files navigation

OpenPanel Python SDK

The OpenPanel Python SDK allows you to track user behavior in your Python applications. This guide provides instructions for installing and using the Python SDK in your project.

Installation

You can install the OpenPanel Python SDK using pip:

pip install openpanel

Usage

Initialization

First, import the SDK and initialize it with your client ID:

from openpanel import OpenPanel

op = OpenPanel(client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET")

Options

When initializing the SDK, you can provide several options:

  • client_id (required): Your OpenPanel client ID.
  • client_secret (optional): Your OpenPanel client secret.
  • api_url (optional): Custom API URL if you're not using the default OpenPanel API.
  • filter (optional): A function to filter events before sending.
  • disabled (optional): Set to True to disable event sending.

Tracking Events

To track an event:

op.track("button_clicked", {"button_id": "submit_form"})

Identifying Users

To identify a user:

op.identify("user123", {
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "customAttribute": "value"
})

Setting Global Properties

To set properties that will be sent with every event:

op.set_global_properties({
    "app_version": "1.0.2",
    "environment": "production"
})

Creating Aliases

To create an alias for a user:

op.alias("user123", "john_doe")

Incrementing Properties

To increment a numeric property on a user profile:

op.increment("user123", "login_count", 1)

Decrementing Properties

To decrement a numeric property on a user profile:

op.decrement("user123", "credits", 5)

Clearing User Data

To clear the current user's data:

op.clear()

Advanced Usage

Custom Event Filtering

You can set up custom event filtering:

def my_filter(payload):
    # Your custom filtering logic here
    return True  # or False to filter out the event

op = OpenPanel(client_id="YOUR_CLIENT_ID", filter=my_filter)

Disabling Tracking

You can temporarily disable tracking:

op = OpenPanel(client_id="YOUR_CLIENT_ID", disabled=True)

Thread Safety

The OpenPanel SDK is designed to be thread-safe. You can call its methods from any thread without additional synchronization.

Support

For any issues or feature requests, please file an issue on our GitHub repository.

About

No description, website, or topics provided.

Resources

Readme
AGPL-3.0 license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.