Skip to content

mctlisboa/pgc-angola

Repository files navigation

Plano Geral de Contabilidade (PGC) - Angola

License: MIT Status: Production Ready

Complete Angolan Chart of Accounts (Plano Geral de Contabilidade) in multiple formats ready for integration into accounting software.

πŸ“‹ Overview

This repository contains the Plano Geral de Contabilidade (PGC) - Angola's official Chart of Accounts, extracted from Decreto nΒΊ 82/01 de 16 de Novembro and converted into multiple machine-readable formats.

Key Features:

  • βœ… 767 accounts across 9 classes
  • βœ… Multiple formats: JSON (hierarchical & flat), CSV, Markdown
  • βœ… QuickBooks ready: Direct import files included
  • βœ… Validated structure: All accounts verified and cross-checked
  • βœ… Bilingual: Portuguese names with English descriptions

πŸš€ Quick Start

Use in Your Application

Hierarchical JSON (for tree views):

const pgc = require('./pgc_chart_of_accounts.json');
// Access: pgc.classes[0].accounts[0].children

Flat JSON (for database imports):

import json
accounts = json.load(open('pgc_chart_of_accounts_flat.json'))
# Each account has: code, name, description, level, parent, type

QuickBooks Import (ready-to-use CSV files):

  1. Open QuickBooks Desktop
  2. Go to Lists β†’ Chart of Accounts β†’ Account β†’ Import from Excel
  3. Select the appropriate level CSV file from quickbooks/ folder
  4. Follow the import wizard

See QuickBooks Import Guide for detailed instructions.

πŸ“ Repository Structure

pgc/
β”œβ”€β”€ README.md                              # This file
β”œβ”€β”€ LICENSE                                 # MIT License
β”‚
β”œβ”€β”€ Output Files (Use These)
β”œβ”€β”€ pgc_chart_of_accounts.json             # Hierarchical JSON structure
β”œβ”€β”€ pgc_chart_of_accounts_flat.json        # Flat JSON structure
β”œβ”€β”€ pgc_chart_of_accounts.md               # Human-readable documentation
β”‚
β”œβ”€β”€ QuickBooks Import
β”œβ”€β”€ quickbooks/
β”‚   β”œβ”€β”€ README.md                           # QuickBooks import instructions
β”‚   β”œβ”€β”€ pgc_quickbooks_validated_level_1_import.csv
β”‚   β”œβ”€β”€ pgc_quickbooks_validated_level_2_import.csv
β”‚   β”œβ”€β”€ pgc_quickbooks_validated_level_3_import.csv
β”‚   β”œβ”€β”€ pgc_quickbooks_validated_level_4_import.csv
β”‚   └── pgc_quickbooks_validated_level_5_import.csv
β”‚
β”œβ”€β”€ Scripts (Development)
β”œβ”€β”€ parse_pgc_improved.py                  # Parser script
β”œβ”€β”€ generate_markdown.py                   # Markdown generator
β”œβ”€β”€ validate_pgc.py                        # Validation script
β”‚
β”œβ”€β”€ Source Files
β”œβ”€β”€ pgc.txt                                # Original text file
└── docs/
    β”œβ”€β”€ pgc.pdf                            # Original decree PDF
    β”œβ”€β”€ README_PGC_CHART.md                # Detailed technical documentation
    └── IMPLEMENTATION_SUMMARY.md          # Implementation notes

πŸ“Š The 9 Classes

Code Name Accounts Description
1 Meios fixos e investimentos 85 Fixed assets and investments
2 ExistΓͺncias 34 Inventories
3 Terceiros 210 Third parties (customers, suppliers, etc.)
4 Meios monetΓ‘rios 47 Monetary assets (cash, banks, etc.)
5 Capital e reservas 17 Equity
6 Proveitos e ganhos por natureza 153 Income and gains by nature
7 Custos e perdas por natureza 179 Costs and losses by nature
8 Resultados 42 Results
9 Contabilidade AnalΓ­tica 0 Management accounting (optional)

🎯 Use Cases

For Software Developers

  • Import the chart of accounts into your accounting software
  • Use hierarchical JSON for tree-view UI components
  • Use flat JSON for database imports and SQL operations

For Accountants

  • Reference complete PGC structure
  • Import directly into QuickBooks or similar software
  • Understand the Angolan accounting framework

For Businesses

  • Set up accounting system with official Angola COA
  • Ensure compliance with Angolan accounting standards
  • Customize with entity-specific sub-accounts

πŸ“– Documentation

πŸ”§ Development

Regenerate from Source

# Parse source and create JSON files
python3 parse_pgc_improved.py

# Generate markdown documentation
python3 generate_markdown.py

# Validate all outputs
python3 validate_pgc.py

Requirements

  • Python 3.7+
  • No external dependencies required (uses standard library only)

πŸ’Ύ Output Formats

1. Hierarchical JSON (pgc_chart_of_accounts.json)

  • Nested structure with parent-child relationships
  • Best for: Tree-view displays, drill-down interfaces
  • Size: ~200KB

2. Flat JSON (pgc_chart_of_accounts_flat.json)

  • Flat list with parent references
  • Best for: Database imports, SQL inserts
  • Size: ~150KB
  • 711 entries (9 classes + 702 accounts)

3. Markdown Documentation (pgc_chart_of_accounts.md)

  • Human-readable documentation
  • Table of contents with links
  • Hierarchical tables for each class

4. QuickBooks CSV Files (quickbooks/*.csv)

  • 5 separate files for each account level
  • Ready for direct import into QuickBooks Desktop
  • Validated format and structure

βœ… Quality Assurance

All outputs have been validated for:

  • βœ… Complete 9-class structure
  • βœ… Zero duplicate codes
  • βœ… Numerical sequence integrity
  • βœ… Valid parent-child relationships
  • βœ… Consistency across all formats

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

The Plano Geral de Contabilidade is based on Decreto nΒΊ 82/01 de 16 de Novembro (official Angolan government decree).

πŸ™ Acknowledgments

  • Based on the official Angolan PGC (Decreto nΒΊ 82/01)
  • Parsed and structured for modern software integration
  • Validated against official source documents

πŸ“ž Support

For questions or issues:

  1. Check the documentation
  2. Review the implementation summary
  3. Open an issue on GitHub

Generated: 2025
Version: 1.0
Status: Production Ready βœ…

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages