{"id":24635080,"url":"https://github.com/baselhusam/damj","last_synced_at":"2026-02-17T04:32:43.638Z","repository":{"id":247102164,"uuid":"815650980","full_name":"baselhusam/damj","owner":"baselhusam","description":"Python Package for creating a well-defined prompts integrated with specified code snippet.","archived":false,"fork":false,"pushed_at":"2024-09-01T16:19:41.000Z","size":393,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-06T23:17:58.988Z","etag":null,"topics":["chatgpt","damj","llm","prompt","prompt-engineering","python","pythonpackage","tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baselhusam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-15T18:13:51.000Z","updated_at":"2024-09-01T16:19:45.000Z","dependencies_parsed_at":"2025-05-08T20:57:45.449Z","dependency_job_id":"dd9a40e0-3515-4f10-8354-9df61a83f62b","html_url":"https://github.com/baselhusam/damj","commit_stats":null,"previous_names":["baselhusam/damj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baselhusam/damj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baselhusam%2Fdamj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baselhusam%2Fdamj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baselhusam%2Fdamj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baselhusam%2Fdamj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baselhusam","download_url":"https://codeload.github.com/baselhusam/damj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baselhusam%2Fdamj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29533702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T03:01:11.216Z","status":"ssl_error","status_checked_at":"2026-02-17T03:00:31.803Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["chatgpt","damj","llm","prompt","prompt-engineering","python","pythonpackage","tool"],"created_at":"2025-01-25T09:14:21.400Z","updated_at":"2026-02-17T04:32:43.614Z","avatar_url":"https://github.com/baselhusam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![background](https://raw.githubusercontent.com/baselhusam/damj/main/assets/background.png)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Damj Logo\" style=\"width: 200px; max-width: 100%; height: auto;\" src=\"https://raw.githubusercontent.com/baselhusam/damj/main/assets/logo.png\"/\u003e\n  \u003ch1 align=\"center\"\u003e✨ \u003cb\u003e Damj \u003c/b\u003e ✨\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e \u003cb\u003e damj \u003c/b\u003e is a tool for creating comprehensive prompts for language models by combining project files and applying custom processing options.\n\u003c/p\u003e\n\n[![PyPI](https://img.shields.io/pypi/v/damj)](https://pypi.org/project/damj/)\n\u003c!-- [![Downloads](https://static.pepy.tech/badge/damj)](https://pepy.tech/project/damj) --\u003e\n\n\n## Introduction\n`damj` is designed to help developers create effective prompts for large language models (LLMs) such as ChatGPT. By combining different project files and applying customizable processing options, `damj` simplifies the process of generating prompts tailored to specific project contexts.\n\n## Features\n- Combine multiple project files into a single prompt.\n- Apply customizable processing options to include/exclude comments, imports, and docstrings for python scripts.\n- Support for processing Jupyter notebooks and including cell outputs.\n- Easy integration and usage within Python projects.\n\n## Installation\n\n### From PyPI\nYou can install the latest release from PyPI:\n```sh\npip install damj\n```\n\n### From Source\n```sh\ngit clone https://github.com/baselhusam/damj.git\ncd damj\npip install .\n```\n\n## Usage\n\n### Basic Example\n\n```python\nimport os\nfrom damj import Damj\n\ncwd = os.getcwd()\ndamj = Damj(cwd)\n\ndamj.project_info(\n    project_overview=\"This is a sample project.\",\n    add_project_structure=True,\n)\n\nprompt = damj.create_prompt(\n    question=\"What is the purpose of this project?\",\n)\n\nprint(prompt)\n```\n\nOutput:\n```\n# Project Overview\nThis is a sample project.\n\n\n# Project Structure\n|   ├── LICENSE\n|   ├── README.md\n|   ├── pyproject.toml\n|   ├── requirements.txt\n├── assets/\n|   ├── background.png\n|   ├── logo.png\n├── damj/\n|   ├── __init__.py\n|   ├── damj.py\n|   ├── utils.py\n\n\n\n# Question\nWhat is the purpose of this project?\n```\n\n### Another Detailed Exmaple\n```python\nimport os\nfrom damj import Damj\n\ncwd = os.getcwd()\n\ndamj = Damj(\n    cwd=cwd,\n    whitelist_files=[\"*.py\"],\n    blacklist_files=[\".venv\", \"__pycache__\"],\n    snippet_marker=\"```\"\n)\n\ndamj.project_info(\n    project_overview=\"This is a sample project.\",\n    add_project_structure=True,\n    add_files_content=True,\n    py_options={\n        \"add_imports\": True,\n        \"add_comments\": True,\n        \"add_docstrings\": False,\n        \"ipynb_output\": False\n    }\n)\n\nprompt = damj.create_prompt(\n    question=\"What is the purpose of this project?\",\n    copy_to_clipboard=True,\n    to_markdown=False\n)\n\nprint(prompt)\n```\n\n### Use damj Utils Components\ndamj also provides several utility functions that can be used independently. These utilities include functions to get the project structure, get file content, and more.\n\n#### Get Project Structure\nThe `get_project_structure` function generates a markdown representation of the directory structure, excluding blacklisted files and directories.\n\n```python\nfrom damj.utils import get_project_structure\n\n# Get the project structure excluding .venv and __pycache__ directories\ncwd = os.getcwd()\nblacklist = [\".venv\", \"__pycache__\"]\nproject_structure = get_project_structure(cwd, blacklist)\nprint(project_structure)\n```\n\n#### Get File Content\nThe `get_file_content` function retrieves the content of a file, applying the specified `py_options`.\n\n```python\nfrom damj.utils import get_file_content\n\npy_options = {\n    \"add_comments\": True,\n    \"add_imports\": True,\n    \"add_docstrings\": False,\n    \"ipynb_output\": False\n}\n\n# Get the content of a Python file with the specified options\nfile_content = get_file_content(\"example.py\", py_options)\nprint(file_content)\n```\n\n\u003cbr\u003e\n\n## License\nThis project is licensed under the Apache Software License. See the LICENSE file for details.\n\n\u003cbr\u003e\n\n## Contributors\nBasel Mather (baselmathar@gmail.com)\n\n\u003cbr\u003e\n\n## Contributing\nContributions are welcome! Please fork the repository and open a pull request with your changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaselhusam%2Fdamj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaselhusam%2Fdamj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaselhusam%2Fdamj/lists"}