clean-workspace


Nameclean-workspace JSON
Version 0.6.4 PyPI version JSON
download
home_pagehttps://github.com/iloveitaly/clean-browser
SummaryCollect all browser URLs, output to terminal, and archive to todoist. Useful for cleaning up your workspace at the end of the day, without loosing important urls.
upload_time2024-03-20 11:29:37
maintainerNone
docs_urlNone
authorMike Bianco
requires_python<4.0,>=3.10
licenseMIT
keywords todoist browser productivity
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- trunk-ignore-all(trufflehog/GitHubOauth2) -->
<!-- trunk-ignore-all(markdownlint/MD041) -->

[![Release Notes](https://img.shields.io/github/release/iloveitaly/clean-browser)](https://github.com/iloveitaly/clean-browser/releases)
[![Downloads](https://static.pepy.tech/badge/clean-workspace/month)](https://pepy.tech/project/clean-workspace)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)

# Clean Workspace: Archive Web Browser Tabs

I love experimenting with productivity. One glitch I've found in my mind is I can easily
get distracted by open tabs on my browser, especially if I'm trying to write or read something which I want to give
my full attention to.

I've found that if I close all my tabs (similar idea to [shrinking context size](http://mikebian.co/improve-motivation-and-focus-with-small-contexts/)), I can focus better on the task at hand. However, I don't
want to lose any interesting tabs so I don't easily quit my browsers. It's just the little extra of cognitive energy required to add more focus that doesn't get spent.

This is utility to fix this issue. It closes all your tabs (in both Safari & Chrome), sends them to [todoist](https://mikebian.co/todoist)
with a specified project and optionally a label, and outputs the list to the terminal (mostly for debugging). Only unique URLs are sent to Todoist, if you have a previous "archive task" with a URL archived it will not be archived again.

This utility has helped my mind and made it easy for me to find interesting things I've run into in the past. I've tied this into a 'first wake' [hyper focus](https://mikebian.co/hyper-focus) script to automatically run each morning when I first open my computer.

## Installation

```shell
pip install clean-workspace
```

- `TODOIST_API_KEY` has to exist in your shell environment for the tool to run.
  I recommend using [direnv](https://direnv.net/) to do this. Add your todoist token to `.envrc` and `direnv allow .`
- Customize the url and domain blacklist

## Usage

```shell
❯ clean-workspace --help
Usage: clean-workspace [OPTIONS]

Options:
  --blacklist-domains PATH
  --blacklist-urls PATH
  --tab-description TEXT    Description for tab
  --todoist-label TEXT      label in todoist for all created tasks  [default:
                            web-archive]
  --todoist-project TEXT    project in todoist for all created tasks
                            [default: Learning]
  --help                    Show this message and exit.
```

## Development

```shell
poetry install
poetry run clean-workspace
```

### Regex Entries

You can use regex matches in both the url and domain blacklist files. For example, if you want to blacklist all Zoom domains, you can use the following:

```shell
echo "/.*zoom\.us/" >> ~/.config/clean-workspace/blacklist-domains.txt
```

A regex entry starts & ends with `/`, like `sed`.

### Collecting Tab Description Via AppleScript

Here's a quick script you can use to collect a description of what you were working on via applescript:

```shell
dialogResult=$(
osascript <<EOT
set dialogResult to display dialog "What were you working on yesterday?" buttons {"OK"} default button "OK" giving up after 300 default answer ""
return text returned of dialogResult
EOT
)
```

Here's a [full example](https://github.com/iloveitaly/dotfiles/blob/648010ec9a9c8f1fb0aa70be138994689f3bbfb3/.config/focus/initial_wake.sh#L42-L53) of using this with [hyper-focus](https://www.raycast.com/iloveitaly/hyper-focus).

## Debugging

You can use `ipython` to interactively play with the todoist API:

```shell
from clean_workspace import _todoist_api_key
api = TodoistAPI(_todoist_api_key())
```

## Inspiration

- <https://gist.github.com/aleks-mariusz/cc27b21f2c5b91fbd285>
- <https://github.com/tominsam/shelf-python/blob/f357d9b147fa651034b71501edabf65f59d5befa/extractors/ComAppleSafari.py#L11>

## TODO

- [ ] Indicate in python config that this is macOS only in poetry config?
- [ ] move blacklist files into example area of repo
- [x] look at previous tasks and see if links are contained there before including them again
- [ ] support google chrome canary
- [ ] check to make sure regex gdrive urls work

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/iloveitaly/clean-browser",
    "name": "clean-workspace",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "todoist, browser, productivity",
    "author": "Mike Bianco",
    "author_email": "mike@mikebian.co",
    "download_url": "https://files.pythonhosted.org/packages/25/11/5cd57f14e133be64e21dd7d33210d95762a04b36ddc052cfabcf52569eb7/clean_workspace-0.6.4.tar.gz",
    "platform": null,
    "description": "<!-- trunk-ignore-all(trufflehog/GitHubOauth2) -->\n<!-- trunk-ignore-all(markdownlint/MD041) -->\n\n[![Release Notes](https://img.shields.io/github/release/iloveitaly/clean-browser)](https://github.com/iloveitaly/clean-browser/releases)\n[![Downloads](https://static.pepy.tech/badge/clean-workspace/month)](https://pepy.tech/project/clean-workspace)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n\n# Clean Workspace: Archive Web Browser Tabs\n\nI love experimenting with productivity. One glitch I've found in my mind is I can easily\nget distracted by open tabs on my browser, especially if I'm trying to write or read something which I want to give\nmy full attention to.\n\nI've found that if I close all my tabs (similar idea to [shrinking context size](http://mikebian.co/improve-motivation-and-focus-with-small-contexts/)), I can focus better on the task at hand. However, I don't\nwant to lose any interesting tabs so I don't easily quit my browsers. It's just the little extra of cognitive energy required to add more focus that doesn't get spent.\n\nThis is utility to fix this issue. It closes all your tabs (in both Safari & Chrome), sends them to [todoist](https://mikebian.co/todoist)\nwith a specified project and optionally a label, and outputs the list to the terminal (mostly for debugging). Only unique URLs are sent to Todoist, if you have a previous \"archive task\" with a URL archived it will not be archived again.\n\nThis utility has helped my mind and made it easy for me to find interesting things I've run into in the past. I've tied this into a 'first wake' [hyper focus](https://mikebian.co/hyper-focus) script to automatically run each morning when I first open my computer.\n\n## Installation\n\n```shell\npip install clean-workspace\n```\n\n- `TODOIST_API_KEY` has to exist in your shell environment for the tool to run.\n  I recommend using [direnv](https://direnv.net/) to do this. Add your todoist token to `.envrc` and `direnv allow .`\n- Customize the url and domain blacklist\n\n## Usage\n\n```shell\n\u276f clean-workspace --help\nUsage: clean-workspace [OPTIONS]\n\nOptions:\n  --blacklist-domains PATH\n  --blacklist-urls PATH\n  --tab-description TEXT    Description for tab\n  --todoist-label TEXT      label in todoist for all created tasks  [default:\n                            web-archive]\n  --todoist-project TEXT    project in todoist for all created tasks\n                            [default: Learning]\n  --help                    Show this message and exit.\n```\n\n## Development\n\n```shell\npoetry install\npoetry run clean-workspace\n```\n\n### Regex Entries\n\nYou can use regex matches in both the url and domain blacklist files. For example, if you want to blacklist all Zoom domains, you can use the following:\n\n```shell\necho \"/.*zoom\\.us/\" >> ~/.config/clean-workspace/blacklist-domains.txt\n```\n\nA regex entry starts & ends with `/`, like `sed`.\n\n### Collecting Tab Description Via AppleScript\n\nHere's a quick script you can use to collect a description of what you were working on via applescript:\n\n```shell\ndialogResult=$(\nosascript <<EOT\nset dialogResult to display dialog \"What were you working on yesterday?\" buttons {\"OK\"} default button \"OK\" giving up after 300 default answer \"\"\nreturn text returned of dialogResult\nEOT\n)\n```\n\nHere's a [full example](https://github.com/iloveitaly/dotfiles/blob/648010ec9a9c8f1fb0aa70be138994689f3bbfb3/.config/focus/initial_wake.sh#L42-L53) of using this with [hyper-focus](https://www.raycast.com/iloveitaly/hyper-focus).\n\n## Debugging\n\nYou can use `ipython` to interactively play with the todoist API:\n\n```shell\nfrom clean_workspace import _todoist_api_key\napi = TodoistAPI(_todoist_api_key())\n```\n\n## Inspiration\n\n- <https://gist.github.com/aleks-mariusz/cc27b21f2c5b91fbd285>\n- <https://github.com/tominsam/shelf-python/blob/f357d9b147fa651034b71501edabf65f59d5befa/extractors/ComAppleSafari.py#L11>\n\n## TODO\n\n- [ ] Indicate in python config that this is macOS only in poetry config?\n- [ ] move blacklist files into example area of repo\n- [x] look at previous tasks and see if links are contained there before including them again\n- [ ] support google chrome canary\n- [ ] check to make sure regex gdrive urls work\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Collect all browser URLs, output to terminal, and archive to todoist. Useful for cleaning up your workspace at the end of the day, without loosing important urls.",
    "version": "0.6.4",
    "project_urls": {
        "Homepage": "https://github.com/iloveitaly/clean-browser"
    },
    "split_keywords": [
        "todoist",
        " browser",
        " productivity"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2aa17af73edbf4fc964b226099b969f656a9ebd4f6777a2bc60d7d771c5d93c",
                "md5": "4b2c735d218e99560d46a644ff717a41",
                "sha256": "af16405793cffb8310517c027a09a6ade99ffffa90dc0ab9632bdfd275192fa6"
            },
            "downloads": -1,
            "filename": "clean_workspace-0.6.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4b2c735d218e99560d46a644ff717a41",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 8550,
            "upload_time": "2024-03-20T11:29:36",
            "upload_time_iso_8601": "2024-03-20T11:29:36.110171Z",
            "url": "https://files.pythonhosted.org/packages/b2/aa/17af73edbf4fc964b226099b969f656a9ebd4f6777a2bc60d7d771c5d93c/clean_workspace-0.6.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25115cd57f14e133be64e21dd7d33210d95762a04b36ddc052cfabcf52569eb7",
                "md5": "0511443731a2cedeb1a3c65cd322e5c4",
                "sha256": "4677a621d825924c7d6f574bfc5f687e85687467f4d2a01bfddbb097f34e78f1"
            },
            "downloads": -1,
            "filename": "clean_workspace-0.6.4.tar.gz",
            "has_sig": false,
            "md5_digest": "0511443731a2cedeb1a3c65cd322e5c4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 7530,
            "upload_time": "2024-03-20T11:29:37",
            "upload_time_iso_8601": "2024-03-20T11:29:37.917312Z",
            "url": "https://files.pythonhosted.org/packages/25/11/5cd57f14e133be64e21dd7d33210d95762a04b36ddc052cfabcf52569eb7/clean_workspace-0.6.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-20 11:29:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iloveitaly",
    "github_project": "clean-browser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "clean-workspace"
}
        
Elapsed time: 0.20161s