{"id":17789516,"url":"https://github.com/benderscript/dlprompter","last_synced_at":"2025-04-02T00:45:43.067Z","repository":{"id":217827900,"uuid":"744845153","full_name":"BenderScript/DLPrompter","owner":"BenderScript","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-19T23:44:16.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T16:28:48.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/BenderScript.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}},"created_at":"2024-01-18T05:51:01.000Z","updated_at":"2024-02-06T15:43:17.000Z","dependencies_parsed_at":"2024-01-20T00:31:04.848Z","dependency_job_id":"f3d3c4ea-78a1-4474-9cfd-4229ce452410","html_url":"https://github.com/BenderScript/DLPrompter","commit_stats":null,"previous_names":["benderscript/dlprompter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2FDLPrompter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2FDLPrompter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2FDLPrompter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2FDLPrompter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenderScript","download_url":"https://codeload.github.com/BenderScript/DLPrompter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246735363,"owners_count":20825224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-27T10:32:58.413Z","updated_at":"2025-04-02T00:45:43.040Z","avatar_url":"https://github.com/BenderScript.png","language":"Python","readme":"# GenAI DLP Prompt Generator\n\nGenAI DLP Prompt Generator is a Python tool designed to scrape DLP data and use it to generate GenAI prompt. It has three main modules:\n\n* It fetches DLP test sample data from specified URLs, saves the data in text format, and then converts these text files into PDFs. \n* It uses an OpenAI Assistant to generate DLP mock data \n* It uses OpenAI Chat Completions to generate prompts for each DLP category\n\n\nThe output is suitable for benchmarking DLP systems or Generative AI Language Learning Models (GenAI LLMs).\n\n## Features\n\n- Web scraping from specified URLs.\n- Data extraction and saving in text format.\n- Conversion of text data to PDF format, ideal for benchmarking DLP systems or GenAI LLMs.\n\n## Installing\n\nTo install DLP Data Scraper, clone the repository and install the required packages:\n\n```bash\ngit clone https://github.com/BenderScript/DLPDataScraper.git\ncd DLPDataScraper/dlp_data_scraper\npip3 install -r requirements.txt\n```\n\n## Usage\n\nMake sure you have a OpenAI API key and set it as an environment variable:\n\n```bash\nexport OPENAI_API_KEY=\u003cyour key here\u003e\n```\n\nThe file with DLP categories currently under `tests/dlp_categories.md`. Need to be copies to a new location \nand the path passed to the `OpenAIDLPAssistant` or `OpenAIChat` classes.\n\n# To use the DLP Data Scraper:\n\nThe scraper access a URL with dynamic content, waits for it to load and extracts all DLP categories\n\n```python\nfrom dlp_data_scraper.umbrella import Umbrella\nfrom file_utils.FileUtils import FileUtils\n\npdf_data = \"umbrella/pdf_data\"\ntext_data = \"umbrella/text_data\"\nfile_utils = FileUtils()\nurl = (\n    'https://support.umbrella.com/hc/en-us/articles/4402023980692-Data-Loss-Prevention-DLP-Test-Sample-Data-for'\n    '-Built-In-Data-Identifiers')\nscraper = Umbrella(url=url, text_data=text_data, pdf_data=pdf_data)\nhtml_content = scraper.initialize_browser()\nscraped_data = scraper.scrape_data()\nscraper.save_data_to_files()\nfile_utils.convert_txt_to_pdf(text_data, pdf_data)\nprint(\"Scraping and conversion to PDF completed.\")\n```\n\nAfter the run is over, the generated data under the `umbrella/text_data` \nand `umbrella/pdf_data` directory. There will be one file for each DLP category.\n\n# To use the OpenAI Chat DLP Prompt generator:\n\n```python\n\nfrom prompt_gen.openai_chat import OpenAIChat\n\n\n# Initialize the Assistant class\nchat_gen = OpenAIChat(text_data=\"openai_chat_prompt/text_data\",\n                          pdf_data=\"openai_chat_prompt/pdf_data\",\n                          dlp_categories_file=\"dlp/dlp_categories.md\")\n\nchat_gen.run()\n\n```\n\nAfter the run is over there will 90+ LLM Prompts based on the DLP categories. \nThe generated data will be under the `openai_chat_prompt/text_data` and \n`openai_chat_prompt/pdf_data` directories. \n\n\n# To use the OpenAI Assistant DLP generator:\n\n```python\nfrom dlp_data_gen.openai_dlp_assistant import OpenAIDLPAssistant\n\ndlp_gen_assistant = OpenAIDLPAssistant(text_data=\"openai_dlp/text_data\", pdf_data=\"openai_dlp/pdf_data\",\n                                           dlp_categories_file=\"dlp/dlp_categories.md\")\ndlp_gen_assistant.run()\n```\n\nAfter the run is over, the generated data will be under the `openai_dlp/text_data` \nand `openai_dlp/pdf_data` directory. There will be a single file with mock DLP data for\neach category.\n\n# To use the OpenAI DLP Prompt Generator \n\n```python\nfrom prompt_gen.openai_chat import OpenAIChat\n\nchat_gen = OpenAIChat(text_data=\"openai_chat_prompt/text_data\",\n                          pdf_data=\"openai_chat_prompt/pdf_data\",\n                          dlp_categories_file=\"dlp/dlp_categories.md\")\n\nchat_gen.run()\n```\n\n## Contributing\n\nContributions to DLP Data Scraper are welcome. Please feel free to submit pull requests or open issues to improve the project.\n\n---\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenderscript%2Fdlprompter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenderscript%2Fdlprompter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenderscript%2Fdlprompter/lists"}