npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

caen-romania

v1.0.0

Published

Romanian CAEN Rev.2 <-> Rev.3 crosswalk (official INS table) with Romanian and English titles. Zero dependencies.

Readme

caen-romania

The official CAEN Rev.2 to CAEN Rev.3 crosswalk for Romanian economic activity codes, with Romanian and English titles for every section, division, group and class, as CSV, JSON and two zero-dependency packages (Python and JavaScript).

On 1 January 2025 Romania replaced CAEN Rev.2 with CAEN Rev.3 (Ordinul INS nr. 377/2024), its version of the EU's NACE Rev.2.1. Firms registered since then get Rev.3 codes; older firms move to Rev.3 over time. So registry data, invoices and filings now mix both. INS publishes the correspondence as a formatted spreadsheet and the structures as PDFs. This repository turns them into files a program can read, and keeps the build reproducible from the official files.

What changed, in numbers (all computed by scripts/build.py):

| | CAEN Rev.2 | CAEN Rev.3 | |---|---|---| | Sections | 21 | 22 | | Divisions | 88 | 87 | | Groups | 272 | 287 | | Classes | 615 | 651 |

  • 975 links between Rev.2 and Rev.3 classes: 361 one-to-one, the rest splits, merges and many-to-many.
  • 110 Rev.2 classes no longer exist; 146 Rev.3 classes are new numbers (software development moved from 6201 to 6210).
  • 25 numbers mean a different activity in each revision. 4391 was roofing and is now masonry; 4791 was internet retail and is now retail intermediation; 4673 was wholesale of building materials and is now wholesale of motorcycles. A bare code from that list is ambiguous until you know its revision. The full list is in CHANGES.md.

Files

| File | Rows | Columns | |---|---|---| | data/caen_rev2.csv / .json | 996 | code, level, parent, section, title_ro, title_en | | data/caen_rev3.csv / .json | 1,047 | same | | data/crosswalk_rev2_rev3.csv / .json | 975 | rev2, rev3, relation, ins_change, note, rev2_title_ro, rev3_title_ro, rev2_title_en, rev3_title_en |

  • code: a section letter (K), a division (62), a group (621) or a class (6210), without dots. CSVs are UTF-8; read code as text so 0111 keeps its zero.
  • level: section, division, group or class. parent is the code one level up.
  • relation describes the link between two classes:
    • 1:1: the Rev.2 class has one Rev.3 class, which has no other Rev.2 source.
    • 1:n: the Rev.2 class split into several Rev.3 classes.
    • n:1: several Rev.2 classes merged into this Rev.3 class.
    • n:m: both of the above.
    • associated: a link INS marks with a star: a Rev.3 intermediation class (4791, 4792, 3540, ...) "associated with Rev.2 codes but not resulting from their split". Use these when you search, not when you convert.
    • 0:1: Rev.3 class 4689 (other specialised wholesale n.e.c.), which the INS table lists with no Rev.2 predecessor.
  • ins_change: the change type INS shades each row with (split, merge, recode, or empty), decoded from the table's own legend. It is INS's marking, kept as published; relation is computed from the links themselves.
  • note: the INS remark (OBS column), in Romanian.
  • INS gives no shares or weights for the splits, so there are none here.
$ grep -E '^(4120|4391),' data/crosswalk_rev2_rev3.csv | cut -d, -f1-4
4120,4100,1:n,split
4120,4399,n:m,split
4120,9130,n:m,split
4391,4341,n:1,recode

Python

pip install caen-romania
>>> from caen_romania import to_rev3, to_rev2, title, is_ambiguous
>>> to_rev3("6201")
['6210']
>>> to_rev2("6210")
['6201']
>>> to_rev3("0119")                      # a split
['0113', '0119']
>>> to_rev2("0113")                      # a merge
['0113', '0119', '0128']
>>> title("4391", rev=2, lang="en")
'Roofing activities'
>>> title("4391", rev=3, lang="en")
'Masonry and bricklaying activities'
>>> is_ambiguous("4391")
True
>>> title("62", rev=3)
'Activităţi de programare și activități de consultanță în tehnologia informaţiei'
>>> to_rev2("4791")                      # an intermediation class: no predecessor by default
[]
>>> to_rev2("4791", associated=True)[:4]
['4711', '4719', '4779', '4791']
  • to_rev3(code, associated=False) and to_rev2(code, associated=False) return a sorted list of classes, empty when the code is not a class of that revision.
  • title(code, rev=3, lang="ro") works at every level and returns None for an unknown code. rev is 2 or 3, lang is "ro" or "en".
  • is_ambiguous(code) is true for the 25 numbers in CHANGES.md.
  • Codes may be written "6201", "62.01" or 6201. Python 3.9 or newer, no dependencies.

