A Python SDK Library for working with the International Standard Industrial Classification of All Economic Activities (ISIC), Revision 4.
Project description
ISIC4Kit
A Python SDK Library for working with the International Standard Industrial Classification of All Economic Activities (ISIC), Revision 4.
Features
- Search and navigate through the ISIC hierarchical structure
- Support for multiple languages (English, Arabic, and more coming soon)
- Pydantic-based
- Easy to use
- Well-documented
- Tested and maintained
- Lightweight and fast
Structure
ISIC follows a hierarchical structure:
flowchart TD
Section[Section] --> Division[Division]
Division --> Group[Group]
Group --> Class[Class]
Section --> |contains| SectionDesc[Description]
Division --> |contains| DivisionDesc[Description]
Group --> |contains| GroupDesc[Description]
Class --> |contains| ClassDesc[Description]
Each level contains:
- Section: Highest level (A-U), e.g., "A" for Agriculture
- Division: Two-digit code (01-99)
- Group: Three-digit code (011-999)
- Class: Four-digit code (0111-9999)
Installation
Poetry (recommended)
poetry add isic4kit
pip
pip install isic4kit
Dependencies
- Python >=3.8, <4.0
- pydantic ^2.10.6
- pytest ^8.3.4
Usage
Basic Usage
from isic4kit import ISIC4Classifier
# Initialize classifier (English)
isic_en = ISIC4Classifier(language="en")
# Example 1: Get section (Agriculture)
section = isic_en.get_section("a")
# Access divisions directly
for division in section.divisions:
print(division.code, division.description)
# Access groups
for group in division.groups:
print(group.code, group.description)
# Access classes
for class_ in group.classes:
print(class_.code, class_.description)
# Or use the tree visualization
section.print_tree()
# Example 2: Get division (Crop and animal production)
division = isic_en.get_division("01")
division.print_tree()
# Example 3: Get group (Growing of non-perennial crops)
group = isic_en.get_group("011")
group.print_tree()
# Example 4: Get class (Growing of cereals)
class_ = isic_en.get_class("0111")
class_.print_tree()
Search Functionality
# Search for activities containing "mining"
results = isic_en.search("mining")
results.print_tree()
Multi-language Support
The classifier supports multiple languages. Here's an example in Arabic:
# Initialize with Arabic language
isic_ar = ISIC4Classifier(language="ar")
# Example 1: Get section (الزراعة)
section_ar = isic_ar.get_section("a")
section_ar.print_tree()
# Example 2: Get division (زراعة المحاصيل والإنتاج الحيواني)
division_ar = isic_ar.get_division("01")
division_ar.print_tree()
# Example 3: Get group (زراعة المحاصيل غير الدائمة)
group_ar = isic_ar.get_group("011")
group_ar.print_tree()
# Example 4: Get class (زراعة الحبوب)
class_ar = isic_ar.get_class("0111")
class_ar.print_tree()
# Example 5: Search in Arabic
search_ar = isic_ar.search("تعدين")
search_ar.print_tree()
Supported Languages
- English (en)
- Arabic (ar)
- More languages coming soon...
Data Structure
The ISIC data is organized in a hierarchical structure:
sections = [
{
"section": "A",
"description": "Agriculture, forestry and fishing",
"divisions": [
{
"division": "01",
"description": "Crop and animal production",
"groups": [
{
"group": "011",
"description": "Growing of non-perennial crops",
"classes": [
{
"class": "0111",
"description": "Growing of cereals"
},
# ...
]
},
# ...
]
},
# ...
]
},
# ...
]
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Contributors
References
-
United Nations Statistics Division. (2008). International Standard Industrial Classification of All Economic Activities (ISIC), Revision 4. English Version
-
United Nations Statistics Division. (2008). التصنيف الصناعي الدولي الموحد لجميع الأنشطة الاقتصادية، التنقيح 4. Arabic Version
-
Ministry of Commerce - Saudi Arabia. (2023). ISIC4 Guide. Source
-
Saudi Food and Drug Authority. (2023). Economic Activities Classification. Source
-
General Authority for Statistics - Saudi Arabia. (2023). ISIC4 Classification. Source
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isic4kit-0.0.1.tar.gz.
File metadata
- Download URL: isic4kit-0.0.1.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.0 CPython/3.12.0 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
316b6ecf66e59f04f3955e69f0e15782b6434a7751705c50024c652839927b5e
|
|
| MD5 |
d2c06e6882cc51367761420885ea7cbc
|
|
| BLAKE2b-256 |
efbeb40f8ac0bd13a57852346a1c744dc85034be6ec3309539f671c65dfe5251
|
File details
Details for the file isic4kit-0.0.1-py3-none-any.whl.
File metadata
- Download URL: isic4kit-0.0.1-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.0 CPython/3.12.0 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d3e5590a79f228c439d5333f2a57e55a864efd21beae7484659a94904459347
|
|
| MD5 |
7abe15e1be5272602d46e237a4ab61c1
|
|
| BLAKE2b-256 |
4a4daa362fd2d5e1579c3dce4bce170d7e40c21fef6cc2f0c70d3656a057d918
|