File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
# PostHog Python library example
2
-
3
- # Import the library
4
- # import time
2
+ import argparse
5
3
6
4
import posthog
7
5
6
+ # Add argument parsing
7
+ parser = argparse .ArgumentParser (description = "PostHog Python library example" )
8
+ parser .add_argument (
9
+ "--flag" , default = "person-on-events-enabled" , help = "Feature flag key to check (default: person-on-events-enabled)"
10
+ )
11
+ args = parser .parse_args ()
12
+
8
13
posthog .debug = True
9
14
10
15
# You can find this key on the /setup page in PostHog
18
23
19
24
print (
20
25
posthog .feature_enabled (
21
- "person-on-events-enabled" ,
26
+ args . flag , # Use the flag from command line arguments
22
27
"12345" ,
23
28
groups = {"organization" : str ("0182ee91-8ef7-0000-4cb9-fedc5f00926a" )},
24
29
group_properties = {
You can’t perform that action at this time.
0 commit comments