diff --git a/CLAUDE.md b/CLAUDE.md index 0a76752..d9d929a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -18,7 +18,7 @@ RewindMCP is a Python library that interfaces with the Rewind.ai SQLite database pip install -e . # Install dependencies -pip install pysqlcipher3 pydantic requests python-dotenv "mcp>=0.1.0" +pip install sqlcipher3 pydantic requests python-dotenv "mcp>=0.1.0" tabulate ``` ### Testing diff --git a/README-MCP-STDIO.md b/README-MCP-STDIO.md index 6782a90..74e7780 100644 --- a/README-MCP-STDIO.md +++ b/README-MCP-STDIO.md @@ -28,7 +28,7 @@ The server implements the MCP specification with proper JSON-RPC 2.0 protocol ov 1. Install the required dependencies: ```bash -pip install "mcp>=0.1.0" pysqlcipher3 python-dotenv +pip install "mcp>=0.1.0" sqlcipher3 python-dotenv tabulate ``` 2. Set up your RewindDB configuration in a `.env` file: diff --git a/README.md b/README.md index 386eb66..3826663 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The main purpose of this project, for me, was to connect Rewind to my Raycast: ```bash # clone the repository -git clone https://github.com/yourusername/RewindMCP.git +git clone https://github.com/pedramamini/RewindMCP.git cd RewindMCP # install the package and dependencies @@ -149,7 +149,8 @@ python transcript_cli.py --export-own-voice "2025-01-01 to 2025-07-04" --export- # export actual audio files organized by day python transcript_cli.py --export-own-voice "2025-01-01 to 2025-07-04" --export-format audio --audio-export-dir ./my_voice_audio -# generate word cloud from your voice data (requires wordcloud command) +# generate word cloud from your voice data (requires wordcloud library) +pip install wordcloud matplotlib # install dependencies ./my-words.sh # automatically uses last 6 months of your voice data ``` @@ -530,7 +531,7 @@ Key relationships: ```bash # clone the repository -git clone https://github.com/yourusername/RewindMCP.git +git clone https://github.com/pedramamini/RewindMCP.git cd RewindMCP # install in development mode diff --git a/my-words.sh b/my-words.sh new file mode 100644 index 0000000..30c7415 --- /dev/null +++ b/my-words.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# +# my-words.sh - Generate word cloud from your voice data +# +# This script uses the transcript_cli.py to export your voice transcripts +# from the last 6 months and generates a word cloud visualization. +# +# Requirements: +# - wordcloud Python library: pip install wordcloud +# - transcript_cli.py in the same directory +# +# Usage: +# ./my-words.sh +# + +set -e + +# Configuration +MONTHS_BACK=6 +OUTPUT_FILE="my_words.png" +TEMP_FILE="/tmp/my_voice_data.txt" + +# Calculate date range (6 months ago to today) +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS + START_DATE=$(date -v-${MONTHS_BACK}m +"%Y-%m-%d") +else + # Linux + START_DATE=$(date -d "${MONTHS_BACK} months ago" +"%Y-%m-%d") +fi +END_DATE=$(date +"%Y-%m-%d") + +echo "Generating word cloud from your voice data..." +echo "Date range: $START_DATE to $END_DATE" + +# Export voice data using transcript_cli.py +echo "Exporting your voice transcripts..." +python transcript_cli.py --export-own-voice "$START_DATE to $END_DATE" --export-format text > "$TEMP_FILE" + +# Check if we got any data +if [ ! -s "$TEMP_FILE" ]; then + echo "No voice data found for the specified time period." + echo "Make sure Rewind.ai has been recording audio and you have spoken during this time." + rm -f "$TEMP_FILE" + exit 1 +fi + +# Generate word cloud +echo "Generating word cloud..." +python3 -c " +import sys +from wordcloud import WordCloud +import matplotlib.pyplot as plt + +# Read the text data +with open('$TEMP_FILE', 'r') as f: + text = f.read() + +if not text.strip(): + print('No text data found.') + sys.exit(1) + +# Generate word cloud +wordcloud = WordCloud( + width=800, + height=400, + background_color='white', + max_words=100, + colormap='viridis' +).generate(text) + +# Save as image +plt.figure(figsize=(10, 5)) +plt.imshow(wordcloud, interpolation='bilinear') +plt.axis('off') +plt.title('My Words - Last $MONTHS_BACK Months of Voice Data') +plt.tight_layout() +plt.savefig('$OUTPUT_FILE', dpi=300, bbox_inches='tight') +print(f'Word cloud saved as $OUTPUT_FILE') +" + +# Clean up +rm -f "$TEMP_FILE" + +echo "Done! Word cloud saved as $OUTPUT_FILE" +echo "To view: open $OUTPUT_FILE (macOS) or xdg-open $OUTPUT_FILE (Linux)" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1bb6e90..d042039 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Core dependencies for RewindMCP # Database and encryption -pysqlcipher3 +sqlcipher3 # Data validation and serialization pydantic diff --git a/setup.py b/setup.py index db4cf2a..7e41c46 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ description="a python library for interfacing with the rewind.ai sqlite database", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/pedram/rewinddb", + url="https://github.com/pedramamini/RewindMCP", packages=setuptools.find_packages(), classifiers=[ "programming language :: python :: 3", @@ -29,6 +29,6 @@ "requests", "python-dotenv", "mcp>=0.1.0", - "tabulate", + "tabulate", ], )