forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
airbyte-lib: Connector documentation (airbytehq#33063)
- Loading branch information
1 parent
e18fa6e
commit ec1800a
Showing
11 changed files
with
446 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
import { JSONSchemaFaker } from "json-schema-faker"; | ||
import CodeBlock from '@theme/CodeBlock'; | ||
|
||
|
||
export const AirbyteLibExample = ({ | ||
specJSON, | ||
connector | ||
}) => { | ||
const spec = JSON.parse(specJSON); | ||
const fakeConfig = JSONSchemaFaker.generate(spec); | ||
return <> | ||
<p> | ||
Install the Python library via: | ||
</p> | ||
<CodeBlock | ||
language="bash">{"pip install airbyte-lib"}</CodeBlock> | ||
<p>Then, execute a sync by loading the connector like this:</p> | ||
<CodeBlock | ||
language="python" | ||
>{`import airbyte_lib as ab | ||
config = ${JSON.stringify(fakeConfig, null, 2)} | ||
result = ab.get_connector( | ||
"${connector}", | ||
config=config, | ||
).read_all() | ||
for record in result.cache.streams["my_stream:name"]: | ||
print(record)`} </CodeBlock> | ||
<p>You can find more information in the airbyte_lib quickstart guide.</p> | ||
</>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.