JavaScript

npm install caen-romania
import { toRev3, toRev2, title, isAmbiguous } from "caen-romania";

toRev3("6201");              // ["6210"]
toRev2("6210");              // ["6201"]
title("4673", 2, "en");      // "Wholesale of wood, construction materials and sanitary equipment"
title("4673", 3, "en");      // "Wholesale of motorcycles, motorcycle parts and accessories"
isAmbiguous("4673");         // true
toRev3("4673");              // ["4683"]
toRev2("4791", { associated: true });   // ["4711", "4719", ...]

ES module with TypeScript types, no dependencies, Node 18 or newer and browsers.

Sources and licence

| Data | Publisher | Source | Terms | |---|---|---|---| | Crosswalk, Romanian class titles, notes | INS | Tabel corespondență CAEN Rev.2 - CAEN Rev.3, septembrie 2026 | OGL-ROU-1.0 | | Romanian titles of sections, divisions, groups | INS | CAEN Rev.2 and CAEN Rev.3 structures | OGL-ROU-1.0 | | English titles | Eurostat | SDMX code lists NACE_R2 and NACE_R2_1 | CC BY 4.0, source acknowledged |

INS publishes its content for reuse under the Romanian Open Government Licence v1.0 (INS copyright page), within the open-data law (Legea nr. 179/2022): reuse, also commercial, is allowed if you name the source, do not suggest official status, and do not misrepresent the data. Eurostat allows reuse with the source acknowledged. If you redistribute the data, keep NOTICE, which has the attribution lines. This project is not affiliated with INS or Eurostat.

The code is MIT (LICENSE).

Rebuilding

The official files are in sources/, byte for byte, with checksums in sources/SHA256SUMS.

pip install -r scripts/requirements-build.txt   # pypdf, for the two INS PDFs only
python3 scripts/build.py                        # regenerate data/, the package data and CHANGES.md
python3 scripts/build.py --check                # CI: fail if any generated file is out of date

The build fails unless the INS and Eurostat code sets agree at every level, every Rev.2 class maps to at least one Rev.3 class, and every Rev.3 class appears in the crosswalk. Class titles come from the correspondence table (the newest INS document); the structure PDFs have a few typos at class level, so they only supply the higher levels.

Tests: python3 -m unittest discover -s python/tests and node --test js/test/*.test.js.

Română

De la 1 ianuarie 2025, CAEN Rev.3 (Ordinul INS nr. 377/2024, echivalentul NACE Rev.2.1) înlocuiește CAEN Rev.2. Firmele înființate de atunci primesc coduri Rev.3, cele vechi trec treptat la Rev.3, așa că datele din registru, facturi și declarații le amestecă. INS publică tabelul de corespondență ca fișier Excel formatat și structurile ca PDF; aici le găsiți ca fișiere CSV și JSON, cu denumiri în română și engleză pe toate nivelurile (secțiune, diviziune, grupă, clasă), plus pachete Python și JavaScript fără dependențe.

  • data/crosswalk_rev2_rev3.csv: cele 975 de legături Rev.2 - Rev.3 din tabelul INS (ediția septembrie 2026), cu tipul relației (1:1, 1:n, n:1, n:m, associated pentru clasele de intermediere marcate cu stea de INS).
  • data/caen_rev2.csv, data/caen_rev3.csv: nomenclatoarele complete.
  • CHANGES.md: cele 25 de coduri care au alt înțeles în Rev.3. De exemplu 4391 (lucrări de învelitori, șarpante și terase, în Rev.2) înseamnă în Rev.3 lucrări de zidărie; 4791 (comerț prin internet) a devenit intermediere în comerțul cu amănuntul. Un astfel de cod, fără revizie, e ambiguu.
>>> from caen_romania import to_rev3, title
>>> to_rev3("6201")
['6210']
>>> title("6210", rev=3)
'Activităţi de realizare a softului la comandă (software orientat client)'

Sursa: Institutul Național de Statistică (INS), www.insse.ro. Conține informații publice în baza Licenței pentru Guvernare Deschisă v1.0. Denumirile în engleză: Eurostat. Proiectul nu are legătură oficială cu INS sau Eurostat.

Related

To look a firm up by its CAEN code and get its registry record, financials and ANAF status: Leadgen, a REST API and MCP server for Romanian company data.