This article provides an overview to get started with the Github connector in Peliqan. Please contact support if you have any additional questions or remarks.
Contents
- Contents
- Connect
- Explore & Combine
- Writeback (Python scripts)
- Write file to Github (commit)
- Read file from Github
- Peliqan CI/CD using Github
- Example: pull Python script update from Github into Peliqan
- Example: pull data model (query) update from Github into Peliqan
- Example: commit Python script from Peliqan to Github
- Example: commit data model (query) from Peliqan to Github
Connect
In peliqan, go to Connections, click on Add new. Find Github in the list and select it. Click on the Connect button. This will open Github and allow you to authorize access for Peliqan. Once that is done, you will return to Peliqan.
Explore & Combine
The Github connector in Peliqan is currently a “writeback”-only connector, this means it can be used in Python scripts but there are no out-of-the-box ETL pipelines that will sync data from Github into tables in the Peliqan data warehouse.
Writeback (Python scripts)
Below are examples of how to read and write from and to Github from Peliqan Python scripts (data apps).
Write file to Github (commit)
Here’s an example to commit files to Github from a script in Peliqan:
Read file from Github
import base64
github_api = pq.connect('Github')
file = {
"owner": "ownername",
"repo": "reponame",
"path": "my_script.py",
}
result = github_api.get('file', file)
content = base64.b64decode(result["content"]).decode("utf-8")
st.write(content)Peliqan CI/CD using Github
Using the Github connector, you can build CI/CD pipelines that e.g. push updates of data models (queries) and Python scripts from Peliqan to Github, and that pull in updates from Github into Peliqan.