{"id":2178,"date":"2014-02-18T00:12:04","date_gmt":"2014-02-17T22:12:04","guid":{"rendered":"http:\/\/www.nyamsprod.com\/blog\/?p=2178"},"modified":"2014-02-18T00:13:09","modified_gmt":"2014-02-17T22:13:09","slug":"bakame-csv","status":"publish","type":"post","link":"https:\/\/nyamsprod.com\/blog\/bakame-csv\/","title":{"rendered":"Handling CSV in PHP with Bakame.csv"},"content":{"rendered":"<div class=\"message warning\">\n<p><strong>Attention:<\/strong> Les informations de ce billet sont susceptibles d'&ecirc;tre obsol&egrave;tes car vieux de plus 2 ans.<\/p>\n<p><strong>Warning: <\/strong> The information you are reading may be obsolete, this post was published more than 2 years ago.<\/p>\n<\/div><p>For many years I&#8217;ve been struggling with CSV files. Not because they are difficult to parse, PHP has been able to manipulate those files since the days of PHP4 but because finding a clean, simple yet powerful library to handle them was a pain. So after many years of re-inventing the wheel every time I was confronted with parsing a CSV I&#8217;ve decided to take a step back and start writing my own CSV manipulation library.<br \/>\nThis is how <a title=\"Bakame.csv\" href=\"https:\/\/github.com\/nyamsprod\/Bakame.csv\" target=\"_blank\">Bakame.csv<\/a> came to be.<!--more--><\/p>\n<p>Now don&#8217;t get me wrong <a title=\"PHP CSV libraries on Github\" href=\"https:\/\/github.com\/search?q=csv+php\" target=\"_blank\">I looked on Github for similar libraries<\/a> but those that I&#8217;ve found were based on PHP4 stream functions or where not as documented or as straightforward as I wanted, some even had conflicted documentation or no documentation at all. So I started writing my own library in search of a well documented, powerful yet easy to of use library. If I had to point some of the goals achieve with this library I would say that:<\/p>\n<ul>\n<li>it is very light around 30k if you remove the examples and test folders;<\/li>\n<li>it uses SPL Iterator classes when possible to ease CSV filtering;<\/li>\n<li>it relies on SPL files classes to read and write CSV;<\/li>\n<li>it is very well documented with examples and all the code is fully unit tested;<\/li>\n<li>and last but not least It&#8217;s open sourced on Github so anyone can contribute to it very easily;<\/li>\n<\/ul>\n<p>As of this writing the library is on <a title=\"latest stable Bakame.csv version\" href=\"https:\/\/github.com\/nyamsprod\/Bakame.csv\/releases\/latest\" target=\"_blank\">version 4.2<\/a> but don&#8217;t let the library version number fool you as the number only reflect the use of semantic versioning.<\/p>\n<p>So please, don&#8217;t be afraid to download the code, using composer, test it on your own CSV contents and if you find some bugs or some missing features please feel free to contribute to the library by opening an issue or by submitting a merge request with some new fancy cool improvements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#CSV manipulation in #PHP made simple with the Bakame\/CSV library<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[759,761,765,231,758,760,766,762,412,767,764,768,763],"class_list":["post-2178","post","type-post","status-publish","format-standard","hentry","category-web","tag-composer","tag-csv","tag-filtering","tag-github","tag-library","tag-mit","tag-open-source","tag-parsing","tag-php","tag-psr-4","tag-reading","tag-semantic-versioning","tag-writing"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/comments?post=2178"}],"version-history":[{"count":5,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2178\/revisions"}],"predecessor-version":[{"id":2185,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2178\/revisions\/2185"}],"wp:attachment":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/media?parent=2178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/categories?post=2178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/tags?post=2178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}