-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Create a Exporter class to allow export data from LandingLens #174
Conversation
from_date: str | ||
In date following the format "YYYY-MM-DD" | ||
save_path: | ||
Desired path to save the csv file to: '/path/to/save/file.csv' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optionally have to_date, if not provided, default to current time.
def _download_file_from_signed_url(self, signed_url: str, save_path: str) -> None: | ||
response = requests.get(signed_url) | ||
with open(save_path, "wb") as file: | ||
file.write(response.content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just webbrowser.open(signed_url)
to directly download the resource through the browser.
api_key = "land_sk_12345" | ||
client = Exporter(project_id, api_key) | ||
res = client.export_event_logs("2021-06-01", "./local/path/to/save/file.csv") | ||
assert res is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can return the signed_url and check the return value
This PR is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Motivation
Exporter
class to provide the users with a set of methods to export data from LandingLensexport_event_logs()
that allows organization owners the ability to export the event logs of the organization from the given time range.Test
Added unit test