Skip to content

Latest commit

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Colab_shared_code_for_API_usage

Description

Python module can be used for writing API Colab samples. It consists of methods to requested API endpoints, launch report on Process Template and import files.

Usage

  1. Import the module within the code in Colab sample. It can be done by next way:
#@title Select **servicePack** the Sample should runfromsubprocessimportgetstatusoutputservicePack="DEMO"#@param ['DEMO'] {allow-input: true}ifservicePack=='DEMO':
branch='main'else:
branch=servicePackprint(branch)
rm=getstatusoutput("rm Colab_shared_code_for_API_usage -rf ") clone=getstatusoutput("git clone -l -s --branch "+branch+" https://github.com/kyriba/Colab_shared_code_for_API_usage.git") importimportlibenableFormatterDF=True#@param {type:"boolean"}fromgoogle.colabimportdata_tableifenableFormatterDFisTrue:
data_table.enable_dataframe_formatter()
else:
data_table.disable_dataframe_formatter()
try: importlib.reload(sample_requests)
except:
print()
fromColab_shared_code_for_API_usageimportsample_requestsfromColab_shared_code_for_API_usage.sample_requestsimportToken
  1. Use methods inside cell by calling this module name and use Token.getToken() expresion to put token parameter. For example:
result=sample_requests.run_report(Token.getToken(),'ProcessTemplate')

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages