Skip to main content

NACE Converter

A Python package for converting NACE codes to their plaintext descriptions and searching for codes by keywords.

What is NACE?

NACE (Nomenclature of Economic Activities) is the European statistical classification of economic activities. NACE codes are used to classify business activities for statistical purposes.

Installation

pip install naceconverter

Quick Start

import naceconverter as nc

# Get description for a NACE code
description = nc.get_description("01.1")
print(description)  # "Growing of non-perennial crops"

# Works with or without dots
description = nc.get_description("011")
print(description)  # "Growing of non-perennial crops"

# Search for codes containing a keyword
results = nc.search_code('painting')
for result in results:
    print(f"{result['code']}: {result['description']}")

# Get full information about a code
info = nc.get_full_info("01.1")
print(info)
# {'code': '01.1', 'name': 'Growing of non-perennial crops', 'level': 3, ...}

Features

  • Flexible Code Lookup: Handles codes with or without dots (e.g., "01.30" and "0130" return the same result)
  • Fast Search: Search for NACE codes by keywords in descriptions
  • Complete Information: Access full details including hierarchy level, parent codes, and validity dates
  • Zero Dependencies: Pure Python implementation with no external dependencies
  • Included Data: NACE codes data is bundled with the package

API Reference

Module-level Functions

get_description(code: str) -> Optional[str]

Get the plaintext description for a NACE code.

search_code(keyword: str, max_results: Optional[int] = None) -> List[Dict]

Search for NACE codes containing a keyword. Returns a list of matching codes with their descriptions.

search_codes(keyword: str, max_results: Optional[int] = None) -> List[Dict]

Alias for search_code() that returns multiple results.

get_full_info(code: str) -> Optional[Dict]

Get complete information for a NACE code including level, parent code, notes, and validity dates.

NACEConverter Class

For more advanced usage, you can work directly with the NACEConverter class:

from naceconverter import NACEConverter

converter = NACEConverter()
description = converter.get_description("01.1")

Examples

Finding all codes related to agriculture

import naceconverter as nc

results = nc.search_code('agriculture')
for r in results:
    print(f"Code: {r['code']}, Level: {r['level']}, Description: {r['description']}")

Getting parent-child relationships

import naceconverter as nc

info = nc.get_full_info("01.11")
parent_code = info['parentCode']
parent_info = nc.get_full_info(parent_code)
print(f"Parent: {parent_info['name']}")

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for naceconverter 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for naceconverter 1.0.1
File Size Uploaded
naceconverter-1.0.1.tar.gz 58.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for naceconverter 1.0.1
File Interpreter ABI Platform
naceconverter-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.9 kB

Release files / naceconverter-1.0.1.tar.gz

Download URL naceconverter-1.0.1.tar.gz
Size 58.2 kB
Tags Source
SHA-256 checksum
How to use checksums
994cd5b26a6739f5ebf39d298b27a5a15a067df3e5cb9c002657d0629fc197bc
BLAKE2b-256 checksum
How to use checksums
54eb91a02a52d4972b9e2603785df1f2c3247a93f17441c8a519890cd4841706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / naceconverter-1.0.1-py3-none-any.whl

Download URL naceconverter-1.0.1-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86de593dc2129613db767177338560eb56539bf96db407c2940ec6e716799231
BLAKE2b-256 checksum
How to use checksums
0379378caa38f97d3c6a17f23c7b8d0a21eb5b2ca78be2ac2a10442e4355fe55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page