Skip to content

fxnlabs/function-python-api-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Function API Client Demo with Python

This demo is to illustrate how to install and leverage Function's API client using Python.

Setup

Make sure you have at least Python 3.7 installed.

First, create a virtualenv and activate it.

macOS and Linux
python -m venv venv
source venv/bin/activate
Windows
python -m venv venv
venv\Scripts\activate

Next, add the Buf registry to pull Function's typed API client:

macOS and Linux
printf "
[global]
extra-index-url = https://buf.build/gen/python
" > venv/pip.conf
Windows

Create a new file in your venv directory named pip.conf and add the following:

[global]
extra-index-url = https://buf.build/gen/python

Finally, install dependencies:

pip install -r requirements.txt

Run Demo

Copy the env.example file to .env and fill in your Function API key.

Once you have done that, you can run the demo:

python demo.py

Source Code

See the demo.py file for the source code.

About

A demo to show our Function SDKs working in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages