This Python project provides a simple tool to easily manage your subscription. It consists of two main scripts:
main.py
: Handles the logic for managing subscription data and sending notifications.cli.py
: Provides a command-line interface to interact with the subscription management functions.
- Python 3.6 or higher
- macOS (due to the usage of AppleScript for notifications)
- Add Subscriptions: Allows users to add subscriptions with expiration dates.
- Delete Subscriptions: Allows users to delete an existing subscription.
- List Subscriptions: Displays all tracked subscriptions and their expiration dates.
- Automatic Notifications: Sends notifications when a subscription is about to expire (one day and two hours before the expiration).
To run this project, follow these steps:
-
Clone the repository to where you want the project to stay:
git clone https://github.com/GhoulKingR/subscription-tracker.git cd subscription-tracker
-
Install its dependencies:
pip3 install -r requirements.txt
-
Ensure
osascript
is available: This project uses AppleScript for sending notifications, which should be available by default on all macOS systems.
To automate the subscription checks, you can add a cron
job that runs the script regularly:
- Open the
cron
editor:
crontab -e
- Add a cron job to run the script every hour:
0 * * * * /usr/bin/python3 /path/to/subscription-tracker/main.py
No additional configuration is required.
There are two ways to update your copy of the project.
- With git pull:
git pull
- With the --update flag: (may not be available on your version)
python3 cli.py --update
You can interact with the subscription tracker using the command-line interface provided by cli.py
.
To add a new subscription, use the following command:
python3 cli.py --add "Service Name" "YYYY-MM-DD HH:MM"
Example:
python3 cli.py --add Netflix "2024-07-01 19:00"
To delete an existing subscription, use the following command:
python cli.py --delete "Service Name"
Example:
python cli.py --delete "Netflix"
To list all subscriptions, use:
python3 cli.py --list
To check for expiring subscriptions and send notifications, you can run:
python3 cli.py
It's recommended to schedule this script to run at regular intervals using a scheduler like cron
or launchd
.
Contributions to this project are welcome. You can contribute by improving the scripts, adding new features, requesting new features, or reporting bugs.