airbyte-source-posthog 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. airbyte-source-posthog-1.0.0/PKG-INFO +97 -0
  2. airbyte-source-posthog-1.0.0/README.md +97 -0
  3. airbyte-source-posthog-1.0.0/airbyte_source_posthog.egg-info/PKG-INFO +97 -0
  4. airbyte-source-posthog-1.0.0/airbyte_source_posthog.egg-info/SOURCES.txt +30 -0
  5. airbyte-source-posthog-1.0.0/airbyte_source_posthog.egg-info/dependency_links.txt +1 -0
  6. airbyte-source-posthog-1.0.0/airbyte_source_posthog.egg-info/entry_points.txt +2 -0
  7. airbyte-source-posthog-1.0.0/airbyte_source_posthog.egg-info/requires.txt +6 -0
  8. airbyte-source-posthog-1.0.0/airbyte_source_posthog.egg-info/top_level.txt +2 -0
  9. airbyte-source-posthog-1.0.0/integration_tests/__init__.py +3 -0
  10. airbyte-source-posthog-1.0.0/integration_tests/acceptance.py +16 -0
  11. airbyte-source-posthog-1.0.0/integration_tests/configured_catalog.json +103 -0
  12. airbyte-source-posthog-1.0.0/integration_tests/configured_catalog_events_incremental.json +19 -0
  13. airbyte-source-posthog-1.0.0/integration_tests/dummy_test.py +8 -0
  14. airbyte-source-posthog-1.0.0/integration_tests/future_state.json +7 -0
  15. airbyte-source-posthog-1.0.0/integration_tests/future_state_old.json +5 -0
  16. airbyte-source-posthog-1.0.0/integration_tests/invalid_config.json +4 -0
  17. airbyte-source-posthog-1.0.0/setup.cfg +95 -0
  18. airbyte-source-posthog-1.0.0/setup.py +39 -0
  19. airbyte-source-posthog-1.0.0/source_posthog/__init__.py +6 -0
  20. airbyte-source-posthog-1.0.0/source_posthog/components.py +149 -0
  21. airbyte-source-posthog-1.0.0/source_posthog/manifest.yaml +174 -0
  22. airbyte-source-posthog-1.0.0/source_posthog/run.py +14 -0
  23. airbyte-source-posthog-1.0.0/source_posthog/schemas/annotations.json +55 -0
  24. airbyte-source-posthog-1.0.0/source_posthog/schemas/cohorts.json +73 -0
  25. airbyte-source-posthog-1.0.0/source_posthog/schemas/events.json +47 -0
  26. airbyte-source-posthog-1.0.0/source_posthog/schemas/feature_flags.json +55 -0
  27. airbyte-source-posthog-1.0.0/source_posthog/schemas/insights.json +160 -0
  28. airbyte-source-posthog-1.0.0/source_posthog/schemas/persons.json +21 -0
  29. airbyte-source-posthog-1.0.0/source_posthog/schemas/projects.json +38 -0
  30. airbyte-source-posthog-1.0.0/source_posthog/source.py +17 -0
  31. airbyte-source-posthog-1.0.0/source_posthog/spec.json +42 -0
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.1
2
+ Name: airbyte-source-posthog
3
+ Version: 1.0.0
4
+ Summary: Source implementation for Posthog.
5
+ Author: Airbyte
6
+ Author-email: contact@airbyte.io
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: airbyte-cdk>=0.44.1
9
+ Provides-Extra: tests
10
+ Requires-Dist: requests-mock~=1.9.3; extra == "tests"
11
+ Requires-Dist: pytest-mock~=3.6.1; extra == "tests"
12
+ Requires-Dist: pytest~=6.1; extra == "tests"
13
+
14
+ # PostHog Source
15
+
16
+ This is the repository for the PostHog source connector, written in Python.
17
+ For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/posthog).
18
+
19
+
20
+ **To iterate on this connector, make sure to complete this prerequisites section.**
21
+
22
+ From this connector directory, create a virtual environment:
23
+ ```
24
+ python -m venv .venv
25
+ ```
26
+
27
+ This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
28
+ development environment of choice. To activate it from the terminal, run:
29
+ ```
30
+ source .venv/bin/activate
31
+ pip install -r requirements.txt
32
+ ```
33
+ If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
34
+
35
+ Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
36
+ used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
37
+ If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
38
+ should work as you expect.
39
+
40
+ **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/posthog)
41
+ to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_posthog/spec.json` file.
42
+ Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
43
+ See `sample_files/sample_config.json` for a sample config file.
44
+
45
+ **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source posthog test creds`
46
+ and place them into `secrets/config.json`.
47
+
48
+ ```
49
+ python main.py spec
50
+ python main.py check --config secrets/config.json
51
+ python main.py discover --config secrets/config.json
52
+ python main.py read --config secrets/config.json --catalog sample_files/configured_catalog.json
53
+ ```
54
+
55
+
56
+
57
+ **Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
58
+ ```bash
59
+ airbyte-ci connectors --name=source-posthog build
60
+ ```
61
+
62
+ An image will be built with the tag `airbyte/source-posthog:dev`.
63
+
64
+ **Via `docker build`:**
65
+ ```bash
66
+ docker build -t airbyte/source-posthog:dev .
67
+ ```
68
+
69
+ Then run any of the connector commands as follows:
70
+ ```
71
+ docker run --rm airbyte/source-posthog:dev spec
72
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev check --config /secrets/config.json
73
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev discover --config /secrets/config.json
74
+ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files airbyte/source-posthog:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json
75
+ ```
76
+
77
+ You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
78
+ ```bash
79
+ airbyte-ci connectors --name=source-posthog test
80
+ ```
81
+
82
+ Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
83
+ If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
84
+
85
+ All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
86
+ We split dependencies between two groups, dependencies that are:
87
+ * required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
88
+ * required for the testing need to go to `TEST_REQUIREMENTS` list
89
+
90
+ You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
91
+ 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-posthog test`
92
+ 2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
93
+ 3. Make sure the `metadata.yaml` content is up to date.
94
+ 4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/posthog.md`).
95
+ 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
96
+ 6. Pat yourself on the back for being an awesome contributor.
97
+ 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
@@ -0,0 +1,97 @@
1
+ # PostHog Source
2
+
3
+ This is the repository for the PostHog source connector, written in Python.
4
+ For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/posthog).
5
+
6
+ ## Local development
7
+
8
+ ### Prerequisites
9
+ **To iterate on this connector, make sure to complete this prerequisites section.**
10
+
11
+ #### Build & Activate Virtual Environment and install dependencies
12
+ From this connector directory, create a virtual environment:
13
+ ```
14
+ python -m venv .venv
15
+ ```
16
+
17
+ This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
18
+ development environment of choice. To activate it from the terminal, run:
19
+ ```
20
+ source .venv/bin/activate
21
+ pip install -r requirements.txt
22
+ ```
23
+ If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
24
+
25
+ Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
26
+ used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
27
+ If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
28
+ should work as you expect.
29
+
30
+ #### Create credentials
31
+ **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/posthog)
32
+ to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_posthog/spec.json` file.
33
+ Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
34
+ See `sample_files/sample_config.json` for a sample config file.
35
+
36
+ **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source posthog test creds`
37
+ and place them into `secrets/config.json`.
38
+
39
+ ### Locally running the connector
40
+ ```
41
+ python main.py spec
42
+ python main.py check --config secrets/config.json
43
+ python main.py discover --config secrets/config.json
44
+ python main.py read --config secrets/config.json --catalog sample_files/configured_catalog.json
45
+ ```
46
+
47
+ ### Locally running the connector docker image
48
+
49
+
50
+ #### Build
51
+ **Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
52
+ ```bash
53
+ airbyte-ci connectors --name=source-posthog build
54
+ ```
55
+
56
+ An image will be built with the tag `airbyte/source-posthog:dev`.
57
+
58
+ **Via `docker build`:**
59
+ ```bash
60
+ docker build -t airbyte/source-posthog:dev .
61
+ ```
62
+
63
+ #### Run
64
+ Then run any of the connector commands as follows:
65
+ ```
66
+ docker run --rm airbyte/source-posthog:dev spec
67
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev check --config /secrets/config.json
68
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev discover --config /secrets/config.json
69
+ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files airbyte/source-posthog:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json
70
+ ```
71
+
72
+ ## Testing
73
+ You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
74
+ ```bash
75
+ airbyte-ci connectors --name=source-posthog test
76
+ ```
77
+
78
+ ### Customizing acceptance Tests
79
+ Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
80
+ If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
81
+
82
+ ## Dependency Management
83
+ All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
84
+ We split dependencies between two groups, dependencies that are:
85
+ * required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
86
+ * required for the testing need to go to `TEST_REQUIREMENTS` list
87
+
88
+ ### Publishing a new version of the connector
89
+ You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
90
+ 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-posthog test`
91
+ 2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
92
+ 3. Make sure the `metadata.yaml` content is up to date.
93
+ 4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/posthog.md`).
94
+ 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
95
+ 6. Pat yourself on the back for being an awesome contributor.
96
+ 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
97
+
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.1
2
+ Name: airbyte-source-posthog
3
+ Version: 1.0.0
4
+ Summary: Source implementation for Posthog.
5
+ Author: Airbyte
6
+ Author-email: contact@airbyte.io
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: airbyte-cdk>=0.44.1
9
+ Provides-Extra: tests
10
+ Requires-Dist: requests-mock~=1.9.3; extra == "tests"
11
+ Requires-Dist: pytest-mock~=3.6.1; extra == "tests"
12
+ Requires-Dist: pytest~=6.1; extra == "tests"
13
+
14
+ # PostHog Source
15
+
16
+ This is the repository for the PostHog source connector, written in Python.
17
+ For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/posthog).
18
+
19
+
20
+ **To iterate on this connector, make sure to complete this prerequisites section.**
21
+
22
+ From this connector directory, create a virtual environment:
23
+ ```
24
+ python -m venv .venv
25
+ ```
26
+
27
+ This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
28
+ development environment of choice. To activate it from the terminal, run:
29
+ ```
30
+ source .venv/bin/activate
31
+ pip install -r requirements.txt
32
+ ```
33
+ If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
34
+
35
+ Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
36
+ used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
37
+ If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
38
+ should work as you expect.
39
+
40
+ **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/posthog)
41
+ to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_posthog/spec.json` file.
42
+ Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
43
+ See `sample_files/sample_config.json` for a sample config file.
44
+
45
+ **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source posthog test creds`
46
+ and place them into `secrets/config.json`.
47
+
48
+ ```
49
+ python main.py spec
50
+ python main.py check --config secrets/config.json
51
+ python main.py discover --config secrets/config.json
52
+ python main.py read --config secrets/config.json --catalog sample_files/configured_catalog.json
53
+ ```
54
+
55
+
56
+
57
+ **Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
58
+ ```bash
59
+ airbyte-ci connectors --name=source-posthog build
60
+ ```
61
+
62
+ An image will be built with the tag `airbyte/source-posthog:dev`.
63
+
64
+ **Via `docker build`:**
65
+ ```bash
66
+ docker build -t airbyte/source-posthog:dev .
67
+ ```
68
+
69
+ Then run any of the connector commands as follows:
70
+ ```
71
+ docker run --rm airbyte/source-posthog:dev spec
72
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev check --config /secrets/config.json
73
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev discover --config /secrets/config.json
74
+ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files airbyte/source-posthog:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json
75
+ ```
76
+
77
+ You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
78
+ ```bash
79
+ airbyte-ci connectors --name=source-posthog test
80
+ ```
81
+
82
+ Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
83
+ If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
84
+
85
+ All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
86
+ We split dependencies between two groups, dependencies that are:
87
+ * required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
88
+ * required for the testing need to go to `TEST_REQUIREMENTS` list
89
+
90
+ You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
91
+ 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-posthog test`
92
+ 2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
93
+ 3. Make sure the `metadata.yaml` content is up to date.
94
+ 4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/posthog.md`).
95
+ 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
96
+ 6. Pat yourself on the back for being an awesome contributor.
97
+ 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
@@ -0,0 +1,30 @@
1
+ README.md
2
+ setup.cfg
3
+ setup.py
4
+ airbyte_source_posthog.egg-info/PKG-INFO
5
+ airbyte_source_posthog.egg-info/SOURCES.txt
6
+ airbyte_source_posthog.egg-info/dependency_links.txt
7
+ airbyte_source_posthog.egg-info/entry_points.txt
8
+ airbyte_source_posthog.egg-info/requires.txt
9
+ airbyte_source_posthog.egg-info/top_level.txt
10
+ integration_tests/__init__.py
11
+ integration_tests/acceptance.py
12
+ integration_tests/configured_catalog.json
13
+ integration_tests/configured_catalog_events_incremental.json
14
+ integration_tests/dummy_test.py
15
+ integration_tests/future_state.json
16
+ integration_tests/future_state_old.json
17
+ integration_tests/invalid_config.json
18
+ source_posthog/__init__.py
19
+ source_posthog/components.py
20
+ source_posthog/manifest.yaml
21
+ source_posthog/run.py
22
+ source_posthog/source.py
23
+ source_posthog/spec.json
24
+ source_posthog/schemas/annotations.json
25
+ source_posthog/schemas/cohorts.json
26
+ source_posthog/schemas/events.json
27
+ source_posthog/schemas/feature_flags.json
28
+ source_posthog/schemas/insights.json
29
+ source_posthog/schemas/persons.json
30
+ source_posthog/schemas/projects.json
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ source-posthog = source_posthog.run:run
@@ -0,0 +1,6 @@
1
+ airbyte-cdk>=0.44.1
2
+
3
+ [tests]
4
+ requests-mock~=1.9.3
5
+ pytest-mock~=3.6.1
6
+ pytest~=6.1
@@ -0,0 +1,2 @@
1
+ integration_tests
2
+ source_posthog
@@ -0,0 +1,3 @@
1
+ #
2
+ # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
+ #
@@ -0,0 +1,16 @@
1
+ #
2
+ # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
+ #
4
+
5
+
6
+ import pytest
7
+
8
+ pytest_plugins = ("connector_acceptance_test.plugin",)
9
+
10
+
11
+ @pytest.fixture(scope="session", autouse=True)
12
+ def connector_setup():
13
+ """This fixture is a placeholder for external resources that acceptance test might require."""
14
+ # TODO: setup test dependencies
15
+ yield
16
+ # TODO: clean up test dependencies
@@ -0,0 +1,103 @@
1
+ {
2
+ "streams": [
3
+ {
4
+ "stream": {
5
+ "name": "projects",
6
+ "json_schema": {},
7
+ "supported_sync_modes": ["full_refresh"],
8
+ "source_defined_primary_key": [["id"]],
9
+ "namespace": null
10
+ },
11
+ "sync_mode": "full_refresh",
12
+ "destination_sync_mode": "append",
13
+ "primary_key": null
14
+ },
15
+ {
16
+ "stream": {
17
+ "name": "annotations",
18
+ "json_schema": {},
19
+ "supported_sync_modes": ["full_refresh"],
20
+ "source_defined_primary_key": [["id"]],
21
+ "namespace": null
22
+ },
23
+ "sync_mode": "full_refresh",
24
+ "destination_sync_mode": "append",
25
+ "primary_key": null
26
+ },
27
+ {
28
+ "stream": {
29
+ "name": "cohorts",
30
+ "json_schema": {},
31
+ "supported_sync_modes": ["full_refresh"],
32
+ "source_defined_cursor": null,
33
+ "default_cursor_field": null,
34
+ "source_defined_primary_key": [["id"]],
35
+ "namespace": null
36
+ },
37
+ "sync_mode": "full_refresh",
38
+ "cursor_field": null,
39
+ "destination_sync_mode": "append",
40
+ "primary_key": null
41
+ },
42
+ {
43
+ "stream": {
44
+ "name": "events",
45
+ "json_schema": {},
46
+ "supported_sync_modes": ["full_refresh", "incremental"],
47
+ "source_defined_cursor": true,
48
+ "default_cursor_field": ["timestamp"],
49
+ "source_defined_primary_key": [["id"]],
50
+ "namespace": null
51
+ },
52
+ "sync_mode": "full_refresh",
53
+ "cursor_field": null,
54
+ "destination_sync_mode": "append",
55
+ "primary_key": null
56
+ },
57
+ {
58
+ "stream": {
59
+ "name": "feature_flags",
60
+ "json_schema": {},
61
+ "supported_sync_modes": ["full_refresh"],
62
+ "source_defined_cursor": null,
63
+ "default_cursor_field": null,
64
+ "source_defined_primary_key": [["id"]],
65
+ "namespace": null
66
+ },
67
+ "sync_mode": "full_refresh",
68
+ "cursor_field": null,
69
+ "destination_sync_mode": "append",
70
+ "primary_key": null
71
+ },
72
+ {
73
+ "stream": {
74
+ "name": "persons",
75
+ "json_schema": {},
76
+ "supported_sync_modes": ["full_refresh"],
77
+ "source_defined_cursor": null,
78
+ "default_cursor_field": null,
79
+ "source_defined_primary_key": [["id"]],
80
+ "namespace": null
81
+ },
82
+ "sync_mode": "full_refresh",
83
+ "cursor_field": null,
84
+ "destination_sync_mode": "append",
85
+ "primary_key": null
86
+ },
87
+ {
88
+ "stream": {
89
+ "name": "insights",
90
+ "json_schema": {},
91
+ "supported_sync_modes": ["full_refresh"],
92
+ "source_defined_cursor": null,
93
+ "default_cursor_field": null,
94
+ "source_defined_primary_key": [["id"]],
95
+ "namespace": null
96
+ },
97
+ "sync_mode": "full_refresh",
98
+ "cursor_field": null,
99
+ "destination_sync_mode": "append",
100
+ "primary_key": null
101
+ }
102
+ ]
103
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "streams": [
3
+ {
4
+ "stream": {
5
+ "name": "events",
6
+ "json_schema": {},
7
+ "supported_sync_modes": ["full_refresh", "incremental"],
8
+ "source_defined_cursor": true,
9
+ "default_cursor_field": ["timestamp"],
10
+ "source_defined_primary_key": [["id"]],
11
+ "namespace": null
12
+ },
13
+ "sync_mode": "incremental",
14
+ "destination_sync_mode": "append",
15
+ "cursor_field": ["timestamp"],
16
+ "primary_key": [["id"]]
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,8 @@
1
+ #
2
+ # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
+ #
4
+
5
+
6
+ def test_dummy():
7
+ """This is just to fix customIntegration task in Gradle. It fails when pytest unable to find tests."""
8
+ assert True
@@ -0,0 +1,7 @@
1
+ {
2
+ "events": {
3
+ "2331": {
4
+ "timestamp": "2221-12-10T10:21:35.003000+00:00"
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "events": {
3
+ "timestamp": "2221-12-10T10:21:35.003000+00:00"
4
+ }
5
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "api_key": "value1",
3
+ "start_date": "2021-01-01T00:00:00Z"
4
+ }
@@ -0,0 +1,95 @@
1
+ [metadata]
2
+ name = airbyte-source-posthog
3
+ version = 1.0.0
4
+ author = Airbyte
5
+ author_email = contact@airbyte.io
6
+ long_description = # PostHog Source
7
+
8
+ This is the repository for the PostHog source connector, written in Python.
9
+ For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/posthog).
10
+
11
+
12
+ **To iterate on this connector, make sure to complete this prerequisites section.**
13
+
14
+ From this connector directory, create a virtual environment:
15
+ ```
16
+ python -m venv .venv
17
+ ```
18
+
19
+ This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
20
+ development environment of choice. To activate it from the terminal, run:
21
+ ```
22
+ source .venv/bin/activate
23
+ pip install -r requirements.txt
24
+ ```
25
+ If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
26
+
27
+ Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
28
+ used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
29
+ If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
30
+ should work as you expect.
31
+
32
+ **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/posthog)
33
+ to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_posthog/spec.json` file.
34
+ Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
35
+ See `sample_files/sample_config.json` for a sample config file.
36
+
37
+ **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source posthog test creds`
38
+ and place them into `secrets/config.json`.
39
+
40
+ ```
41
+ python main.py spec
42
+ python main.py check --config secrets/config.json
43
+ python main.py discover --config secrets/config.json
44
+ python main.py read --config secrets/config.json --catalog sample_files/configured_catalog.json
45
+ ```
46
+
47
+
48
+
49
+ **Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
50
+ ```bash
51
+ airbyte-ci connectors --name=source-posthog build
52
+ ```
53
+
54
+ An image will be built with the tag `airbyte/source-posthog:dev`.
55
+
56
+ **Via `docker build`:**
57
+ ```bash
58
+ docker build -t airbyte/source-posthog:dev .
59
+ ```
60
+
61
+ Then run any of the connector commands as follows:
62
+ ```
63
+ docker run --rm airbyte/source-posthog:dev spec
64
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev check --config /secrets/config.json
65
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-posthog:dev discover --config /secrets/config.json
66
+ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files airbyte/source-posthog:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json
67
+ ```
68
+
69
+ You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
70
+ ```bash
71
+ airbyte-ci connectors --name=source-posthog test
72
+ ```
73
+
74
+ Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
75
+ If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
76
+
77
+ All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
78
+ We split dependencies between two groups, dependencies that are:
79
+ * required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
80
+ * required for the testing need to go to `TEST_REQUIREMENTS` list
81
+
82
+ You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
83
+ 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-posthog test`
84
+ 2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
85
+ 3. Make sure the `metadata.yaml` content is up to date.
86
+ 4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/posthog.md`).
87
+ 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
88
+ 6. Pat yourself on the back for being an awesome contributor.
89
+ 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
90
+ long_description_content_type = text/markdown
91
+
92
+ [egg_info]
93
+ tag_build =
94
+ tag_date = 0
95
+
@@ -0,0 +1,39 @@
1
+ #
2
+ # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
+ #
4
+
5
+
6
+ from setuptools import find_packages, setup
7
+
8
+ MAIN_REQUIREMENTS = ["airbyte-cdk>=0.44.1"]
9
+
10
+ TEST_REQUIREMENTS = [
11
+ "requests-mock~=1.9.3",
12
+ "pytest-mock~=3.6.1",
13
+ "pytest~=6.1",
14
+ ]
15
+
16
+ setup(
17
+ entry_points={
18
+ "console_scripts": [
19
+ "source-posthog=source_posthog.run:run",
20
+ ],
21
+ },
22
+ description="Source implementation for Posthog.",
23
+ packages=find_packages(),
24
+ install_requires=MAIN_REQUIREMENTS,
25
+ package_data={
26
+ "": [
27
+ # Include yaml files in the package (if any)
28
+ "*.yml",
29
+ "*.yaml",
30
+ # Include all json files in the package, up to 4 levels deep
31
+ "*.json",
32
+ "*/*.json",
33
+ "*/*/*.json",
34
+ "*/*/*/*.json",
35
+ "*/*/*/*/*.json",
36
+ ]
37
+ },
38
+ extras_require={"tests": TEST_REQUIREMENTS},
39
+ )
@@ -0,0 +1,6 @@
1
+ #
2
+ # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
+ #
4
+ from .source import SourcePosthog
5
+
6
+ __all__ = ["SourcePosthog"]