Skip to content

Commit

Permalink
major refactor, and packaged it to be installed with pip
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-chs committed Nov 4, 2023
1 parent a0554bb commit 41d98b2
Show file tree
Hide file tree
Showing 82 changed files with 1,853 additions and 1,950 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
__pycache__/
node_modules/
.venv*/
.venv/
dist/

poetry.lock

# testing models and visualizations on personal data
data/
Expand Down
6 changes: 1 addition & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"recommendations": [
"usernamehw.errorlens",
"njqdev.vscode-python-typehint",
"ms-python.python",
"ms-toolsai.jupyter",
"charliermarsh.ruff",
"matangover.mypy",
"njpwerner.autodocstring"
]
}
}
24 changes: 7 additions & 17 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"editor.inlayHints.enabled": "onUnlessPressed",
"editor.inlayHints.padding": true,
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.pytestParameters": true,
"python.analysis.inlayHints.variableTypes": true,
"python.analysis.inlayHints.callArgumentNames": "partial",
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"workbench.startupEditor": "readme",
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"mypy.runUsingActiveInterpreter": true,
"black-formatter.importStrategy": "fromEnvironment",
"python.createEnvironment.contentButton": "show",
"python.createEnvironment.trigger": "prompt"
"editor.inlayHints.enabled": "onUnlessPressed",
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.pytestParameters": true,
"python.analysis.inlayHints.variableTypes": true,
"python.analysis.inlayHints.callArgumentNames": "partial",
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestEnabled": true
}
121 changes: 0 additions & 121 deletions CONTRIBUTING.md

This file was deleted.

87 changes: 17 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Your entire ChatGPT data in beautiful Markdown 📜
# Convoviz 📊: Visualize your entire ChatGPT data !

Convert your ChatGPT history into well-formatted Markdown files. Additionally, visualize your data with word clouds 🔡☁️, view your prompt history graphs 📈, and access all your custom instructions 🤖 in a single location.

Expand All @@ -13,86 +13,37 @@ Convert your ChatGPT history into well-formatted Markdown files. Additionally, v
- **Data Visualizations**: Word clouds, graphs, and more.
- **Custom Instructions**: All your custom instructions in one JSON file.

See examples [here](assets/demo).
See examples [here](demo).

## Getting Started

Ensure you have **Python** and **Git** installed. If not:

- [Python](https://www.python.org/downloads/)
- [Git](https://git-scm.com/downloads)
## How to Use 📖

### 1. Export Your ChatGPT Data 🗂

- Sign in at [chat.openai.com](https://chat.openai.com).
- Navigate: Profile Name (bottom left) -> **Settings** -> **Data controls** -> **Export** -> **Confirm export**.
- Await email from OpenAI and download the `.zip` file.

### 2. Copy the Tool to Your Computer 📥

- Open a program called "terminal" or "command prompt".

- Type (and hit enter after each line):

```bash
git clone https://github.com/mohamed-chs/chatgpt-history-export-to-md.git
```

```bash
cd chatgpt-history-export-to-md
```

This will copy this GitHub repository on your computer, and navigate to the root directory.

### 3. Set Up the Environment 🛠️

Type (and hit enter):

```bash
python setup_env.py
```

This will create a virtual environment and install the necessary python libraries.
### 2. Install the tool 🛠

#### Activate the virtual environment

**On Linux or MacOS:**
Open a terminal or command prompt and run:

```bash
source .venv/bin/activate
pip install convoviz
```

**On Windows:**

Using Command Prompt (`cmd.exe`):

```bash
.venv\Scripts\activate.bat
```
to install the package.

Using PowerShell:
### 3. Run the Script 🏃‍♂️

```powershell
.venv\Scripts\Activate.ps1
```

If you encounter an error about script execution in PowerShell, try running:

```powershell
powershell -ExecutionPolicy ByPass -File .venv\Scripts\Activate.ps1
```

### 4. Run the Script 🏃‍♂️

With the environment set up, you can now run the script. In the terminal or command prompt, execute:
With the package installed, run the following command in your terminal:

```bash
python cli.py
python -m convoviz
```

Now, follow the instructions on screen and choose your desired options, the script will handle the rest.
Next, follow the instructions displayed and choose your desired options, the script will handle the rest.

### 5. Check the Output 🎉
### 4. Check the Output 🎉

And that's it! After running the script, head over to the output folder to see your nice word clouds, graphs, and neatly formatted Markdown files. Enjoy !

Expand Down Expand Up @@ -120,14 +71,6 @@ And if you've had a great experience, consider giving the project a star ⭐. It

Thank you for being awesome! 🌟

## Contributions 🆘

Feel free to fork this repository and make your enhancements or improvements. ALL contributions are welcome !

See [contributing guide](CONTRIBUTING.md)

> [Related post](https://news.ycombinator.com/item?id=37636701)
## Notes

This project requires Python 3.8.7 or higher if on Windows. See [known issue](https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1023#issue-534396318)
Expand All @@ -136,6 +79,10 @@ This is just a small thing I coded to help me see my convos in beautiful markdow

I wasn't a fan of the clunky, and sometimes paid, browser extensions.

It was also a great opportunity to learn more about Python and type annotations. I had mypy, pyright, and ruff all on strict mode, 'twas fun.

It also works as package, so you can **import** it in your own projects, and use the models and functions as you wish. I need to add more documentation for that tho. Feel free to reach out if you need help.

I'm working on automating it to add new conversations and updating old ones. Had some luck with a JavaScript bookmarklet, still ironing it out tho. Shouldn't take long.

> for an older version with no external dependencies (no virtual environment needed), see https://github.com/mohamed-chs/chatgpt-history-export-to-md/tree/fe13a701fe8653c9f946b1e12979ce3bfe7104b8.
> for an older version with zero dependencies, see https://github.com/mohamed-chs/chatgpt-history-export-to-md/tree/fe13a701fe8653c9f946b1e12979ce3bfe7104b8.
Binary file removed assets/deps_graph.png
Binary file not shown.
Loading

0 comments on commit 41d98b2

Please sign in to comment.