Skip to main content

iOS and command line tool to import a TaskPaper template with placeholders into Things by Cultured Code

Project description

popthings

iOS and command line tool to import a TaskPaper template with placeholders into Things by Cultured Code

Installation

On macOS

Install popthings using pip. Both Python 2 and Python 3 are supported.

$ pip install popthings

On iOS

Use Pythonista to execute the script. Download the popthings.py file to the "This iPhone/iPad" location. The script cannot be on iCloud if you want to use the Share Sheet Extension. To add popthings to the Share Extension shortcut, add the popthings.py script as a new shortcut in the Pythonista settings. See the Pythonista Documentation for more details.

Pythonista Edit Shortcut

To add a button on the Today Widget, use the following entry for the SHORTCUT variable in the Examples/Widget/Launcher.py file:

{
    'title': 'PopThings',
    'url': 'pythonista3://popthings.py?action=run',
    'color': '#5e96ff',
    'icon': 'iow:checkmark_24'
},

Usage

popthings supports placeholder replacement, headers and checklist items. Date parsing is done by Things itself, so anything Things supports is also supported here.

  • The indentation must be done with Tabs, which is the normal TaskPaper behavior.
  • Placeholders must be defined on the second line of the file. They must have a $ prefix and be space-separated.
  • The @start and @due tags expect a value and will be used for the "when" and "deadline" attributes of a project or task. All other tags are passed through and their values are ignored.
  • A project under a project is a considered a heading. It can't have notes. Tasks under it can be indented or not, which is more flexible than the TaskPaper format.
  • A task under a task is a checklist item.

Here is a packing list template with 3 placeholders:

Prepare luggage for trip to $destination: @start($start)
    $start $due $destination
    Before leaving:
        - Find good place for dinner @research
            Don't forget to check NYT's "36 hours in ..."
    Packing:
        - Passport @due($due)
        - Clothes @due($due)
            - Pants
            - T-shirts
    Last minute: @due($due)
        - Set thermostat to travel mode @due($due) @home
        - Water plants @due($due) @home

To import the template on the Mac, pass the TaskPaper filename to the popthings executable. If there are any placeholders, you'll be prompted for their value.

$ popthings templatex-travel.taskpaper
Start value? 2018-09-01
Due value? 2018-09-10
Destination value? Paris

Here's the result of parsing the template above.

Parsed template in Things

On iOS, you can use popthings via:

  • The Share Sheet to share the content of a TaskPaper document from any application.
  • From Pythonista or from the Today Widget where you'll be prompted to pick a file using the File picker.

In both cases, Pythonista will prompt you for the placeholder values if there are any.

Known limitations

  • The TaskPaper file must start with a project.
  • If a header has a comment, the previous task or project is going to end up with that comment.

Making a Release

  1. Bump the version in popthings.py
  2. Update the changelog, link the versions.
  3. Commit and tag with version number. Push tags. Update the release on GitHub.
  4. Build a source dist with python3 setup.py clean && rm dist/* && python3 setup.py sdist bdist_wheel
  5. Test upload to PyPI test with twine upload --repository-url https://test.pypi.org/legacy/ dist/*
  6. Create a temporary environment mktmpenv and test install with pip install --index-url https://test.pypi.org/simple/ popthings
  7. If everything looks good, upload for real with twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

popthings-1.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

popthings-1.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file popthings-1.1.0.tar.gz.

File metadata

  • Download URL: popthings-1.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for popthings-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e62e53f43436264873a6975725ca686a492750fab2f63a42daa89aa7a956cc3b
MD5 b83eeae5f6c3097c3ec4d69fe8a217fe
BLAKE2b-256 9c24cd2c0d9e9c1b0a375f1afafa4e044482361153f7149219f4887a8eb455d9

See more details on using hashes here.

File details

Details for the file popthings-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: popthings-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for popthings-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf660fcfb1e238a1a81d0ac22cdbb3c581190c4d6207a4836404bb50b95a8cbe
MD5 7f49255bf8c1a13f0f60b5e86000fddb
BLAKE2b-256 1ed941ad93b282f0a7f0deb1f9a019872f2d26a434023aed0df32a57371c50bb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page