In this example, you will create blueprints for user
and team
that ingests all users and teams from your Port account. You will then add some python script to make API calls to Port's REST API and fetch data for your account.
Log in to your Port account and create the following blueprints:
Create the user blueprint in Port using this json file
Create the team blueprint in Port using this json file
The list of variables required to run the scripts are:
PORT_CLIENT_ID
PORT_CLIENT_SECRET
Find your port client id and secret from this guide
Opne a shell or terminal and run the following commands:
export PORT_CLIENT_ID=<ENTER CLIENT ID>
export PORT_CLIENT_SECRET=<ENTER CLIENT SECRET>
git clone https://github.com/port-labs/example-port-organization-data.git
cd example-port-organization-data
pip install -r ./requirements.txt
python app.py
Opne a shell or terminal and run the following commands:
export PORT_CLIENT_ID=<ENTER CLIENT ID>
export PORT_CLIENT_SECRET=<ENTER CLIENT SECRET>
git clone https://github.com/port-labs/example-port-organization-data.git
cd example-port-organization-data/typescript
npm install -g ts-node typescript '@types/node'
npm install axios
npx tsx app.ts
Done! you will now be able to see your Port users and teams created as blueprint entities.