Skip to main content

Be Productive

A tool that let's you focus on your work by blocking distracting websites. Optionally with a timer for work sessions, using the Pomodoro technique.

Install

To install Be Productive: pip install beproductive

If you use Windows, it's recommended to pip install win10toast for nice Windows notifications.

You don't have to install win10toast, but without it you will not get visible and audible notifications for Pomodoro. However, all notifications are also printed in your command line interface.

How to Use

Windows

You have to open your command line tool with administrator privileges.

Linux (and MacOS?)

You have to run Be Productive with root privileges, either with sudo before every command or once with su.

Block / Unblock Websites

Block websites:

python -m beproductive

Block websites for x minutes:

python -m beproductive block --time 45

Unblock all websites:

python -m beproductive unblock

Start a Pomodoro session:

python -m beproductive pomodoro

Pomodoro

The Pomodoro feature blocks your defined websites for 25 minutes. It notifies you to take a break and gives you access to all websites for 5 minutes. Although I recommend getting up and stretching instead :) This cycle is repeated 4 times.

You can customize Pomodoros. This is how you run 5 Pomodoros of 45 minutes with 10 minute breaks:

python -m beproductive pomodoro --time 45 --breaktime 10 --pomodoros 5
python -m beproductive pomodoro -t 45 -b 10 -p 5

Blocked Websites

These websites are blocked per default, but you can add and remove websites easily. You can view all blocked websites with this command:

python -m beproductive [--list/-l]
twitter.com
youtube.com
facebook.com
instagram.com
reddit.com
netflix.com
amazon.com
linkedin.com

Customizing Blocklist

To add websites to the blocklist:

python -m beproductive [--add/-a] quora.com wired.com

To remove websites from blocklist:

python -m beproductive [--remove/-r] quora.com wired.com

Batch files

For quick access:

  1. Create batch files for the commands you need.
  2. Add a shortcut to each batch file to your desktop.
  3. Right click on the shortcut
  4. In the Shortcut tab, click Advanced
  5. Check the Run as Administrator box
  6. You can even add a key binding.

I used:

  • Ctrl + Alt + B to block all sites for 1 hour
  • Ctrl + Alt + U to unblock all sites
  • Ctrl + Alt + P to run a Pomodoro set

Example for a batch file block.bat: python -m beproductive block 60

Behind the Scenes

The script blocks URLs by modifying the hosts file. Blocked URLs are redirected to 127.0.0.1. The script backs up the original hosts file. You will not lose any customizations and you can always reset to the original state.

Roadmap

  • Notifications for Linux (https://pypi.org/project/notify2/) and Mac (?)
  • Improve architecture, maybe use threads instead of sleep()
  • Set up a schedule, i.e., block websites between 9am and 5pm

Metadata

Release files for beproductive 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beproductive 0.2.5
File Size Uploaded
beproductive-0.2.5.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beproductive 0.2.5
File Interpreter ABI Platform
beproductive-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / beproductive-0.2.5.tar.gz

Download URL beproductive-0.2.5.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9cbbd486d48b6e255e649950a55ec376b61a803626db8d7a5bc1051e749182d0
BLAKE2b-256 checksum
How to use checksums
758d993fe6d2bb02083b1f3505ed66fbaca5de78cd34366b14b5e774af688e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release files / beproductive-0.2.5-py3-none-any.whl

Download URL beproductive-0.2.5-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5bdad2fce389b7ca1940bee0144beaf3137fa710aa844cad4fce8e0cbbc4170
BLAKE2b-256 checksum
How to use checksums
ace578c8ebef92fba4a3caaf3405215b92e20d39190a1408eca75523e39f2496
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page