Package: airbyte-source-google-analytics-data-api
Google-Analytics-Data-Api source connectorThis is the repository for the Google-Analytics-Data-Api source connector, written in Python.
For information about how to use this connector within Airbyte, seethe documentation.Local developmentPrerequisitesPython (~=3.9)Poetry (~=1.7) - installation instructionshereInstalling the connectorFrom this connector directory, run:poetryinstall--withdevCreate credentialsIf you are a community contributor, follow the instructions in thedocumentationto generate the necessary credentials. Then create a filesecrets/config.jsonconforming to thesource_google_analytics_data_api/spec.yamlfile.
Note that any directory namedsecretsis gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
Seesample_files/sample_config.jsonfor a sample config file.Locally running the connectorpoetry run source-google-analytics-data-api spec
poetry run source-google-analytics-data-api check --config secrets/config.json
poetry run source-google-analytics-data-api discover --config secrets/config.json
poetry run source-google-analytics-data-api read --config secrets/config.json --catalog sample_files/configured_catalog.jsonRunning unit testsTo run unit tests locally, from the connector directory run:poetry run pytest unit_testsBuilding the docker imageInstallairbyte-ciRun the following command to build the docker image:airbyte-ciconnectors--name=source-google-analytics-data-apibuildAn image will be available on your host with the tagairbyte/source-google-analytics-data-api:dev.Running as a docker containerThen run any of the connector commands as follows:docker run --rm airbyte/source-google-analytics-data-api:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-analytics-data-api:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-analytics-data-api:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-analytics-data-api:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.jsonRunning our CI test suiteYou can run our full test suite locally usingairbyte-ci:airbyte-ciconnectors--name=source-google-analytics-data-apitestCustomizing acceptance TestsCustomizeacceptance-test-config.ymlfile to configure acceptance tests. SeeConnector Acceptance Testsfor more information.
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.Dependency ManagementAll of your dependencies should be managed via Poetry.
To add a new dependency, run:poetryadd<package-name>Please commit the changes topyproject.tomlandpoetry.lockfiles.Publishing a new version of the connectorYou've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?Make sure your changes are passing our test suite:airbyte-ci connectors --name=source-google-analytics-data-api testBump the connector version (please followsemantic versioning for connectors):bump thedockerImageTagvalue in inmetadata.yamlbump theversionvalue inpyproject.tomlMake sure themetadata.yamlcontent is up to date.Make sure the connector documentation and its changelog is up to date (docs/integrations/sources/google-analytics-data-api.md).Create a Pull Request: useour PR naming conventions.Pat yourself on the back for being an awesome contributor.Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.