A python REST API Client for the v3 of the Shortcut API.
You can install useshortcut using pip:
pip install useshortcutOr if you're using pipenv:
pipenv install useshortcutimport os
from useshortcut.client import APIClient
import useshortcut.models as models
client = APIClient(api_token=os.environ.get("SHORTCUT_API_TOKEN"))
# Get the current user
current_member = client.get_current_member()
# Find all the stories that I own
search_params = models.SearchInputs(
query=f"owner:{current_member.mention_name}",
)
# Print all the story ids that I own.
stories = client.search_stories(search_params)
for story in stories.data:
print(story.id)- Clone the repository:
git clone https://github.com/your-username/useshortcut-py.git
cd useshortcut-py- Install pipenv if you haven't already:
pip install pipenv- Install development dependencies:
pipenv install --dev- Activate the virtual environment:
pipenv shellThere are several ways to run the tests:
Using invoke:
pipenv run invoke testUsing pipenv directly:
pipenv run pytestTo run tests with coverage:
pipenv run pytest --cov=useshortcutYou'll need to set up the following environment variable for development:
SHORTCUT_API_TOKEN: Your Shortcut API token
You can create a .env file in the project root (it will be ignored by git):
SHORTCUT_API_TOKEN=your_api_token_hereThis project is licensed under the MIT License - see the LICENSE file for details.