-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scarf telemetry in pandasai (#1260)
* Add scarf telemetry in pandasai * fix: ruff errors
- Loading branch information
1 parent
c872fec
commit 73dce24
Showing
5 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import importlib.metadata | ||
|
||
__version__ = importlib.metadata.version(__package__ or __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
import platform | ||
|
||
import requests | ||
|
||
from pandasai.__version__ import __version__ | ||
|
||
|
||
def scarf_analytics(): | ||
try: | ||
if ( | ||
os.getenv("SCARF_NO_ANALYTICS") != "true" | ||
and os.getenv("DO_NOT_TRACK") != "true" | ||
): | ||
requests.get( | ||
"https://package.pandabi.ai/pandasai-telemetry?version=" | ||
+ __version__ | ||
+ "&platform=" | ||
+ platform.system() | ||
) | ||
except Exception: | ||
pass |