PHPackages                             metolabs/camelot-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. metolabs/camelot-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

metolabs/camelot-php
====================

Camelot wrapper for PHP

1.0.1(11mo ago)083MITPHPPHP &gt;=8.0

Since Jun 12Pushed 11mo agoCompare

[ Source](https://github.com/MetoLabs/camelot-php)[ Packagist](https://packagist.org/packages/metolabs/camelot-php)[ RSS](/packages/metolabs-camelot-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

CamelotPHP
==========

[](#camelotphp)

A PHP wrapper for the [Camelot](https://camelot-py.readthedocs.io/) PDF table extraction tool. This package allows you to extract tables from PDF files using Camelot CLI, and return the results as arrays, objects, or JSON.

---

🚀 Features
----------

[](#-features)

- Extract tables from PDFs using Camelot CLI
- Structured page/table output as PHP array/object
- Automatically handles temp files and directories
- Detailed error handling for:
    - Missing Camelot
    - Missing Ghostscript
    - Invalid input file
- Supports both `lattice` and `stream` parsing modes

---

Requirements
------------

[](#requirements)

- **PHP 8.0+**
    This library requires PHP version 8.0 or higher.
- **Camelot CLI**
    You must install [Camelot](https://camelot-py.readthedocs.io/) (Python) on your system.
    Make sure the `camelot` command is accessible in your `$PATH`.
- **Ghostscript**
    Camelot depends on [Ghostscript](https://www.ghostscript.com/) for parsing PDF content.
    Ensure `gs` is installed and available in your system `$PATH`.
- **PHP Extensions**

    - `ext-json` (for JSON encoding/decoding)

> 💡 **Tip**: Run `which camelot` and `which gs` to confirm both binaries are installed and accessible.

---

📦 Installation
--------------

[](#-installation)

```
composer require metolabs/camelot-php
```

> ⚠️ Make sure [`camelot`](https://camelot-py.readthedocs.io/en/master/user/install.html) and its dependencies like `ghostscript` are installed on your system and available in your `$PATH`.

---

🧪 Example Usage
---------------

[](#-example-usage)

```
use MetoLabs\CamelotPHP\Camelot;

$camelot = Camelot::make('/path/to/file.pdf', 'lattice');

$result = $camelot->extract('array');

// Output example:
print_r($result['pages'][0]['tables'][1]);
```

You can also extract in other formats:

```
$camelot->extract('string'); // returns JSON string
$camelot->extract('object'); // returns stdClass object
```

---

🧰 Configuration
---------------

[](#-configuration)

You can optionally pass:

- Output path (defaults to a temporary directory)
- Custom binary path to `camelot`
- Debug mode (to print command + outputs)

```
$camelot = Camelot::make('/file.pdf', 'stream', null, '/usr/local/bin/camelot', null, true);
```

---

❗ Exceptions
------------

[](#-exceptions)

This package throws descriptive exceptions for common issues:

- `CamelotNotInstalledException`
- `FileNotFoundException`
- `DependencyErrorException`
- `CamelotExecutionException`

---

📄 License
---------

[](#-license)

MIT License

Copyright (c) 2025 MetoLabs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

**THE SOFTWARE IS PROVIDED “AS IS”**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---

🤝 Contributing
--------------

[](#-contributing)

Feel free to submit pull requests or open issues if you find bugs or want improvements.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance51

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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.

###  Release Activity

Cadence

Every ~27 days

Total

2

Last Release

348d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9123134?v=4)[Gerardo Ramirez](/maintainers/geradrum)[@geradrum](https://github.com/geradrum)

---

Top Contributors

[![geradrum](https://avatars.githubusercontent.com/u/9123134?v=4)](https://github.com/geradrum "geradrum (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/metolabs-camelot-php/health.svg)

```
[![Health](https://phpackages.com/badges/metolabs-camelot-php/health.svg)](https://phpackages.com/packages/metolabs-camelot-php)
```

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k35.1M142](/packages/spatie-browsershot)[spatie/laravel-settings

Store your application settings

1.5k6.8M135](/packages/spatie-laravel-settings)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M152](/packages/spatie-laravel-health)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)

PHPackages © 2026

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