Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robnewman/cannyio-users
Utility to query Canny API
https://github.com/robnewman/cannyio-users
Last synced: about 1 month ago
JSON representation
Utility to query Canny API
- Host: GitHub
- URL: https://github.com/robnewman/cannyio-users
- Owner: robnewman
- License: mit
- Created: 2024-02-01T18:24:17.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-15T16:33:39.000Z (7 months ago)
- Last Synced: 2024-04-15T17:55:44.672Z (7 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cannyio-users
Utility to query the Canny Users API endpoint and return all users
without a Company affiliation. Then send a Slack notification with
the list of users.## Overview
Simple Python script to query the [Canny.io API Users
endpoint](https://developers.canny.io/api-reference#users) and
return all users that do not have a Company affiliation.The following environment variables are stored in a `.env` file and not part of this repository:
- Canny API key
- Slack OAuth token
- Slack channel name
- Total usersThe `.env` file contents (in same directory as Python script):
```sh
API_KEY=
SLACKBOT_OAUTH_TOKEN=
SLACK_CHANNEL=
TOTAL_USERS=
```## Assumptions
- The Canny Users API endpoint allows a maximum of 100 records returned (you can optionally define a `skip` value to skip N records).
- The Python script currently naively assumes a maximum of `TOTAL_USERS` and iterates in blocks of 100.
- There is a working Slackbot integration with the auth token stored in the `.env` file## Virtual environment
This script uses a virtual environment called `cannyio`. Use Conda
to recreate the environment on your localhost:```
conda env create -f environment.yml
```Make sure to activate the environment before running the script:
```
conda activate cannyio
```## Run the script
Execute the script with the following Python command:
```
$ python return-users.py
```