--- id: pyhocon version: "0.3.63" license: Apache License 2.0 license_treatment: permissive maintenance: active --- # pyhocon — HOCON parser for Python License: permissive · Maintenance: active · Downloads: 4.9M/mo ## What it is and what it does pyhocon is a Python parser for HOCON, a configuration language that extends JSON with comments, variable substitution, includes, and a more human-friendly syntax. It reads HOCON files and returns them as nested Python dictionaries where values are automatically typed (strings, integers, booleans, lists, etc.) and can be accessed via dot-notation paths, dictionary keys, or typed getter methods like `get_string()` and `get_int()`. The package handles HOCON's key features: environment variable substitution (e.g., `${HOME}`), file and URL includes with merge semantics, duration/period parsing, and conversion to JSON, YAML, or .properties formats via a command-line tool. It depends only on pyparsing for its parsing logic and has been actively maintained since 2015, supporting Python 3.7 through 3.12. Use it for: - Loading application configuration from HOCON files with automatic type inference and environment variable substitution - Converting HOCON config files to JSON, YAML, or .properties formats for use in other tools or languages - Building configuration hierarchies with includes and merging, where one config file can include and override settings from another - Accessing nested configuration values using dot-notation paths without manually navigating nested dictionaries - Parsing duration and period values from configuration files into Python timedelta objects ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses HOCON (Human-Optimized Config Object Notation) configuration files into Python dictionaries with automatic type inference, supporting nested access, environment variable substitution, and file includes. Yes, if you need to parse HOCON configuration files in Python. The package is actively maintained, has no known vulnerabilities, and covers the HOCON spec well. Install friction is moderate due to source-only distribution, but this is a one-time setup cost. The permissive Apache 2.0 license poses no restrictions for most use cases. ## Install pip install pyhocon uv add pyhocon poetry add pyhocon ## Installing pyhocon Before you install: High install friction due to source distribution only (no wheels). The package is actively maintained with a recent release and no known vulnerabilities, but installation may require a C compiler or build tools on some systems. License in practice: Licensed under Apache License 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers. Quickstart: pip install pyhocon from pyhocon import ConfigFactory conf = ConfigFactory.parse_file('config.conf') host = conf.get_string('databases.mysql.host') port = conf['databases.mysql.port'] Installation from source; a C compiler or build tools may be required depending on your system. Verify before relying: - Whether pyparsing version constraints exist or if any version of pyparsing works - Performance characteristics when parsing large or deeply nested HOCON files - Completeness of HOCON spec coverage beyond the documented differences (nanoseconds, months/years, m suffix) ## Package facts - License: Apache License 2.0 (permissive) - Python support: unspecified - Install friction: high - Maintenance: active - Downloads: 4.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags hocon parser python, config file parsing, nested configuration management, typesafe config python, environment variable substitution config, configuration file format conversion, hocon to json converter, config-management, hocon, data-serialization [View on SkillFed](https://skillfed.io/packages/pyhocon) · [View on PyPI](https://pypi.org/project/pyhocon/)