{"id":15527930,"url":"https://github.com/fummicc1/csv2img","last_synced_at":"2025-04-06T13:12:26.084Z","repository":{"id":37486497,"uuid":"499437806","full_name":"fummicc1/csv2img","owner":"fummicc1","description":"csv to image / pdf converter written in Swift","archived":false,"fork":false,"pushed_at":"2024-11-06T20:40:37.000Z","size":82974,"stargazers_count":97,"open_issues_count":12,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T12:09:02.070Z","etag":null,"topics":["converter","csv","image","ios","macos","pdf","png","public","swift"],"latest_commit_sha":null,"homepage":"https://fummicc1.github.io/csv2img/","language":"Swift","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/fummicc1.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":"2022-06-03T08:34:08.000Z","updated_at":"2025-03-26T01:50:01.000Z","dependencies_parsed_at":"2023-12-05T18:43:29.122Z","dependency_job_id":"b4827cd0-c72e-46be-ac89-1fab5a8d7954","html_url":"https://github.com/fummicc1/csv2img","commit_stats":{"total_commits":265,"total_committers":4,"mean_commits":66.25,"dds":0.01132075471698113,"last_synced_commit":"5a4e7f1a634c7d25df5b030fa2e2ff365e8ab537"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fummicc1%2Fcsv2img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fummicc1%2Fcsv2img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fummicc1%2Fcsv2img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fummicc1%2Fcsv2img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fummicc1","download_url":"https://codeload.github.com/fummicc1/csv2img/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485290,"owners_count":20946398,"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":["converter","csv","image","ios","macos","pdf","png","public","swift"],"created_at":"2024-10-02T11:09:56.229Z","updated_at":"2025-04-06T13:12:26.065Z","avatar_url":"https://github.com/fummicc1.png","language":"Swift","readme":"![Csv2mg_bg](https://user-images.githubusercontent.com/44002126/173288309-81e336d2-5239-441a-bc6e-2b58bb9da349.png)\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffummicc1%2Fcsv2img%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/fummicc1/csv2img) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffummicc1%2Fcsv2img%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/fummicc1/csv2img) \u003cimg src=\"https://github.com/fummicc1/csv2img/actions/workflows/lib.yml/badge.svg\"\u003e \u003cimg src=\"https://github.com/fummicc1/csv2img/actions/workflows/builder.yml/badge.svg\"\u003e \u003cimg src=\"https://github.com/fummicc1/csv2img/actions/workflows/command.yml/badge.svg\"\u003e\n\n# Csv2ImageApp\n\nConvert Csv into png image.\n\n\u003ca href=\"https://apps.apple.com/jp/app/csv-converter-app/id1628273936?mt=12\"\u003e\u003cimg src=\"https://raw.github.com/fummicc1/csv2img/1.9.0/res/Download_on_the_App_Store_Badge_US-UK_RGB_blk_092917.svg?sanitize=true\"\u003e\u003c/a\u003e\n\n## Demo\n\n### iOS App\n\nhttps://github.com/user-attachments/assets/a9a7847e-7edc-4e28-b918-66de4b992aa3\n\n### MacOS App\n\nhttps://github.com/user-attachments/assets/9b6f5064-ab6e-4897-a0ab-cf5f104e3bbe\n\n# Installation\n\nAdd the following to your `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/fummicc1/csv2img.git\", from: \"1.9.1\"),\n```\n\n# Csv2ImgCore (Library)\n\nConvert Csv into png image.\n\n- [documentation](https://fummicc1.github.io/csv2img/documentation/csv2imgcore/)\n\n## Installation of Csv2Img\n\nAdd the following to your `Package.swift` file:\n\n```swift\n.product(name: \"Csv2Img\", package: \"csv2img\"),\n```\n\n## Usage of Csv2Img\n\nYou cloud convert csv into image / pdf in 3 ways.\n\n1. Via raw `String`.\n\n```swift\n let rawCsv = \"\"\"\n a,b,c\n 1,2,3\n 4,5,6\n 7,8,9\n 10,11,12\n \"\"\"\nlet csv = Csv.loadFromString(rawCsv)\nlet image = try await csv.generate(exportType: .png)\n Output:\n | a  | b  | c  |\n | 1  | 2  | 3  |\n | 4  | 5  | 6  |\n | 7  | 8  | 9  |\n | 10 | 11 | 12 |\n```\n\n2. Via Local file.\n\n```swift\n let rawCsv = \"\"\"\n a,b,c\n 1,2,3\n 4,5,6\n 7,8,9\n 10,11,12\n \"\"\"\nlet url = URL(\n    fileURLWithPath: \"/Users/fumiyatanaka/Downloads/sample.csv\"\n)\nrawCsv.data(using: .utf8)?.write(to: url)\n// ----- ↑Just prepared for explanation. -----\nlet csv = Csv.loadFromDisk(url)\nlet data = try await csv.generate(fontSize: 12, exportType: .png)\n Output:\n | a  | b  | c  |\n | 1  | 2  | 3  |\n | 4  | 5  | 6  |\n | 7  | 8  | 9  |\n | 10 | 11 | 12 |\n```\n\n3. Via network resource\n\n```swift\nlet rawCsv = \"\"\"\n a,b,c\n 1,2,3\n 4,5,6\n 7,8,9\n 10,11,12\n \"\"\"\nlet url = URL(\n    string: \"https://raw.githubusercontent.com/fummicc1/csv2img/main/Fixtures/sample_1.csv\"\n)\n// ----- ↑Just prepared for explanation. -----\nlet csv = Csv.loadFromNetwork(url)\nlet data = try await csv.generate(fontSize: 12, exportType: .png)\n Output:\n | a  | b  | c  |\n | 1  | 2  | 3  |\n | 4  | 5  | 6  |\n | 7  | 8  | 9  |\n | 10 | 11 | 12 |\n```\n\n### Output Image\n\n![sample](https://user-images.githubusercontent.com/44002126/186811765-ecc16ca5-9121-47ee-a5a6-a51ac181abd5.png)\n\n# CsvBuilder (Helper Library for Csv2Img)\n\nA helper library to generate `Csv` in Csv2Img library.\n\n## Installation of CsvBuilder\n\nAdd the following to your `Package.swift` file:\n\n```swift\n.product(name: \"CsvBuilder\", package: \"csv2img\"),\n```\n\n## Usage of CsvBuilder\n\n1. Define custom type that conforms to `CsvComposition`.\n\n```swift\nimport Foundation\nimport Csv2ImgCore\n\n\npublic struct CsvCompositionExample: CsvComposition {\n    @CsvRows(column: \"age\")\n    public var ages: [String]\n\n    @CsvRows(column: \"name\")\n    public var names: [String]\n\n    public init() { }\n}\n```\n\n2. Build `Csv`\n\n```swift\nlet composition: CsvCompositionExample = .init()\ncomposition.ages.append(contentsOf: [\"98\", \"99\", \"100\"])\ncomposition.names.append(contentsOf: [\"Yamada\", \"Tanaka\", \"Sato\"])\nlet csv = try! composition.build()\n```\n\nor you can write different way like the below.\n\n```swift\nlet yamada = Csv.Row(index: 0, values: [\"98\", \"Yamada\"])\nlet tanaka = Csv.Row(index: 1, values: [\"99\", \"Tanaka\"])\nlet sato = Csv.Row(index: 2, values: [\"100\", \"Sato\"])\nlet csv = try! CsvCompositionParser.parse(type: CsvCompositionExample.self, rows: [yamada, tanaka, sato,])\n```\n\n| Result                                                                                                                                                                     |\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| \u003cimg width=\"392\" alt=\"スクリーンショット 2022-08-26 12 54 22\" src=\"https://user-images.githubusercontent.com/44002126/186814170-0c33013e-c138-4ed5-a34c-5d45dc8ac0c0.png\"\u003e |\n\n# Csv2ImgCmd (CLI)\n\nA command line tool which generates png-image from csv. (Using `Csv2Img` library)\n\n- [documentation](https://fummicc1.github.io/Csv2ImgCmd_DocC/documentation/csv2imgcmd/)\n\n## Installation of Csv2ImgCmd\n\nAdd the following to your `Package.swift` file:\n\n```swift\n.product(name: \"Csv2ImgCmd\", package: \"csv2img\"),\n```\n\n## Usage of Csv2ImgCmd\n\nCoomand line interface using `Csv2Img` library.\n\nIf you have a csv file on your computer, you cloud use this flag with `--local`, `-l`.\n\n```shell\n./Csv2ImgCmd --local ~/Downloads/sample.csv ./output.png\n```\n\nIf you would like to convert csv file on the internet, you cloud use this flag with `--network`, `-n`.\n\n```shell\n./Csv2ImgCmd --network \\\nhttps://raw.githubusercontent.com/fummicc1/csv2img/main/Sources/Csv2ImgCmd/Resources/sample_1.csv \\\noutput.png\n```\n\n# Contributing\n\nPull requests, bug reports and feature requests are welcome 🚀\n\n# License\n\n[MIT LICENSE](https://github.com/fummicc1/csv2img/blob/main/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffummicc1%2Fcsv2img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffummicc1%2Fcsv2img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffummicc1%2Fcsv2img/lists"}