{"id":28259833,"url":"https://github.com/mustafah/dream-my-plots","last_synced_at":"2026-04-13T12:31:09.694Z","repository":{"id":214985531,"uuid":"737386025","full_name":"mustafah/dream-my-plots","owner":"mustafah","description":"Create visual plots in Python with the help of text prompting popular LLMs through langchain","archived":false,"fork":false,"pushed_at":"2024-01-16T18:56:33.000Z","size":1777,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-27T22:17:15.737Z","etag":null,"topics":["ai","artificial-intelligence","automation","data-analysis","data-visualization","langchain","llms","machine-learning","plotting","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mustafah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-30T20:59:09.000Z","updated_at":"2025-04-21T11:51:22.000Z","dependencies_parsed_at":"2024-01-01T18:29:20.406Z","dependency_job_id":"ddfb3e7e-ebb9-411c-88be-2364d8eda3a5","html_url":"https://github.com/mustafah/dream-my-plots","commit_stats":null,"previous_names":["mustafah/dream-my-plots"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mustafah/dream-my-plots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafah%2Fdream-my-plots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafah%2Fdream-my-plots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafah%2Fdream-my-plots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafah%2Fdream-my-plots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustafah","download_url":"https://codeload.github.com/mustafah/dream-my-plots/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafah%2Fdream-my-plots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31753001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","automation","data-analysis","data-visualization","langchain","llms","machine-learning","plotting","python"],"created_at":"2025-05-20T03:13:09.917Z","updated_at":"2026-04-13T12:31:09.683Z","avatar_url":"https://github.com/mustafah.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\tDreamMyPlots 🌜✨🖼️\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eCreate plots with LLMs through OpenAI and langchain\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"\" src=\"https://badge.fury.io/py/dream-my-plots.svg\"/\u003e\n\u003c/p\u003e\n\n![1704128527248](https://raw.githubusercontent.com/mustafah/dream-my-plots/main/images/README/relaxed-programmer2.jpeg)\n\n# DreamMyPlots 🌜✨🖼️\n\nDreamMyPlots is a friendly utility class for anyone doing data science, who want to turn numbers and data into seaborn/matplot plots quickly, through the power of Python's graph-making skills with any popular LLM prompts (through Langchain)to make even complex charts simple to create.\n\nHere's how you can use it:\n\n1. **Provide Data** 📊: Input your DataFrame and what you'd like to visualize.\n2. **AI Assists** 🤖: It then uses AI to generate the Python plotting code based on your prompt.\n3. **Visualize** 🌟: Run the generated code to see your data transformed into a visual plot.\n\nAnd this may:\n\n* **Saves Time** ⏰: No need to write complex code from scratch. It's quicker to get your visuals ready.\n* **Boosts Creativity** 🎨: Encourages you to experiment with different types of visuals without the heavy lifting.\n* **Simplifies Learning** 📘: Makes it easier to jump into data visualization, even if you're new to data science.\n\n```python\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(np.random.rand(100), columns=['A'])\n```\n\n## **🌱 How to Begin**\n\n* 💻 Install :\n```bash\npip install dream-my-plots\n```\nor through github tags,\n```bash\npip install git+https://github.com/mustafah/dream-my-plots.git@1.0.0\n```\n\n* 🔑 Environment variables should contain your [OpenAI](https://platform.openai.com/api-keys) (or other LangChain compliant [LLM](https://python.langchain.com/docs/integrations/chat/)) [API key](https://platform.openai.com/api-keys) :\n\n```bash\n# Sample .env file\nDREAM_MY_PLOTS_LLM_API_KEY=your-key-here\n```\n\n* 📈 Create your dataframe :\n\n```python\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(np.random.rand(100, 3), columns=['A', 'B', 'C'])\n```\n\n* 🎨 Dream your plot :\n\n```python\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    Make line plots for first two columns, and first 7 rows !\n\"\"\")\n```\n\n## Examples\n\n#### Comparative Distributions of Two Class Datasets\n\n📈 Create your dataframe :\n\n```python\nimport numpy as np\n\n# Generating features for Class A \u0026 B with normal distribution\nfeatures_class_A = np.random.normal(70, 10, 100)\nfeatures_class_B = np.random.normal(80, 15, 100)\nfeatures = np.concatenate([features_class_A, features_class_B])  # Combining Class A and B features\n\nclasses = ['Class A'] * 100 + ['Class B'] * 100  # Creating labels for the classes\n\nimport pandas as pd\ndf = pd.DataFrame({'Feature': features, 'Class': classes})  # Creating DataFrame with features and class labels\n```\n\n🌟✍️ Send your prompt :\n\n```python\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    📊 Make a plot contains 6 kinds of Distribution Plots (Categorical and Continuous Distribution plots)\n    🎨 Give a large title please, fit upto 4 subplots horizontally\n\"\"\")\n```\n\n![1704134704077](images/README/two-class-datasets.gif)\n\n## 💬✨ More to say\n\n### Commenting\n\nYou use # character to comment any line in prompt, so it will be not sent to the LLM\n\n```python\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    📊 Make a plot contains 6 kinds of Distribution Plots (Categorical and Continuous Distribution plots)\n    # 🎨 Give a large title please, fit upto 4 subplots horizontally\n\"\"\")\n```\n\n### 🌑 Dark theme\n\nSet an environment with value of `DARK` or `LIGHT` for the syntax higlight\n\n```bash\nDREAM_MY_PLOTS_THEME=DARK\n```\n\nor send it as a parameter in the class\n\n```python\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    Make a scatter plot !\n\"\"\", dark=True)\n```\n\n### 🔑 API key\n\nYou can pass it directly instead of using .env files (not recommended)\n\n```python\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    Make a histogram plot !\n\"\"\", api_key=\"*****\")\n```\n\n### Errors !\n\nTry to rexecute your code, as it is or add more specifications to the prompt ... You are last error and generated code is automatically attached when you resend your prompts\n\n### 📝🔧 Custom Prompt Template (🌱 🇦lpha version)\n\n```python\nfrom langchain.prompts.prompt import PromptTemplate\ntemplate = PromptTemplate(\n    input_variables=[\"df\", \"prompt\", \"previous_code\", \"previous_error\"], template=\"your custom template content\"\n)\n\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    Make a histogram plot !\n\"\"\", prompt=\"*****\", template)\n```\n\n### 💬🔧 Custom LLM (🌱 🇦lpha version)\n\nIt's based on langchain, you can use your custom llm provider\n\n```python\nfrom langchain.chat_models import AzureChatOpenAI\n\nfrom dream_my_plots import DreamMyPlots\nDreamMyPlots(df, \"\"\"\n    Make a histogram plot !\n\"\"\", llm=AzureChatOpenAI(deployment_name=\"YOUR_DEPLOYMENT_NAME\", openai_api_version=\"2023-05-15\", openai_api_key=openai_api_key, ...))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafah%2Fdream-my-plots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustafah%2Fdream-my-plots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafah%2Fdream-my-plots/lists"}