This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Akhmetov
committed
Sep 22, 2018
0 parents
commit ab6b31e
Showing
45 changed files
with
1,550 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.tox | ||
*.pyc | ||
.plist | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Alexander Akhmetov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# file GENERATED by distutils, do NOT edit | ||
README.md | ||
setup.cfg | ||
setup.py | ||
docs/CHANGELOG.md | ||
docs/actions.md | ||
docs/new_action.md | ||
docs/tutorial.md | ||
shortcuts/__init__.py | ||
shortcuts/cli.py | ||
shortcuts/docs.py | ||
shortcuts/dump.py | ||
shortcuts/loader.py | ||
shortcuts/shortcuts.py | ||
shortcuts/actions/__init__.py | ||
shortcuts/actions/base.py | ||
shortcuts/actions/base64.py | ||
shortcuts/actions/calculation.py | ||
shortcuts/actions/date.py | ||
shortcuts/actions/dictionary.py | ||
shortcuts/actions/files.py | ||
shortcuts/actions/input.py | ||
shortcuts/actions/out.py | ||
shortcuts/actions/photo.py | ||
shortcuts/actions/text.py | ||
shortcuts/actions/variables.py | ||
shortcuts/actions/web.py | ||
shortcuts/tests/__init__.py | ||
shortcuts/tests/actions/__init__.py | ||
shortcuts/tests/actions/base/__init__.py | ||
shortcuts/tests/actions/base/tests.py | ||
shortcuts/tests/actions/photo/__init__.py | ||
shortcuts/tests/actions/photo/tests.py | ||
shortcuts/tests/shortcuts/__init__.py | ||
shortcuts/tests/shortcuts/tests.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Include the README | ||
include *.md | ||
|
||
# Include the license file | ||
include LICENSE.txt | ||
|
||
recursive-include shortcuts *.py | ||
recursive-include docs * | ||
|
||
global-exclude *.pyc .git .tox __pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
generate_docs: | ||
python src/docs.py docs/actions.md | ||
|
||
tests: | ||
tox | ||
|
||
|
||
release-pypi: | ||
test -n "$(VERSION)" | ||
python setup.py sdist | ||
twine upload dist/python-shortcuts-$(VERSION).tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[dev-packages] | ||
pytest = "*" | ||
mock = "*" | ||
|
||
[packages] | ||
toml = "*" | ||
|
||
[requires] | ||
python_version = "3.6" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# python-shortcuts | ||
|
||
🍏 + 🐍 = ❤️ | ||
|
||
**python-shortcuts** is a library to create [Siri Shortcuts](https://support.apple.com/en-ae/guide/shortcuts/welcome/ios) on your laptop with your favourite text editor. | ||
It uses [toml](https://github.com/toml-lang/toml) to represent shortcuts. | ||
|
||
The library is in a very early development state (PR welcome!), so it does not support all actions from Shortcuts app. | ||
|
||
* [Tutorial](docs/tutorial.md) | ||
* [How to add a new action](docs/new_action.md) | ||
* [Supported actions](docs/actions.md) | ||
* [Examples](examples/) | ||
* [Changelog](docs/CHANGELOG.md) | ||
* [Documentation](docs/) | ||
|
||
## Why | ||
|
||
I wanted to convert my shortcut to a file in human-readable format. :) | ||
|
||
## How to use | ||
|
||
### Requirements | ||
|
||
This library requires `plutil` tool, which should be installed on MacOS by default. | ||
On Linux, you should be able to use `plistutil` instead. | ||
|
||
### Usage | ||
|
||
### shortcut → toml | ||
|
||
If you need to convert existing shortcut to a toml file, at first you need to export it. | ||
Go into Shortcuts app, open the shortcut and share it. Choose "Share as file" and use this file with this library. | ||
|
||
Convert `toml` file with shortcut description to a real shortcut file. | ||
After you need to open the file with iOS Shortcuts app. | ||
|
||
```bash | ||
python src/cli.py examples/test.toml my_first_shortcut.shortcut | ||
``` | ||
|
||
### toml → shortcut | ||
|
||
Also, you can convert shortcut file to a `toml`: | ||
|
||
```bash | ||
python src/cli.py examples/test.shortcut test.toml | ||
``` | ||
|
||
More examples of `toml` files you can find [here](examples/). | ||
And [read the tutorial](docs/tutorial.md)! :) | ||
|
||
## Development | ||
|
||
### Tests | ||
|
||
Run tests: | ||
|
||
```bash | ||
tox | ||
``` | ||
|
||
### TODO | ||
|
||
* ☐ Conditionals | ||
* ☐ Describe all actions | ||
* ☐ Support magic variables | ||
* ☐ Support all current actions from Shortcuts app | ||
* ☐ Support common action format (with default `WFTextActionText...` field names), so it will not be necessary to create mappings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.1.0] | ||
|
||
- It's alive! |
Oops, something went wrong.