Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Buffer/Buffer_Setup_connection.ipynb
2973 views
Kernel: Python 3

Buffer.png

Buffer - Setup connection

Give Feedback | Bug report

Tags: #buffer #naas #secret #connection #setup

Last update: 2023-11-20 (Created: 2023-11-20)

Description: This notebook help you setup your connection with Buffer and add required credentials to Naas secret. You will be able to establish a seamless connection to Buffer without the need to repeatedly redefine your credentials in variables by using naas.secret.get() in your notebook.

Input

Import libraries

import naas

Setup variables

Pre-requisite

You need to inspect your Buffer session in your web browser and copy/paste your cookie in the variable below. The cookie will be used for authentication and maintaining the session with Buffer.

Mandatory

  • buffer_cookies: This variable is used to store the cookie information from your Buffer session. This value will be stored under the secret 'BUFFER_COOKIES'.

Optional

  • secrets: Dict to add secrets to naas

# Mandatory buffer_cookies = None # Optional secrets = { "BUFFER_COOKIES": buffer_cookies, }

Model

Add secret

for secret in secrets: new_value = secrets.get(secret) if new_value: naas.secret.add(secret, secrets.get(secret))

Output

Display result

df = naas.secret.list() df = df[df["name"].isin(secrets.keys())] df