{"id":19445180,"url":"https://github.com/mmatongo/chew","last_synced_at":"2025-04-14T20:42:53.430Z","repository":{"id":247534569,"uuid":"825769594","full_name":"mmatongo/chew","owner":"mmatongo","description":"Chew is a Go library for processing various content types into markdown/plaintext.","archived":false,"fork":false,"pushed_at":"2025-02-16T12:31:54.000Z","size":1598,"stargazers_count":41,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"v1","last_synced_at":"2025-03-28T08:51:18.266Z","etag":null,"topics":["go","golang","llm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmatongo.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}},"created_at":"2024-07-08T13:11:09.000Z","updated_at":"2025-02-25T03:18:40.000Z","dependencies_parsed_at":"2024-07-09T08:43:24.222Z","dependency_job_id":"c413e4f4-3e29-4625-933a-11410eec889b","html_url":"https://github.com/mmatongo/chew","commit_stats":null,"previous_names":["mmatongo/chew"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmatongo%2Fchew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmatongo%2Fchew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmatongo%2Fchew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmatongo%2Fchew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmatongo","download_url":"https://codeload.github.com/mmatongo/chew/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248960049,"owners_count":21189978,"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":["go","golang","llm"],"created_at":"2024-11-10T16:09:36.982Z","updated_at":"2025-04-14T20:42:53.393Z","avatar_url":"https://github.com/mmatongo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg\n    width=40%\n    src=\"https://raw.githubusercontent.com/mmatongo/chew/master/assets/gopher-eating.svg\"\n    alt=\"chew logo\"\n/\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/mmatongo/chew)](https://goreportcard.com/report/github.com/mmatongo/chew)\n[![GoDoc](https://godoc.org/github.com/mmatongo/chew?status.svg)](https://pkg.go.dev/github.com/mmatongo/chew)\n[![Maintainability](https://api.codeclimate.com/v1/badges/441cfd36f310c0c48878/maintainability)](https://codeclimate.com/github/mmatongo/chew/maintainability)\n[![codecov](https://codecov.io/github/mmatongo/chew/graph/badge.svg?token=6OOK91QQRC)](https://codecov.io/github/mmatongo/chew)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\u003c/div\u003e\n\n\u003e \u003cp align=\"center\"\u003eA Go library for processing various content types into markdown/plaintext..\u003c/p\u003e\n\n## About \u003ca id=\"about\"\u003e\u003c/a\u003e\n\n*Chew* is a Go library that processes various content types into markdown or plaintext. It supports multiple content types, including HTML, PDF, CSV, JSON, YAML, DOCX, PPTX, Markdown, Plaintext, MP3, FLAC, and WAVE.\n\n## Installation \u003ca id=\"installation\"\u003e\u003c/a\u003e\n\n```bash\ngo get github.com/mmatongo/chew\n```\n\n## Usage \u003ca id=\"usage\"\u003e\u003c/a\u003e\n\nHere's a basic example of how to use Chew:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/mmatongo/chew/v1\"\n)\n\nfunc main() {\n\turls := []string{\n\t\t\"https://example.com\",\n\t}\n\n\tconfig := chew.Config{\n\t\tUserAgent:       \"Chew/1.0 (+https://github.com/mmatongo/chew)\",\n\t\tRetryLimit:      3,\n\t\tRetryDelay:      5 * time.Second,\n\t\tCrawlDelay:      10 * time.Second,\n\t\tProxyList:       []string{}, // Add your proxies here, or leave empty\n\t\tRateLimit:       2 * time.Second,\n\t\tRateBurst:       3,\n\t\tIgnoreRobotsTxt: false,\n\t}\n\n\thaChew := chew.New(config)\n\n\t// The context is optional, but can be used to cancel the operation after a certain time\n\tctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\n\tdefer cancel()\n\n\tchunks, err := haChew.Process(ctx, urls)\n\tif err != nil {\n\t\tif err == context.DeadlineExceeded {\n\t\t\tlog.Println(\"Operation timed out\")\n\t\t} else {\n\t\t\tlog.Printf(\"Error processing URLs: %v\", err)\n\t\t}\n\t\treturn\n\t}\n\n\tfor _, chunk := range chunks {\n\t\tfmt.Printf(\"Source: %s\\nContent: %s\\n\\n\", chunk.Source, chunk.Content)\n\t}\n}\n```\n\nOutput\n\n```bash\nSource: https://example.com\nContent: Example Domain\n\nSource: https://example.com\nContent: This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.\n\nSource: https://example.com\nContent: More information...\n```\n\nYou can find more examples in the [examples](./examples) directory as well as instructions on how to use Chew with Ruby and Python.\n\n## Contributing \u003ca id=\"contributing\"\u003e\u003c/a\u003e\n\nContributions are welcome! Feel free to open an issue or submit a pull request if you have any suggestions or improvements.\n\n## License \u003ca id=\"license\"\u003e\u003c/a\u003e\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\n### Logo \u003ca id=\"logo\"\u003e\u003c/a\u003e\n\nThe [logo](https://github.com/MariaLetta/free-gophers-pack) was made by the amazing [MariaLetta](https://github.com/MariaLetta).\n\n\n### Similar Projects \u003ca id=\"similar_projects\"\u003e\u003c/a\u003e\n[docconv](https://github.com/sajari/docconv)\n\n### Roadmap \u003ca id=\"roadmap\"\u003e\u003c/a\u003e\nThe roadmap for this project is available [here](./TODO.md). It's meant more as a guide than a strict plan because I only work on this project in my free time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmatongo%2Fchew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmatongo%2Fchew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmatongo%2Fchew/lists"}