GithubHelp home page GithubHelp logo

rana7cse / yocsv Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 0.0 33 KB

A simple php package, what allow you to import csv and also allow you to query on it's data like a query builder. It's really really easy to import, filter, grouping, transforming and others operation on a csv file.

PHP 100.00%
php csv-reader csv-writer csv-data csv-query jsonq

yocsv's Introduction

yocsv

YoCsv is a simple php package to manipulate csv files and apply query on it's data like php-jsonq. This package also allow you to transform your expected data.

Installation

Just add this package to your composer.json file to write this command.

composer require msrana/yocsv

Quick usage to read a csv file

Just create an instance of Csv class and pass an argument of file path string. Then call the get() method to get data like example below

use MsRana\YoCsv\Csv;
$csv = new Csv("../source/school.csv") // use right path name to ignore `FileNotFoundException`
$data = $csv->get(); // you will get all row as array

Please don't forget to add vendor/autoload.php file.

Or you can instantiate without passing any argument on constractor in this way you have to call read or import method with a argument as file path.

use MsRana\YoCsv\Csv;
$csv = new Csv();
$csv->read("file.csv");
$csv->get(); // return all data row as array

This package also allow you to apply query/filters like as orm. We use php-jsonq package to inherit it's query functionality on csv file. Please read php-jsonq documentation and their apis to apply query on csv :D.

$csv->where('key',$value);
$csv->get(); // show result

Library used

Credit

yocsv's People

Contributors

im-fahad avatar rana7cse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.