Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# PostHog Python library example

# Import the library
# import time
import argparse

import posthog

# Add argument parsing
parser = argparse.ArgumentParser(description="PostHog Python library example")
parser.add_argument(
"--flag", default="person-on-events-enabled", help="Feature flag key to check (default: person-on-events-enabled)"
)
args = parser.parse_args()

posthog.debug = True

# You can find this key on the /setup page in PostHog
Expand All @@ -18,7 +23,7 @@

print(
posthog.feature_enabled(
"person-on-events-enabled",
args.flag, # Use the flag from command line arguments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, this only changes the first test flag in this case, the subsequent flags will still use the hard coded values. Seems fine if you're only really using the example script for the first case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll cross those bridges if the need arises. 😂

"12345",
groups={"organization": str("0182ee91-8ef7-0000-4cb9-fedc5f00926a")},
group_properties={
Expand Down
Loading