PHPackages                             loremipsum-system/industry-classification-codes - 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. loremipsum-system/industry-classification-codes

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

loremipsum-system/industry-classification-codes
===============================================

Public PHP Industry Classification Codes Package

V1.0.0(2w ago)043MITPHPPHP &gt;=8.2

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/Lorem-Ipsum-Systems/Industry-Classification-Codes)[ Packagist](https://packagist.org/packages/loremipsum-system/industry-classification-codes)[ RSS](/packages/loremipsum-system-industry-classification-codes/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Industry Classification Codes
=============================

[](#industry-classification-codes)

A plain PHP package for industry classification reference data, exact code validation, lookup, hierarchy browsing, translations, and simple autocomplete/search.

Supports:

- NAICS 2022
- NACE Rev. 2.1
- UK SIC 2026
- ISIC Rev. 5

What it does
------------

[](#what-it-does)

- Provides industry classification reference data for major international systems.
- Allows exact code validation (canonical codes and supported aliases).
- Supports hierarchy traversal (parents, children, ancestors, descendants).
- Provides translation lookup where available (e.g., NACE).
- Simple case-insensitive autocomplete/search utilities.

What it does NOT do
-------------------

[](#what-it-does-not-do)

- Store company selections (host applications should store `system`, `version`, and `code`).
- Require a database or ORM.
- Require any specific framework.
- Parse XLSX or CSV files at runtime.
- Download datasets or require an internet connection.
- Require an import or normalization step for consumers.
- Provide crosswalks or version mappings in v1.

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

[](#requirements)

- PHP 8.2 or newer.
- `ext-mbstring` PHP extension.

Installation
------------

[](#installation)

```
composer require loremipsum-system/industry-classification-codes
```

Data Files
----------

[](#data-files)

The required NDJSON reference data files are shipped directly with the package under the `data/` directory. You do **not** need to add data files manually or run an import command.

The package structure for data is:

```
data/
  naics/2022/
    2022_NAICS_Structure.ndjson
    2022_NAICS_Descriptions.ndjson
    2022_NAICS_Index_File.ndjson
    6-digit_2022_Codes.ndjson
  nace/2.1/
    NACE_Rev2.1_Structure_Explanatory_Notes_EN.ndjson
    NACE_Rev2.1_Heading_All_Languages.ndjson
  uk_sic/2026/
    sic2026classification.ndjson
  isic/5/
    ISIC_Rev_5_english_structure.ndjson
    ISIC5_Exp_Notes_11Mar2024.ndjson

```

Usage
-----

[](#usage)

### Initialize the Registry

[](#initialize-the-registry)

```
use LoremIpsum\IndustryClassificationCodes\Registry\ClassificationIndustryRegistry;

// Loads data from the package's default data directory
$registry = ClassificationIndustryRegistry::fromDefaultData();
```

Lookup methods (like `findCode`) return `null` if the record is not found. Collection methods (like `childrenOf` or `search`) return an empty array if no results match.

### Lookup and Validation

[](#lookup-and-validation)

```
// Find a code
$code = $registry->findCode(system: 'NAICS', version: '2022', code: '541511');

if ($code) {
    echo $code->title; // Custom Computer Programming Services
}

// Exact validation
$isValid = $registry->isValidCode(system: 'UK_SIC', version: '2026', code: '01.11');

// ISIC Alias lookup support
$isicCode = $registry->findCode(system: 'ISIC', version: '5', code: 'A0111');
// Returns code '0111'
```

### Hierarchy Browsing

[](#hierarchy-browsing)

```
// Get direct children
$children = $registry->childrenOf(system: 'NACE', version: '2.1', code: '01');

// Get parent
$parent = $registry->parentOf(system: 'UK_SIC', version: '2026', code: '01.11');

// Get all leaf codes for a system
$leaves = $registry->leafCodes(system: 'ISIC', version: '5');
```

### Search / Autocomplete

[](#search--autocomplete)

```
$results = $registry->search(system: 'NAICS', version: '2022', query: 'software');

foreach ($results as $result) {
    echo "{$result->code->code}: {$result->code->title} (Score: {$result->score})\n";
}
```

### Translations

[](#translations)

```
$translations = $registry->translationsFor(system: 'NACE', version: '2.1', code: '01.11');
$german = $registry->translationFor(system: 'NACE', version: '2.1', code: '01.11', locale: 'de');
```

Manual Company Code Validation
------------------------------

[](#manual-company-code-validation)

Host applications should allow users to select codes and then store them in their own database using three fields: `system`, `version`, and `code`.

Before saving a selection, the host application should validate the code through this package:

```
$registry->isValidCode(system: 'NAICS', version: '2022', code: $userInput);
```

Maintainer Data Updates
-----------------------

[](#maintainer-data-updates)

To update the reference data:

1. Replace or update the NDJSON files in `data/`.
2. Run tests: `composer test`.
3. Run validation: `composer validate-data`.
4. Commit changes and publish a new release.

The `validate-data` command is a read-only check to ensure data integrity (e.g., checking for duplicate codes or broken parent relationships).

Package consumers should never need to perform these steps.

Roadmap
-------

[](#roadmap)

- Cross-system and version-to-version crosswalks.
- RDF/SKOS exporters.
- Framework-specific adapters (Symfony Bundle, Laravel Service Provider).
- Optional search index integrations (SQLite FTS, Meilisearch).

License
-------

[](#license)

MIT License.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance96

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

20d ago

### Community

Maintainers

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

---

Top Contributors

[![samuelbengtsson](https://avatars.githubusercontent.com/u/62132302?v=4)](https://github.com/samuelbengtsson "samuelbengtsson (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/loremipsum-system-industry-classification-codes/health.svg)

```
[![Health](https://phpackages.com/badges/loremipsum-system-industry-classification-codes/health.svg)](https://phpackages.com/packages/loremipsum-system-industry-classification-codes)
```

PHPackages © 2026

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