{"id":16957685,"url":"https://github.com/jmks/csv_blueprints","last_synced_at":"2025-12-31T14:10:42.175Z","repository":{"id":62556476,"uuid":"173348303","full_name":"jmks/csv_blueprints","owner":"jmks","description":"A declarative way to generate CSVs","archived":false,"fork":false,"pushed_at":"2019-03-04T17:39:09.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-03T23:03:23.439Z","etag":null,"topics":["csv","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/jmks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-01T18:16:53.000Z","updated_at":"2019-03-04T17:33:11.000Z","dependencies_parsed_at":"2022-11-03T06:15:24.284Z","dependency_job_id":null,"html_url":"https://github.com/jmks/csv_blueprints","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jmks/csv_blueprints","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmks%2Fcsv_blueprints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmks%2Fcsv_blueprints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmks%2Fcsv_blueprints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmks%2Fcsv_blueprints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmks","download_url":"https://codeload.github.com/jmks/csv_blueprints/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmks%2Fcsv_blueprints/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265871434,"owners_count":23842028,"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":["csv","ruby"],"created_at":"2024-10-13T22:19:42.239Z","updated_at":"2025-12-31T14:10:42.136Z","avatar_url":"https://github.com/jmks.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSV Blueprints\n\n[![Build Status](https://travis-ci.com/jmks/csv_blueprints.svg?branch=master)](https://travis-ci.com/jmks/csv_blueprints)\n\nA simple and small DSL to generate CSV files.\n\n## Usage\n\nDeclaratively specify a CSV blueprint:\n\n```ruby\nrequire \"csv_blueprints\"\nrequire \"faker\"\n\nblueprint = CsvBlueprints.specify do\n  column \"ID\", value: :sequence\n  column \"Name\", value: -\u003e i { Faker::Name.name }\n  columns \"Login\", \"Email\", value: -\u003e i { \"email#{i}@example.com\" }\n  column \"Type\", static: \"Client\"\n  column \"Notes\", value: :blank\nend\n```\n\n\u003e We're using the [faker](https://github.com/stympy/faker) gem here for realistic names\n\nThis one blueprint can generate multiple plans. E.g. differing numbers of rows or to override the row's values:\n\n```ruby\n# three rows\nplan = blueprint.plan.standard(3)\nplan.write\n```\n\nwill generate a CSV like:\n\n```\nID,Name,Login,Email,Type,Notes\n1,Val Kulas DVM,email1@example.com,email1@example.com,Client,\n2,Marsha Sporer,email2@example.com,email2@example.com,Client,\n3,Mrs. Bennett Bechtelar,email3@example.com,email3@example.com,Client,\n```\n\nAnother plan from the same blueprint\n\n```ruby\n# two rows with duplicate IDs and a note\nplan_with_duplicate_ids = blueprint.plan.customized(2, \"ID\" =\u003e 999, \"Notes\" =\u003e \"Imported on #{Date.today.strftime('%Y-%m-%d')}\")\nplan_with_duplicate_ids.write\n```\n\nwould generate\n\n```\nID,Name,Login,Email,Type,Notes\n999,Tiffanie Schaden,email1@example.com,email1@example.com,Client,Imported on 2019-03-04\n999,Mr. Arie Stroman,email2@example.com,email2@example.com,Client,Imported on 2019-03-04\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"csv_blueprints\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install csv_blueprints\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jmks/csv_blueprints.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmks%2Fcsv_blueprints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmks%2Fcsv_blueprints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmks%2Fcsv_blueprints/lists"}