A REST client for the Shortcut REST API
Project description
useshortcut
A python REST API Client for the v3 of the Shortcut API.
Installation
You can install useshortcut using pip:
pip install useshortcut
Or if you're using pipenv:
pipenv install useshortcut
Quick Start
import 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)
Development
Setting up the development environment
- 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 shell
Running Tests
There are several ways to run the tests:
Using make:
make test
Using pipenv directly:
pipenv run pytest
Using invoke:
pipenv run invoke test
To run tests with coverage:
pipenv run pytest --cov=useshortcut
Environment Variables
You'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_here
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file useshortcut-0.0.1.tar.gz.
File metadata
- Download URL: useshortcut-0.0.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dbcaf0f3d5a516a403f7c36d1b56eb4c486c318a512c7d5e27e7bcf61d81671
|
|
| MD5 |
44825c9470794ef4374697ff1894ac36
|
|
| BLAKE2b-256 |
0104092befb8804fcf25837a6d5921d3260434f0f35f1fcfecdcff769b60e313
|
Provenance
The following attestation bundles were made for useshortcut-0.0.1.tar.gz:
Publisher:
publish.yml on iwillig/useshortcut-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
useshortcut-0.0.1.tar.gz -
Subject digest:
7dbcaf0f3d5a516a403f7c36d1b56eb4c486c318a512c7d5e27e7bcf61d81671 - Sigstore transparency entry: 233531359
- Sigstore integration time:
-
Permalink:
iwillig/useshortcut-py@9b94f1350c3d44e487547d7c0051c8abc8013d49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/iwillig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b94f1350c3d44e487547d7c0051c8abc8013d49 -
Trigger Event:
push
-
Statement type:
File details
Details for the file useshortcut-0.0.1-py3-none-any.whl.
File metadata
- Download URL: useshortcut-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29286c3bfdac2bc195b83e0e6fc6d5b1a04fd8564d33bbf333b9b75ee12b98bc
|
|
| MD5 |
bc10aaa3b2afecf82acb9e65103c7277
|
|
| BLAKE2b-256 |
75294d2a4bb1ca95291d4d60ea520820a2451f44fac972049485a38dd4d0da18
|
Provenance
The following attestation bundles were made for useshortcut-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on iwillig/useshortcut-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
useshortcut-0.0.1-py3-none-any.whl -
Subject digest:
29286c3bfdac2bc195b83e0e6fc6d5b1a04fd8564d33bbf333b9b75ee12b98bc - Sigstore transparency entry: 233531361
- Sigstore integration time:
-
Permalink:
iwillig/useshortcut-py@9b94f1350c3d44e487547d7c0051c8abc8013d49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/iwillig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b94f1350c3d44e487547d7c0051c8abc8013d49 -
Trigger Event:
push
-
Statement type: