Package: airbyte-source-notion
Notion source connectorThis is the repository for the Notion 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_notion/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-notion spec
poetry run source-notion check --config secrets/config.json
poetry run source-notion discover --config secrets/config.json
poetry run source-notion 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-notionbuildAn image will be available on your host with the tagairbyte/source-notion:dev.Running as a docker containerThen run any of the connector commands as follows:docker run --rm airbyte/source-notion:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-notion:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-notion:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-notion: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-notiontestCustomizing 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-notion 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/notion.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.