PHPackages                             hinimajesty/pop-excel-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hinimajesty/pop-excel-api

ActiveLibrary[API Development](/categories/api)

hinimajesty/pop-excel-api
=========================

popExcelApi is a very simple and easy to expand excel API for extracting data column by column

26PHP

Since Mar 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/hinimajesty/pop-excel-api)[ Packagist](https://packagist.org/packages/hinimajesty/pop-excel-api)[ RSS](/packages/hinimajesty-pop-excel-api/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Pop Excel API
=============

[](#pop-excel-api)

PopExcelApi is easy to use and highly customizeable. Do you have columns in your csv file you would want to get data from ? What about pushing the data from the columns into arrays. PopExcelAPi has already set up names and contacts with the assumption that the CSV file contains names in its first column and contacts in its second column. A bit on how to customize these coming shortly.

Installing
----------

[](#installing)

Download the ZIP file from Github and extract into your project. On every script that you would use the popExcelAPI make sure you require /path/to/vendor/autoload.php. The autoload.php is an automatic loader for all dependencies of the popExcelApi. Also after requiring in the autolaod file, make sure you import the classes in the src folder using the use keyword as all classes are namespaced. An example folder has been provided. Dig in to get a better explanation.

\*\*Note : Composer was used to manage the autoloading of classes asuch it may be required for a smooth operation. If you are new to composer, just follow the basic usage examples in this document.

Basic Usage
-----------

[](#basic-usage)

In html, you would have a file input field with a name attribute, in this example our file input field has the name excel\_file;

```

```

Next, in the php script that the data would be sent to, you can extract the data this way:

```
require_once '../vendor/autoload.php';

use Lixweb\Helpers;
use Lixweb\popExcelApiContract;
use Lixweb\popExcelApi;

$form_input_field = 'excel_file';
$excelApi = new popExcelApi($form_input_field);

$names    = $excelApi->getNames();
$contacts = $excelApi->getContacts();
```

From this example, the excel file contains in its first column names, and the second columnn contacts and i bet, the trend is becoming clear. In your project you may have columns like first\_name, last\_name, address etc... For those applications you would have to expand the code a bit. This library was a hack for a little project. And since the developer didnt want to waste time studying other php excel libraries which provide more features anyway, he came up with his own to fit his needs. If you want a more robust solution, you are free to look at PHPOffice, but if you want something simple to extract columns from a csv file into an array then this gets the Job Done.

Error codes
-----------

[](#error-codes)

By default the getDataFromColumn function would return two types of errors. When it returns "err2", it means the name of the file input field has not been set. Since this is done implicitly hardly would you come accross this error in development but it is good to know incase you want to edit the code. On seeing "err1", this means the extension of the file is invalid. We are expecting csv files only. Any other file type would not be processed asuch the error "err1" would be returned.

Extending the existing functionalities
--------------------------------------

[](#extending-the-existing-functionalities)

As said earlier, you can get data from only 2 columns. The column count begins at 1. If your csv file has more columns you can provide more descriptive methods for accessing such columns. This can be done in the popExcelApiContract.php and popExcelApi.php file. Assuming my excel file contains a third column for address, in the popExcelApiContract.php file in src directory i would add a new contract i.e a method signature e.g:

```
abstract public function getAddress();

```

After this is done, in the popExcelApi.php file i would provide an implementation for the method signature:

```
public function getAddress( ){
 return $this->getDataFromColumn( 3 );
}
```

Since the count of the columns begins at index 1, the third column is number 3.

Voila, that is all you need to do, now you can go ahead and use that new function in your application. Make pull requests, add features, correct the code; Just hack something...

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a74c496d91dd7bfe04660d3b5666a3191ced1998cecd7b328230f337866039f6?d=identicon)[hinimajesty](/maintainers/hinimajesty)

---

Top Contributors

[![hinimajesty](https://avatars.githubusercontent.com/u/19369546?v=4)](https://github.com/hinimajesty "hinimajesty (16 commits)")

---

Tags

apiclasscsvexcellibraryphp

### Embed Badge

![Health badge](/badges/hinimajesty-pop-excel-api/health.svg)

```
[![Health](https://phpackages.com/badges/hinimajesty-pop-excel-api/health.svg)](https://phpackages.com/packages/hinimajesty-pop-excel-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
