naceconverter


Namenaceconverter JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/alexandersen01/nace-converter-py
SummaryA Python package for converting NACE codes to descriptions and searching
upload_time2025-09-02 11:46:51
maintainerNone
docs_urlNone
authorJakob Alexandersen
requires_python>=3.7
licenseMIT
keywords nace codes economic activities classification converter europe
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
pip install naceconverter
```

## Quick Start

```python
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:

```python
from naceconverter import NACEConverter

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

## Examples

### Finding all codes related to agriculture
```python
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
```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alexandersen01/nace-converter-py",
    "name": "naceconverter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nace, codes, economic, activities, classification, converter, europe",
    "author": "Jakob Alexandersen",
    "author_email": "Jakob Alexandersen <jakob.alexandersen@fsncapital.com>",
    "download_url": "https://files.pythonhosted.org/packages/e6/b9/b76f4ded8f507414a7db753590ac52209b25237331290cc65c02c96e0356/naceconverter-1.0.0.tar.gz",
    "platform": null,
    "description": "# NACE Converter\n\nA Python package for converting NACE codes to their plaintext descriptions and searching for codes by keywords.\n\n## What is NACE?\n\nNACE (Nomenclature of Economic Activities) is the European statistical classification of economic activities. NACE codes are used to classify business activities for statistical purposes.\n\n## Installation\n\n```bash\npip install naceconverter\n```\n\n## Quick Start\n\n```python\nimport naceconverter as nc\n\n# Get description for a NACE code\ndescription = nc.get_description(\"01.1\")\nprint(description)  # \"Growing of non-perennial crops\"\n\n# Works with or without dots\ndescription = nc.get_description(\"011\")\nprint(description)  # \"Growing of non-perennial crops\"\n\n# Search for codes containing a keyword\nresults = nc.search_code('painting')\nfor result in results:\n    print(f\"{result['code']}: {result['description']}\")\n\n# Get full information about a code\ninfo = nc.get_full_info(\"01.1\")\nprint(info)\n# {'code': '01.1', 'name': 'Growing of non-perennial crops', 'level': 3, ...}\n```\n\n## Features\n\n- **Flexible Code Lookup**: Handles codes with or without dots (e.g., \"01.30\" and \"0130\" return the same result)\n- **Fast Search**: Search for NACE codes by keywords in descriptions\n- **Complete Information**: Access full details including hierarchy level, parent codes, and validity dates\n- **Zero Dependencies**: Pure Python implementation with no external dependencies\n- **Included Data**: NACE codes data is bundled with the package\n\n## API Reference\n\n### Module-level Functions\n\n#### `get_description(code: str) -> Optional[str]`\nGet the plaintext description for a NACE code.\n\n#### `search_code(keyword: str, max_results: Optional[int] = None) -> List[Dict]`\nSearch for NACE codes containing a keyword. Returns a list of matching codes with their descriptions.\n\n#### `search_codes(keyword: str, max_results: Optional[int] = None) -> List[Dict]`\nAlias for `search_code()` that returns multiple results.\n\n#### `get_full_info(code: str) -> Optional[Dict]`\nGet complete information for a NACE code including level, parent code, notes, and validity dates.\n\n### NACEConverter Class\n\nFor more advanced usage, you can work directly with the `NACEConverter` class:\n\n```python\nfrom naceconverter import NACEConverter\n\nconverter = NACEConverter()\ndescription = converter.get_description(\"01.1\")\n```\n\n## Examples\n\n### Finding all codes related to agriculture\n```python\nimport naceconverter as nc\n\nresults = nc.search_code('agriculture')\nfor r in results:\n    print(f\"Code: {r['code']}, Level: {r['level']}, Description: {r['description']}\")\n```\n\n### Getting parent-child relationships\n```python\nimport naceconverter as nc\n\ninfo = nc.get_full_info(\"01.11\")\nparent_code = info['parentCode']\nparent_info = nc.get_full_info(parent_code)\nprint(f\"Parent: {parent_info['name']}\")\n```\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package for converting NACE codes to descriptions and searching",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/alexandersen01/nace-converter-py",
        "Issues": "https://github.com/alexandersen01/nace-converter-py/issues",
        "Repository": "https://github.com/alexandersen01/nace-converter-py.git"
    },
    "split_keywords": [
        "nace",
        " codes",
        " economic",
        " activities",
        " classification",
        " converter",
        " europe"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "97c36252d18c811debc545a60c3756d352f138abe644efdf271f0c035fbd5e37",
                "md5": "c3532151c24116f901ae5def2fd1e534",
                "sha256": "a730aaa813c3098ac7bdf4b5c8cf9545afc4c7181eff0ec68c8f738ce2e30b71"
            },
            "downloads": -1,
            "filename": "naceconverter-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3532151c24116f901ae5def2fd1e534",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 29621,
            "upload_time": "2025-09-02T11:46:49",
            "upload_time_iso_8601": "2025-09-02T11:46:49.888930Z",
            "url": "https://files.pythonhosted.org/packages/97/c3/6252d18c811debc545a60c3756d352f138abe644efdf271f0c035fbd5e37/naceconverter-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e6b9b76f4ded8f507414a7db753590ac52209b25237331290cc65c02c96e0356",
                "md5": "45ef1c7867664dbbaf49def6e00a5101",
                "sha256": "38edd64941dcbb1cf8c5c8180c83f6d125730f95a0ee34aa37769c9bf227f8f0"
            },
            "downloads": -1,
            "filename": "naceconverter-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "45ef1c7867664dbbaf49def6e00a5101",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 32646,
            "upload_time": "2025-09-02T11:46:51",
            "upload_time_iso_8601": "2025-09-02T11:46:51.503817Z",
            "url": "https://files.pythonhosted.org/packages/e6/b9/b76f4ded8f507414a7db753590ac52209b25237331290cc65c02c96e0356/naceconverter-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-02 11:46:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexandersen01",
    "github_project": "nace-converter-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "naceconverter"
}
        
Elapsed time: 1.20416s