repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
posthog | posthog/admin/admins/project_admin.py | .py | from typing import cast
from django.conf import settings
from django.contrib import admin, messages
from django.shortcuts import redirect
from django.template.loader import render_to_string
from django.urls import path, reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
fr... | 199 | 8,065 |
posthog | posthog/admin/admins/oauth_admin.py | .py | from __future__ import annotations
import base64
import hashlib
from urllib.parse import urlencode
from django import forms
from django.contrib import admin, messages
from django.contrib.admin import helpers
from django.template.response import TemplateResponse
from django.utils.html import format_html
from oauth2_p... | 379 | 17,284 |
posthog | posthog/admin/admins/health_check_admin.py | .py | import asyncio
import dataclasses
from uuid import uuid4
from django import forms
from django.conf import settings
from django.contrib import admin, messages
from django.core.exceptions import PermissionDenied
from django.shortcuts import redirect, render
import structlog
from posthog.temporal.common.client import s... | 195 | 7,367 |
posthog | posthog/admin/admins/resave_cohorts_admin.py | .py | from django import forms
from django.contrib import admin, messages
from django.core.exceptions import PermissionDenied
from django.core.management import call_command
from django.shortcuts import redirect, render
class ResaveCohortsForm(forms.Form):
team_id = forms.IntegerField(required=False, help_text="Only pr... | 57 | 2,308 |
posthog | posthog/admin/admins/__init__.py | .py | """Central PostHog model admin classes.
Importing this package triggers every ``@admin.register(Model)`` decorator in
``posthog/admin/admins/*.py``. ``register_all_admin()`` does ``import
posthog.admin.admins`` for that side effect; nothing else relies on the
package re-exporting names. Consumers that want a specific ... | 23 | 983 |
posthog | posthog/admin/admins/user_admin.py | .py | import datetime
from typing import Any
from django.contrib import admin, messages
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
from django.contrib.auth.forms import (
ReadOnlyPasswordHashWidget as DjangoReadOnlyPasswordHashWidget,
UserChangeForm as DjangoUserChangeForm,
)
from django.core... | 297 | 13,109 |
posthog | posthog/admin/admins/organization_admin.py | .py | from datetime import UTC, timedelta
from django import forms
from django.apps import apps
from django.conf import settings
from django.contrib import admin, messages
from django.core.management import call_command
from django.core.management.base import CommandError
from django.shortcuts import redirect, render
from d... | 618 | 27,038 |
posthog | posthog/admin/admins/data_deletion_request_admin.py | .py | import ast
from django import forms
from django.conf import settings
from django.contrib import admin, messages
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
from django.template.response import TemplateResponse
from django.urls import path, reverse
from django.utils import timezone
from djan... | 886 | 41,079 |
posthog | posthog/admin/admins/code_based_verification_bypass_admin.py | .py | from typing import cast
from django.contrib import admin
from django.shortcuts import render
from rest_framework import serializers, status, viewsets
from rest_framework.permissions import IsAdminUser
from rest_framework.request import Request
from rest_framework.response import Response
from posthog.helpers.two_fac... | 105 | 4,217 |
posthog | posthog/admin/admins/event_ingestion_restriction_config.py | .py | from django import forms
from django.contrib import admin
from django.db.models import OuterRef, Subquery
from posthog.models.event_ingestion_restriction_config import (
INGESTION_PIPELINES,
EventIngestionRestrictionConfig,
RestrictionType,
)
class EventIngestionRestrictionConfigForm(forms.ModelForm):
... | 166 | 6,617 |
posthog | posthog/admin/admins/async_deletion_admin.py | .py | from django.contrib import admin
from posthog.models import AsyncDeletion
@admin.register(AsyncDeletion)
class AsyncDeletionAdmin(admin.ModelAdmin):
list_display = (
"id",
"deletion_type",
"group_type_index",
"team_id",
"key",
"created_by",
"created_at",
... | 26 | 594 |
posthog | posthog/admin/admins/instance_setting_admin.py | .py | import json
from django.contrib import admin
from posthog.models import InstanceSetting
@admin.register(InstanceSetting)
class InstanceSettingAdmin(admin.ModelAdmin):
list_display = (
"id",
"key",
"value",
)
def save_model(self, request, obj, form, change):
# Ensure raw_... | 25 | 720 |
posthog | posthog/admin/admins/integration_admin.py | .py | from django.contrib import admin
from django.utils.html import format_html
from posthog.models.integration import Integration
from posthog.models.organization_integration import OrganizationIntegration
from posthog.models.user_integration import UserIntegration
@admin.register(Integration)
class IntegrationAdmin(adm... | 87 | 2,872 |
posthog | posthog/admin/admins/data_color_theme_admin.py | .py | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from posthog.models import DataColorTheme
@admin.register(DataColorTheme)
class DataColorThemeAdmin(admin.ModelAdmin):
list_display = (
"id",
"name",
"team_link",
)
readonly_... | 27 | 747 |
posthog | posthog/admin/admins/notebook_markdown_migration_admin.py | .py | import json
from dataclasses import asdict
from typing import TYPE_CHECKING, Any, cast
from django import forms
from django.contrib import admin
from django.http import HttpRequest, HttpResponse, JsonResponse
from django.shortcuts import render
from django.views.decorators.http import require_GET, require_POST
from p... | 130 | 4,555 |
posthog | posthog/admin/admins/radar_bypass_admin.py | .py | from django.contrib import admin
from django.shortcuts import render
from rest_framework import serializers, status, viewsets
from rest_framework.permissions import IsAdminUser
from rest_framework.request import Request
from rest_framework.response import Response
from posthog.redis import get_client
from posthog.wor... | 56 | 2,108 |
posthog | posthog/admin/admins/team_admin.py | .py | import io
import csv
import json
import uuid
import asyncio
import hashlib
import dataclasses
from datetime import UTC, datetime, timedelta
from decimal import Decimal, InvalidOperation
from typing import Any
from urllib import parse
from django.conf import settings
from django.contrib import admin, messages
from djan... | 1,760 | 76,152 |
posthog | posthog/admin/admins/organization_domain_admin.py | .py | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from posthog.models import OrganizationDomain
@admin.register(OrganizationDomain)
class OrganizationDomainAdmin(admin.ModelAdmin):
list_display = (
"domain",
"organization_link",
"ve... | 59 | 2,169 |
posthog | posthog/admin/admins/global_rate_limit_threshold_config.py | .py | from django.contrib import admin
from django.db.models import OuterRef, Subquery
from posthog.models.global_rate_limit_threshold_config import GlobalRateLimitThresholdConfig
@admin.register(GlobalRateLimitThresholdConfig)
class GlobalRateLimitThresholdConfigAdmin(admin.ModelAdmin):
list_display = (
"id",... | 48 | 1,389 |
posthog | posthog/admin/admins/personal_api_key_admin.py | .py | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import SafeString
from posthog.admin.admins.api_key_roll_mixin import RollApiKeyAdminMixin
from posthog.api.personal_api_key import PersonalAPIKeySerializer
from posthog.models import... | 55 | 1,775 |
posthog | posthog/admin/admins/user_product_list_admin.py | .py | from django.contrib import admin
from posthog.models.file_system.user_product_list import UserProductList
@admin.register(UserProductList)
class UserProductListAdmin(admin.ModelAdmin):
list_display = ("id", "user", "team", "product_path", "reason", "enabled", "updated_at")
list_display_links = ("id",)
li... | 58 | 1,368 |
posthog | posthog/admin/admins/identity_provider_config_admin.py | .py | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from posthog.models import IdentityProviderConfig
@admin.register(IdentityProviderConfig)
class IdentityProviderConfigAdmin(admin.ModelAdmin):
list_display = (
"name",
"organization_link",
... | 47 | 1,942 |
posthog | posthog/admin/admins/conversation_admin.py | .py | from django.contrib import admin, messages
from django.core.exceptions import PermissionDenied
from django.db.models import Count, Sum
from django.db.models.functions import Length
from django.http import HttpResponseNotAllowed
from django.shortcuts import redirect
from django.template.defaultfilters import filesizefor... | 129 | 5,906 |
posthog | posthog/admin/admins/api_key_roll_mixin.py | .py | from typing import Any
from django.contrib import admin
from django.http import HttpRequest, HttpResponse, HttpResponseNotAllowed
from django.shortcuts import redirect
from django.urls import URLPattern, path, reverse
from django.utils.html import format_html
from django.utils.safestring import SafeString
class Roll... | 67 | 2,701 |
posthog | posthog/admin/admins/tophog_admin.py | .py | import logging
from collections import OrderedDict, defaultdict
from datetime import UTC, datetime, timedelta
from urllib.parse import urlencode
from django.contrib import admin, messages
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
from django.shortcuts import rende... | 300 | 11,914 |
posthog | posthog/admin/admins/column_configuration_admin.py | .py | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from posthog.models import ColumnConfiguration
@admin.register(ColumnConfiguration)
class ColumnConfigurationAdmin(admin.ModelAdmin):
list_display = (
"id",
"context_key",
"team_link... | 31 | 950 |
posthog | posthog/plugins/plugin_server_api.py | .py | import json
from datetime import UTC, datetime, timedelta
from typing import Optional, Union
from django.conf import settings
import jwt
import requests
import structlog
from posthog.models.utils import UUIDT
from posthog.redis import get_client
from posthog.security.outbound_proxy import internal_requests
from post... | 254 | 10,042 |
posthog | posthog/plugins/utils.py | .py | import io
import os
import re
import json
import tarfile
from tarfile import ReadError
from typing import Any, Optional
from urllib.parse import parse_qs, quote
from zipfile import ZIP_DEFLATED, BadZipFile, Path, ZipFile
from django.conf import settings
import requests
from posthog.dataclasses import frozen
def pa... | 371 | 14,557 |
posthog | posthog/plugins/site.py | .py | from dataclasses import asdict, dataclass
from hashlib import md5
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from posthog.models import Team
@dataclass
class WebJsSource:
id: int
source: str
token: str
config_schema: list[dict]
config: dict
@dataclass
class WebJsUrl:
i... | 149 | 4,362 |
posthog | posthog/plugins/access.py | .py | from typing import Optional, Union
from uuid import UUID
from posthog.models.organization import Organization
def has_plugin_access_level(
organization_or_id: Optional[Union[Organization, str, UUID]], min_access_level: int
) -> bool:
if organization_or_id is None:
return False
organization: Organ... | 30 | 1,132 |
posthog | posthog/plugins/test/mock.py | .py | import json
import base64
from typing import cast
# This method will be used by the mock to replace requests.get
from posthog.plugins.utils import get_file_from_zip_archive, put_json_into_zip_archive
from .plugin_archives import (
HELLO_WORLD_PLUGIN_GITHUB_ATTACHMENT_ZIP,
HELLO_WORLD_PLUGIN_GITHUB_SUBDIR_ZIP,... | 207 | 8,293 |
posthog | posthog/plugins/test/test_utils.py | .py | import io
import base64
from typing import cast
from zipfile import ZipFile
from posthog.test.base import BaseTest
from unittest import mock
from posthog.plugins.utils import (
download_plugin_archive,
get_file_from_archive,
get_file_from_zip_archive,
parse_url,
put_json_into_zip_archive,
)
from ... | 679 | 33,863 |
posthog | posthog/plugins/test/plugin_archives.py | .py | # https://github.com/PostHog/helloworldplugin in a base64-encoded zip file
HELLO_WORLD_PLUGIN_GITHUB_ZIP = (
"d5aa1d2b8a534f37cd93be48b214f490ef9ee904",
"UEsDBAoAAAAAAA8LbVEAAAAAAAAAAAAAAAAjAAkAaGVsbG93b3JsZHBsdWdpbi1pbWFnZWxlc3MtdmVyc2lvbi9VVAUAAc9Qrl9QSwMECgAAAAgADwttUQT7a+JUAAAAdQAAAC4ACQBoZWxsb3dvcmxkcGx1Z2... | 80 | 45,661 |
posthog | posthog/cdp/internal_events.py | .py | import uuid
from dataclasses import dataclass
from datetime import UTC, datetime
from typing import Optional
import structlog
from rest_framework_dataclasses.serializers import DataclassSerializer
from posthog.kafka_client.client import ProduceResult
from posthog.kafka_client.routing import get_producer
from posthog.... | 84 | 2,480 |
posthog | posthog/cdp/migrations.py | .py | import json
from typing import Any
from django.db import transaction
from django.db.models import Q
from posthog.models.team.team import Team
from products.cdp.backend.api.hog_function import HogFunctionSerializer
from products.cdp.backend.models.hog_function_template import HogFunctionTemplate
from products.cdp.bac... | 191 | 7,530 |
posthog | posthog/cdp/legacy_plugins.py | .py | from products.cdp.backend.api.hog_function import HogFunctionSerializer
from products.cdp.backend.models.hog_function_template import HogFunctionTemplate
def hog_function_from_plugin_config(plugin_config: dict, serializer_context: dict) -> HogFunctionSerializer:
plugin = plugin_config["plugin"]
# Attempts to ... | 48 | 1,676 |
posthog | posthog/cdp/filters.py | .py | from typing import Any, Optional
from django.conf import settings
from posthog.hogql.compiler.bytecode import create_bytecode
from posthog.hogql.context import HogQLContext
from posthog.hogql.parser import parse_expr
from posthog.hogql.property import action_to_expr, ast, property_to_expr
from posthog.hogql.visitor i... | 474 | 20,093 |
posthog | posthog/cdp/site_functions.py | .py | import json
from posthog.hogql.compiler.javascript import JavaScriptCompiler
from posthog.cdp.filters import hog_function_filters_to_expr
from posthog.cdp.validation import transpile_template_code
from products.cdp.backend.models.hog_functions.hog_function import HogFunction
from products.cdp.backend.models.plugin i... | 150 | 6,502 |
posthog | posthog/cdp/validation.py | .py | import re
import json
import logging
from typing import Any, Optional
from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from posthog.hogql import ast
from posthog.hogql.compiler.bytecode import create_bytecode
from postho... | 826 | 35,388 |
posthog | posthog/cdp/services/icons.py | .py | import re
from base64 import b64encode
from typing import NoReturn, cast
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse
import requests
import structlog
from rest_framework import status
from rest_framework.exceptions import APIException, NotFound
from posth... | 240 | 11,136 |
posthog | posthog/cdp/test/test_icons.py | .py | import json
import time
from itertools import count
from unittest.mock import patch
from django.core.cache import cache
from django.test import SimpleTestCase, override_settings
import requests
from parameterized import parameterized
from requests.structures import CaseInsensitiveDict
from rest_framework import stat... | 373 | 18,147 |
posthog | posthog/cdp/test/test_validation.py | .py | import json
import pytest
from posthog.test.base import APIBaseTest, ClickhouseTestMixin, QueryMatchingTest
from parameterized import parameterized
from rest_framework.exceptions import ValidationError
from posthog.hogql import ast
from posthog.cdp.validation import (
HogFunctionFiltersSerializer,
InputsSch... | 900 | 38,033 |
posthog | posthog/cdp/test/test_filters.py | .py | import re
import json
from posthog.test.base import APIBaseTest, ClickhouseTestMixin, QueryMatchingTest
from parameterized import parameterized
from posthog.hogql.compiler.bytecode import create_bytecode
from posthog.cdp.filters import (
build_behavioral_event_expr,
cohort_filters_to_expr,
compile_filte... | 853 | 31,979 |
posthog | posthog/cdp/test/test_site_functions.py | .py | import json
import tempfile
import subprocess
from typing import Any
import pytest
from unittest.mock import patch
from django.test import TestCase
from parameterized import parameterized
from posthog.cdp.site_functions import get_transpiled_function
from posthog.cdp.templates.helpers import mock_transpile
from pos... | 491 | 21,493 |
posthog | posthog/cdp/templates/__init__.py | .py | from ._internal.template_blank import blank_site_app, blank_site_destination
from ._siteapps.template_debug_posthog import template as debug_posthog
from ._siteapps.template_early_access_features import template as early_access_features
from ._siteapps.template_hogdesk import template as hogdesk
from ._siteapps.templat... | 159 | 5,272 |
posthog | posthog/cdp/templates/helpers.py | .py | import json
import functools
from collections.abc import Callable
from typing import Any, Optional, cast
from posthog.test.base import APIBaseTest, BaseTest
from unittest.mock import MagicMock, patch
from posthog.cdp.site_functions import get_transpiled_function
from posthog.cdp.templates.hog_function_template import... | 269 | 10,596 |
posthog | posthog/cdp/templates/hog_function_template.py | .py | import dataclasses
from typing import TYPE_CHECKING, Literal, Optional
from products.cdp.backend.api.hog_function_template import HogFunctionTemplateSerializer
from products.cdp.backend.models.hog_function_template import HogFunctionTemplate
if TYPE_CHECKING:
from products.cdp.backend.models.plugin import PluginC... | 93 | 2,661 |
posthog | posthog/cdp/templates/test_cdp_templates.py | .py | import dataclasses
from posthog.test.base import BaseTest
from posthog.cdp.templates import HOG_FUNCTION_TEMPLATES
from posthog.cdp.templates.hog_function_template import sync_template_to_db
from posthog.cdp.validation import InputsSchemaItemSerializer, compile_hog
from products.cdp.backend.models.hog_function_templ... | 56 | 2,508 |
posthog | posthog/cdp/templates/klaviyo/test_template_klaviyo.py | .py | import pytest
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.klaviyo.template_klaviyo import (
template_event as klaviyo_event,
template_user as klaviyo_user,
)
from common.hogvm.python.utils import UncaughtHogVMException
class TestTemplateKlaviyoUser(BaseHo... | 198 | 7,391 |
posthog | posthog/cdp/templates/klaviyo/template_klaviyo.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template_user: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=False,
type="destination",
id="template-klaviyo-user",
name="Klaviyo",
description="Updates a contact in Klaviyo",
icon_url="/sta... | 262 | 9,089 |
posthog | posthog/cdp/templates/airtable/template_airtable.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-airtable",
name="Airtable",
description="Creates Airtable records",
icon_url="/static/services/a... | 85 | 2,376 |
posthog | posthog/cdp/templates/airtable/test_template_airtable.py | .py | from posthog.cdp.templates.airtable.template_airtable import template as template_airtable
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
class TestTemplateAirtable(BaseHogFunctionTemplateTest):
template = template_airtable
def test_function_works(self):
self.run_function(
... | 62 | 2,321 |
posthog | posthog/cdp/templates/engage/template_engage.py | .py | import dataclasses
from copy import deepcopy
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-engage-so",
name="Engage.so",... | 86 | 2,899 |
posthog | posthog/cdp/templates/engage/test_template_engage.py | .py | from posthog.cdp.templates.engage.template_engage import template as template_engage
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
class TestTemplateEngageso(BaseHogFunctionTemplateTest):
template = template_engage
def _inputs(self, **kwargs):
inputs = {"public_key": "PUBLIC_K... | 33 | 1,007 |
posthog | posthog/cdp/templates/knock/test_knock_template.py | .py | from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.knock.template_knock import template as template_knock
def create_inputs(**kwargs):
inputs = {
"webhookUrl": "https://api.knock.app/integrations/receive/tkN_P18rTjBq30waf1RLp",
"include_all_properties"... | 109 | 4,419 |
posthog | posthog/cdp/templates/knock/template_knock.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-knock",
name="Knock",
description="Send events to Knock",
icon_url="/static/services/knock.png",... | 98 | 3,054 |
posthog | posthog/cdp/templates/_siteapps/template_pineapple_mode.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=True,
type="site_app",
id="template-pineapple-mode",
name="Pineapple Mode",
description="Make any website better by adding raining pineapple... | 171 | 5,667 |
posthog | posthog/cdp/templates/_siteapps/template_debug_posthog.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=True,
type="site_app",
id="template-debug-posthog-js",
name="PostHog JS debugger",
description="Enable extra debugging tools on your posthog... | 48 | 1,506 |
posthog | posthog/cdp/templates/_siteapps/template_notification_bar.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=True,
type="site_app",
id="template-notification-bar",
name="Notification Bar",
description="Show a notification bar for your users",
ic... | 163 | 5,580 |
posthog | posthog/cdp/templates/_siteapps/template_hogdesk.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=True,
type="site_app",
id="template-hogdesk",
name="HogDesk",
description="HogDesk bug reporter",
icon_url="https://raw.githubuserconten... | 389 | 13,319 |
posthog | posthog/cdp/templates/_siteapps/template_early_access_features.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=True,
type="site_app",
id="template-early-access-features",
name="Early Access Features App",
description="This app is used with Early Acces... | 449 | 13,337 |
posthog | posthog/cdp/templates/gleap/template_gleap.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-gleap",
name="Gleap",
description="Updates a contact in Gleap",
icon_url="/static/services/gleap... | 96 | 2,954 |
posthog | posthog/cdp/templates/gleap/test_template_gleap.py | .py | from posthog.cdp.templates.gleap.template_gleap import template as template_gleap
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
def create_inputs(**kwargs):
inputs = {
"apiKey": "uB6Jymn60NN5EEIWgiUzZx13geVlEx26",
"include_all_properties": False,
"userId": "edad9282... | 78 | 2,540 |
posthog | posthog/cdp/templates/intercom/test_template_intercom.py | .py | import pytest
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.intercom.template_intercom import (
template as template_intercom,
template_send_event as template_intercom_event,
)
from common.hogvm.python.utils import UncaughtHogVMException
class TestTemplateI... | 391 | 13,855 |
posthog | posthog/cdp/templates/intercom/template_intercom.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=False,
type="destination",
id="template-intercom",
name="Intercom",
description="Update contacts in Intercom",
icon_url="/static/servi... | 315 | 9,549 |
posthog | posthog/cdp/templates/customerio/template_customerio.py | .py | import dataclasses
from copy import deepcopy
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
# Based off of https://customer.io/docs/api/track/#operation/entity
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=False,
... | 281 | 9,541 |
posthog | posthog/cdp/templates/customerio/test_template_customerio.py | .py | import pytest
from posthog.test.base import BaseTest
from posthog.cdp.templates.customerio.template_customerio import (
TemplateCustomerioMigrator,
template as template_customerio,
)
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from products.cdp.backend.models.plugin import PluginConf... | 241 | 9,706 |
posthog | posthog/cdp/templates/mailjet/template_mailjet.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
# See https://dev.mailjet.com/email/reference/contacts/contact-list/
input_api_key = {
"key": "api_key",
"type": "string",
"label": "Mailjet API Key",
"secret": True,
"required": True,
}
input_secret_key = {
"key": "... | 163 | 4,383 |
posthog | posthog/cdp/templates/mailjet/test_template_mailjet.py | .py | from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.mailjet.template_mailjet import template_create_contact, template_update_contact_list
def create_inputs(**kwargs):
inputs = {"api_key": "API_KEY", "secret_key": "SECRET_KEY", "email": "example@posthog.com"}
inputs... | 51 | 1,982 |
posthog | posthog/cdp/templates/tiktok_ads/template_tiktok_pixel.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionMappingTemplate, HogFunctionTemplateDC
def build_inputs(multiProductEvent=False):
return [
{
"key": "eventProperties",
"type": "dictionary",
"description": "Map of TikTok event attributes and their value... | 320 | 15,389 |
posthog | posthog/cdp/templates/snapchat_ads/template_pixel.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionMappingTemplate, HogFunctionTemplateDC
def build_inputs(multiProductEvent=False):
return [
{
"key": "eventProperties",
"type": "dictionary",
"description": "Map of Snapchat event attributes and their val... | 289 | 12,327 |
posthog | posthog/cdp/templates/zapier/template_zapier.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=True,
type="destination",
id="template-zapier",
name="Zapier",
description="Trigger Zaps in Zapier based on PostHog events. NOTE: Typicall... | 83 | 2,686 |
posthog | posthog/cdp/templates/zapier/test_template_zapier.py | .py | from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.zapier.template_zapier import template as template_zapier
class TestTemplateZapier(BaseHogFunctionTemplateTest):
template = template_zapier
def test_function_works_with_path_only(self):
# Test with just t... | 60 | 2,005 |
posthog | posthog/cdp/templates/braze/template_braze.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-braze",
name="Braze",
description="Send events to Braze",
icon_url="/static/services/braze.png",... | 90 | 3,185 |
posthog | posthog/cdp/templates/braze/test_template_braze.py | .py | from freezegun import freeze_time
from posthog.cdp.templates.braze.template_braze import template as template_braze
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
class TestTemplateBraze(BaseHogFunctionTemplateTest):
template = template_braze
@freeze_time("2024-04-16T12:34:51Z")
d... | 48 | 1,709 |
posthog | posthog/cdp/templates/avo/template_avo.py | .py | import dataclasses
from copy import deepcopy
from posthog.hogql.escape_sql import escape_hogql_string
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destin... | 185 | 5,984 |
posthog | posthog/cdp/templates/avo/test_template_avo.py | .py | from posthog.test.base import BaseTest
from posthog.cdp.templates.avo.template_avo import (
TemplateAvoMigrator,
template as template_avo,
)
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from products.cdp.backend.models.plugin import PluginConfig
class TestTemplateAvo(BaseHogFunction... | 232 | 9,008 |
posthog | posthog/cdp/templates/discord/test_template_discord.py | .py | import pytest
from parameterized import parameterized
from posthog.cdp.templates.discord.template_discord import template as template_discord
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
class TestTemplateDiscord(BaseHogFunctionTemplateTest):
template = template_discord
def _inputs... | 65 | 2,363 |
posthog | posthog/cdp/templates/discord/template_discord.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
COMMON_INPUTS_SCHEMA = [
{
"key": "webhookUrl",
"type": "string",
"label": "Webhook URL",
"description": "See this page on how to generate a Webhook URL: https://support.discord.com/hc/en-us/articles/22838... | 96 | 3,305 |
posthog | posthog/cdp/templates/kudosity/test_template_kudosity.py | .py | from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.kudosity.template_kudosity import template as template_kudosity
class TestTemplateKudosity(BaseHogFunctionTemplateTest):
template = template_kudosity
def _inputs(self, **kwargs):
inputs = {
"a... | 118 | 4,094 |
posthog | posthog/cdp/templates/kudosity/template_kudosity.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-kudosity-sms",
name="Kudosity SMS",
description="Send SMS alerts via Kudosity when PostHog events or... | 134 | 4,937 |
posthog | posthog/cdp/templates/google_pubsub/test_template_google_pubsub.py | .py | from datetime import datetime
from posthog.test.base import BaseTest
from unittest.mock import patch
from posthog.cdp.templates.google_pubsub.template_google_pubsub import TemplateGooglePubSubMigrator
from posthog.models import Integration
from products.cdp.backend.models.plugin import Plugin, PluginAttachment, Plug... | 120 | 4,653 |
posthog | posthog/cdp/templates/google_pubsub/template_google_pubsub.py | .py | import json
import dataclasses
from copy import deepcopy
from posthog.hogql.escape_sql import escape_hogql_string
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
from posthog.models.integration import GoogleCloudIntegration
template: HogFunctionTemplateDC = ... | 134 | 4,320 |
posthog | posthog/cdp/templates/reddit/template_reddit_pixel.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionMappingTemplate, HogFunctionTemplateDC
common_inputs = [
{
"key": "eventProperties",
"type": "dictionary",
"description": "Map of Reddit event attributes and their values. Check out these pages for more details: https://busi... | 243 | 10,358 |
posthog | posthog/cdp/templates/reddit/test_template_reddit_pixel.py | .py | from posthog.cdp.templates.helpers import BaseSiteDestinationFunctionTest
from posthog.cdp.templates.reddit.template_reddit_pixel import template_reddit_pixel
TEST_EMAIL = "test@example.com"
TEST_PRODUCT_ID = "product12345"
TEST_PIXEL_ID = "pixel12345"
class TestTemplateRedditAds(BaseSiteDestinationFunctionTest):
... | 233 | 8,988 |
posthog | posthog/cdp/templates/clearbit/template_clearbit.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
# See https://dashboard.clearbit.com/docs#enrichment-api-combined-api
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="beta",
free=False,
type="destination",
id="template-clearbit",
name="Clearbit",
d... | 67 | 2,060 |
posthog | posthog/cdp/templates/clearbit/test_template_clearbit.py | .py | from posthog.cdp.templates.clearbit.template_clearbit import template as template_clearbit
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
EXAMPLE_RESPONSE = {
"person": {
"id": "1234",
"name": {"fullName": "Max the Hedgehog", "givenName": "Max", "familyName": "the Hedgehog"},... | 92 | 3,526 |
posthog | posthog/cdp/templates/sendgrid/template_sendgrid.py | .py | import dataclasses
from copy import deepcopy
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
# Based off of https://www.twilio.com/docs/sendgrid/api-reference/contacts/add-or-update-a-contact
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
statu... | 168 | 5,495 |
posthog | posthog/cdp/templates/sendgrid/test_template_sendgrid.py | .py | from posthog.test.base import BaseTest
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.sendgrid.template_sendgrid import (
TemplateSendGridMigrator,
template as template_sendgrid,
)
from products.cdp.backend.models.plugin import PluginConfig
class TestTemplat... | 181 | 6,357 |
posthog | posthog/cdp/templates/june/test_june_template.py | .py | from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.june.template_june import template as template_june
def create_inputs(**kwargs):
inputs = {
"apiKey": "abcdef123456",
"include_all_properties": False,
"properties": {"name": "Max AI", "email": ... | 331 | 12,344 |
posthog | posthog/cdp/templates/june/template_june.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=False,
type="destination",
id="template-june",
name="June.so",
description="Send events to June.so ",
icon_url="/static/services/june.... | 149 | 5,927 |
posthog | posthog/cdp/templates/hubspot/test_template_hubspot.py | .py | import pytest
from posthog.test.base import BaseTest
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.hubspot.template_hubspot import (
TemplateHubspotMigrator,
template as template_hubspot,
template_event as template_hubspot_event,
)
from products.cdp.backe... | 444 | 17,175 |
posthog | posthog/cdp/templates/hubspot/template_hubspot.py | .py | import dataclasses
from copy import deepcopy
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=False,
type="destination",
id="template-hubspot",
name="Hubspot",
... | 435 | 14,784 |
posthog | posthog/cdp/templates/make/template_make.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=False,
type="destination",
id="template-make",
name="Make",
description="Triggers a webhook based scenario",
icon_url="/static/service... | 60 | 1,892 |
posthog | posthog/cdp/templates/make/test_template_make.py | .py | import pytest
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.make.template_make import template as template_make
class TestTemplateMake(BaseHogFunctionTemplateTest):
template = template_make
def _inputs(self, **kwargs):
inputs = {
"webhoo... | 64 | 2,557 |
posthog | posthog/cdp/templates/slack/template_slack.py | .py | from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC
template: HogFunctionTemplateDC = HogFunctionTemplateDC(
status="stable",
free=True,
type="destination",
id="template-slack",
name="Slack",
description="Sends a message to a Slack channel",
icon_url="/static/servi... | 118 | 4,002 |
posthog | posthog/cdp/templates/slack/test_template_slack.py | .py | import pytest
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.slack.template_slack import template as template_slack
from common.hogvm.python.utils import UncaughtHogVMException
class TestTemplateSlack(BaseHogFunctionTemplateTest):
template = template_slack
... | 63 | 2,221 |
posthog | posthog/cdp/templates/salesforce/test_template_salesforce.py | .py | import pytest
from posthog.test.base import BaseTest
from parameterized import parameterized
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
from posthog.cdp.templates.salesforce.template_salesforce import (
TemplatSalesforceMigrator,
template_create as template_salesforce_create,
te... | 294 | 11,987 |
posthog | posthog/cdp/templates/salesforce/template_salesforce.py | .py | import dataclasses
from copy import deepcopy
from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, HogFunctionTemplateMigrator
common_filters = {
"events": [{"id": "$identify", "name": "$identify", "type": "events", "order": 0}],
"actions": [],
"filter_test_accounts": True,
}
com... | 424 | 15,106 |
posthog | posthog/cdp/templates/brevo/test_template_brevo.py | .py | from posthog.cdp.templates.brevo.template_brevo import template as template_brevo
from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest
def create_inputs(**kwargs):
inputs = {
"apiKey": "apikey12345",
"email": "max@posthog.com",
"attributes": {"EMAIL": "max@posthog.com", "F... | 42 | 1,340 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.