verdantcart / carbon-txt
Platform-agnostic PHP library for generating, publishing, importing, and validating carbon.txt sustainability disclosures per the Green Web Foundation v0.5 specification.
Requires
- php: >=8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6 || ^10.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Platform-agnostic PHP library for generating, publishing, importing, and validating carbon.txt sustainability disclosures per the Green Web Foundation v0.5 specification.
Status: early development — v0.1.0 ships October 2026.
Part of: VerdantCart AI — open sustainability tooling for WooCommerce.
What is carbon.txt?
carbon.txt is an emerging web standard maintained by the Green Web Foundation. Like robots.txt or security.txt, it's a machine-readable file at a well-known URL (/carbon.txt) that publishes an organization's sustainability disclosures — carbon footprint, reporting period, methodology, and pointers to full disclosures.
Today only enterprise sustainability platforms (Watershed, Persefoni, Sylvera — €500–5,000/month) implement it. This library brings the same capability to any PHP project.
Install
composer require verdantcart/carbon-txt
Quick start
use VerdantCart\CarbonTxt\Generator; use VerdantCart\CarbonTxt\DTO\Disclosure; $disclosure = new Disclosure( organisation: 'Acme Coffee Roasters', domain: 'acmecoffee.com', reportingPeriod: '2026', scope1: 42.3, scope2: 128.7, scope3: 3412.9, ); $generator = new Generator(); echo $generator->render($disclosure, specVersion: '0.5');
Full docs coming with the v0.1.0 release.
Roadmap
| Version | Focus | Target |
|---|---|---|
| v0.0.1 | Package name reserved on Packagist | Sept 2026 |
| v0.1.0 | Generator + Publisher + Importer + Validator + WordPress adapter | Oct 2026 |
| v0.2.0 | DIST schema alignment | Q1 2027 |
| v1.0.0 | Stable API, docs, third-party adopters | Q2 2027 |
Development is grant-supported via NLnet Restack (application in review).
Contributing
This library is open source under GPL-2.0-or-later. Issue reports, spec-alignment questions, and third-party integration feedback all welcome.
License
GPL-2.0-or-later. Compatible with WordPress plugins, e-commerce platforms, and any GPL/GPL-compatible codebase.
Related
- Green Web Foundation — organisation behind the spec
- carbontxt.org — the specification
- VerdantCart Carbon Reports — free WordPress plugin using this library
- VerdantCart AI Pro — commercial Pro/Pro+ tiers