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; readcodeas text so0111keeps its zero.level:section,division,grouporclass.parentis the code one level up.relationdescribes 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;relationis 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)andto_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 returnsNonefor an unknown code.revis 2 or 3,langis"ro"or"en".is_ambiguous(code)is true for the 25 numbers in CHANGES.md.- Codes may be written
"6201","62.01"or6201. 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,associatedpentru 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.
Metadata
Release files for caen-romania 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| caen_romania-1.0.0.tar.gz | 65.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| caen_romania-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 128.9 kB
Release files / caen_romania-1.0.0.tar.gz
| Download URL | caen_romania-1.0.0.tar.gz |
|---|---|
| Size | 65.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09f83cc088d7d9731efaba4aa37e763407bd825ac466171f56822c59b4b18acd
|
|
BLAKE2b-256 checksum How to use checksums |
e6997712b7eea518536f946c6233be84f7873b4674dc4f97366d3a4fe5356f99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logRelease files / caen_romania-1.0.0-py3-none-any.whl
| Download URL | caen_romania-1.0.0-py3-none-any.whl |
|---|---|
| Size | 63.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d5189a739cb7d0b0bdda030a0bcf3d0b9aee9e23bb6c43c80b1e0eea384af00
|
|
BLAKE2b-256 checksum How to use checksums |
ebec3186d991c166944d87693c00674f42fb8b5d5b2ab9832e5d7f961c69f456
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency log