{"id":24689535,"url":"https://github.com/noaa-oar-arl/fyaml","last_synced_at":"2025-08-13T18:48:05.950Z","repository":{"id":264884358,"uuid":"894274516","full_name":"noaa-oar-arl/Fyaml","owner":"noaa-oar-arl","description":"Very lightweight native fortran yaml parser ","archived":false,"fork":false,"pushed_at":"2025-01-23T15:54:32.000Z","size":1238,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T18:17:12.642Z","etag":null,"topics":["fortran","yaml","yaml-parser"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noaa-oar-arl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-26T04:15:54.000Z","updated_at":"2025-01-23T13:49:47.000Z","dependencies_parsed_at":"2025-01-08T20:26:28.618Z","dependency_job_id":"9903a56a-268a-4d1e-a4ea-d51a7ba97e4c","html_url":"https://github.com/noaa-oar-arl/Fyaml","commit_stats":null,"previous_names":["bbakernoaa/fyaml","noaa-oar-arl/fyaml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noaa-oar-arl%2FFyaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noaa-oar-arl%2FFyaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noaa-oar-arl%2FFyaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noaa-oar-arl%2FFyaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noaa-oar-arl","download_url":"https://codeload.github.com/noaa-oar-arl/Fyaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885514,"owners_count":20526293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","yaml","yaml-parser"],"created_at":"2025-01-26T18:12:42.550Z","updated_at":"2025-08-13T18:48:05.919Z","avatar_url":"https://github.com/noaa-oar-arl.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FYAML - Fortran YAML Parser\n\n![Build Status](https://github.com/fyaml/fyaml/workflows/CI/badge.svg)\n![Coverage](https://github.com/fyaml/fyaml/workflows/Code%20Coverage/badge.svg)\n\nA comprehensive and modern Fortran library for parsing YAML configuration files. FYAML provides an easy-to-use interface for reading YAML files in Fortran applications, supporting all major YAML features including nested structures, arrays, anchors, and aliases.\n\n## Quality Assurance\n\nFYAML maintains high code quality standards:\n\n- ⚠️ **Zero Warnings**: Compiles cleanly with strict compiler flags (`-Wall -Wextra -pedantic`)\n- 🧪 **Comprehensive Testing**: 89.4% code coverage with 18 specialized test programs\n- 🔄 **Continuous Integration**: Automated testing across multiple platforms and compilers\n- 📊 **Performance Tested**: Handles large files and complex structures efficiently\n- 🎯 **API Complete**: All public functions thoroughly tested with edge cases\n- 🔧 **Multi-Compiler**: Tested with GCC, Intel ifx/ifort, NVIDIA HPC, and LFortran\n\n## Features\n\n- 🚀 **Modern Fortran**: Written in standard-compliant Fortran 2003+\n- 📝 **YAML Compliance**: Supports YAML 1.2 specification\n- 🔧 **Easy Integration**: Simple CMake and pkg-config support\n- 📦 **Package Manager Ready**: Spack package available for HPC environments\n- 🧪 **Well Tested**: Comprehensive test suite with 89.4% overall coverage\n- ⚠️ **Warning-Free**: Zero compiler warnings with strict compilation flags\n- 🏭 **Multi-Compiler**: Supports GCC, Intel (ifx/ifort), NVIDIA HPC SDK, LFortran\n- 📚 **Documented**: Complete API documentation and user guides\n- 🔗 **Anchors \u0026 Aliases**: Full support for YAML references\n- 📊 **Arrays \u0026 Objects**: Handle complex nested data structures\n- ⚡ **Performance**: Optimized for large configuration files\n- 🔍 **Robust Testing**: 18 test programs covering all API functions and edge cases\n\n## Quick Start\n\n### Installation\n\n#### From Source\n\n```bash\ngit clone https://github.com/fyaml/fyaml.git\ncd fyaml\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_INSTALL_PREFIX=/usr/local\nmake install\n```\n\n#### Using Spack\n\n[Spack](https://spack.io/) is the preferred method for HPC and scientific computing environments:\n\n```bash\n# Basic installation\nspack install fyaml\n\n# With variants\nspack install fyaml +tests +shared\n\n# Load into environment\nspack load fyaml\n```\n\nSee [SPACK_SETUP.md](SPACK_SETUP.md) for detailed Spack installation instructions.\n\n#### Package Managers\n\n- **Spack**: `spack install fyaml` (recommended for HPC)\n- **Source**: CMake-based build system\n- **Future**: Additional package managers coming soon\n\n### Basic Usage\n\n```fortran\nprogram example\n    use fyaml\n    implicit none\n\n    type(fyaml_t) :: yml\n    integer :: max_iterations, rc\n    real(fyaml_yp) :: tolerance\n    character(len=fyaml_StrLen) :: output_file\n    integer, dimension(3) :: grid_size\n\n    ! Add configuration values\n    call fyaml_add(yml, \"solver%max_iterations\", 1000, \"Maximum iterations\", rc)\n    call fyaml_add(yml, \"solver%tolerance\", 1.0e-6_fyaml_yp, \"Convergence tolerance\", rc)\n    call fyaml_add(yml, \"output%file\", \"results.dat\", \"Output filename\", rc)\n    call fyaml_add(yml, \"grid%size\", [100, 100, 50], \"Grid dimensions\", rc)\n\n    ! Read configuration values back\n    call fyaml_get(yml, \"solver%max_iterations\", max_iterations, rc)\n    call fyaml_get(yml, \"solver%tolerance\", tolerance, rc)\n    call fyaml_get(yml, \"output%file\", output_file, rc)\n    call fyaml_get(yml, \"grid%size\", grid_size, rc)\n\n    ! Clean up\n    call fyaml_cleanup(yml)\nend program\n```\n\n## Compiler Support\n\nFYAML is tested and verified to work with multiple Fortran compilers:\n\n| Compiler | Vendor | Versions Tested | CI Status |\n|----------|---------|----------------|-----------|\n| **GFortran** | GNU | 11, 12, 13, 14 | ✅ Fully Tested |\n| **ifx** | Intel | 2025.0+ | ✅ Fully Tested |\n| **ifort** | Intel (Classic) | 2021.10+ | ✅ Fully Tested |\n| **nvfortran** | NVIDIA HPC SDK | 25.1+ | ✅ Fully Tested |\n| **LFortran** | LFortran | 0.45.0+ | ⚠️ Manual Testing |\n\n**Cross-Platform Testing:**\n- 🐧 **Linux**: Ubuntu 24.04 (primary CI platform)\n- 🍎 **macOS**: macOS 14+ (GCC) - CI tested\n- 🪟 **Windows**: Windows Server 2022 (GCC) - Manual testing\n\nPrimary compilers (GCC, Intel, NVIDIA HPC) are automatically tested in CI with both Debug and Release configurations.\n\n## Building and Testing\n\n### Standard Build (Library Only)\n\nBy default, FYAML builds only the library without tests, making it suitable for production use and package installation:\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n### With Tests\n\nTo build and run the comprehensive test suite:\n\n```bash\ncmake .. -DBUILD_TESTING=ON\nmake\nctest --output-on-failure\n```\n\n### Legacy Test Option\n\nFor compatibility with older scripts, you can also use:\n\n```bash\ncmake .. -DFYAML_BUILD_TESTS=ON  # Legacy alias for BUILD_TESTING\nmake\nctest --output-on-failure\n```\n\n**Test Suite Overview:**\n- 🧪 **18 comprehensive test programs** covering all functionality\n- ✅ **100% test pass rate** - all tests consistently pass\n- 🔍 **API Coverage**: Complete testing of `fyaml_add`, `fyaml_get`, `fyaml_update`, `fyaml_add_get`\n- 📊 **Data Types**: Full coverage for integers, reals, booleans, strings (scalars and arrays)\n- 🎯 **Edge Cases**: Comprehensive testing of boundary conditions and error paths\n- 📈 **Array Testing**: Various sizes, patterns, and multidimensional-like structures\n\n### Code Coverage\n\nTo generate code coverage reports:\n\n```bash\n# Install coverage tools (Ubuntu/Debian)\nsudo apt-get install lcov\n\n# Configure with coverage\ncmake .. -DFYAML_ENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug\n\n# Build and run tests\nmake\nctest\n\n# Generate coverage report\nmake coverage\n```\n\nThis will create an HTML coverage report in `coverage-html/` that you can open in your browser.\n\n### GitHub Actions\n\nThe project includes automated testing and deployment:\n\n- **CI Workflow**: Automatically builds with tests enabled (`-DBUILD_TESTING=ON`) and tests on multiple platforms and compilers\n- **Coverage Workflow**: Generates coverage reports and uploads them as artifacts\n- **Documentation**: Automatically builds and deploys to GitHub Pages on every push to main\n\n**Note**: While tests are disabled by default for end-user builds, they are automatically enabled in all CI/CD workflows to ensure code quality and compatibility across different platforms and compilers.\n\nCoverage reports are automatically generated for pull requests and can be downloaded as artifacts from the GitHub Actions page. Documentation is automatically published at https://noaa-oar-arl.github.io/fyaml/\n\n## CMake Integration\n\n### Using find_package\n\n```cmake\nfind_package(FYAML REQUIRED)\ntarget_link_libraries(your_target PRIVATE FYAML::fyaml)\n```\n\n### Using pkg-config\n\n```cmake\nfind_package(PkgConfig REQUIRED)\npkg_check_modules(FYAML REQUIRED fyaml)\ntarget_link_libraries(your_target PRIVATE ${FYAML_LIBRARIES})\ntarget_include_directories(your_target PRIVATE ${FYAML_INCLUDE_DIRS})\n```\n\n## Documentation\n\n- 📖 **[User Guide](https://noaa-oar-arl.github.io/fyaml/user-guide/)**: Complete usage examples\n- 🔧 **[API Reference](https://noaa-oar-arl.github.io/fyaml/api/)**: Detailed function documentation\n- 🏗️ **[Developer Guide](https://noaa-oar-arl.github.io/fyaml/developer/)**: Contributing and architecture\n- 🚀 **[Getting Started](https://noaa-oar-arl.github.io/fyaml/getting-started/)**: Installation and first steps\n- 📦 **[Spack Installation](SPACK_SETUP.md)**: HPC package manager integration\n\n## Examples\n\nSee the `examples/` directory for complete working examples:\n\n- `example.f90`: Simple configuration parsing and basic usage\n- Advanced features: Anchors, arrays, and complex structures (see test files)\n- CMake integration: Example project setup\n\n**Key Test Programs:**\n- `test_api_functions.f90`: Comprehensive API testing (461 lines, 99.8% coverage)\n- `test_comprehensive_arrays.f90`: Complete array testing (174 lines, 100% coverage)\n- `test_edge_cases.f90`: Boundary conditions and error handling (65 lines, 100% coverage)\n- Plus 15 additional specialized test programs covering all functionality\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](https://fyaml.github.io/fyaml/developer/contributing/) for details on:\n\n- Code style and standards\n- Testing requirements\n- Pull request process\n- Development setup\n\n### Recent Improvements\n\n**Code Quality Enhancements:**\n- ✅ Eliminated all compiler warnings (intent overlap, unused variables, string truncation)\n- 📈 Increased test coverage from ~44% to 89.4% overall\n- 🎯 Enhanced main API coverage to 74.4% (fyaml.f90)\n- 🧪 Added 3 major comprehensive test suites\n\n**New Test Coverage:**\n- `test_api_functions.f90`: Complete API function testing with all data types\n- `test_comprehensive_arrays.f90`: Extensive array testing (single to large arrays)\n- `test_edge_cases.f90`: Boundary conditions and error path validation\n- Full round-trip testing: add → get → update → verify workflows\n\n### Development Setup\n\n```bash\n# Clone and setup development environment\ngit clone https://github.com/fyaml/fyaml.git\ncd fyaml\n\n# Install dependencies (Ubuntu/Debian)\nsudo apt-get install gfortran cmake\n\n# macOS with Homebrew\nbrew install gcc cmake\n\n# Build with all options enabled\nmkdir build \u0026\u0026 cd build\ncmake .. -DBUILD_TESTING=ON -DFYAML_ENABLE_COVERAGE=ON\nmake\n\n# Run full test suite\nctest --output-on-failure\n\n# Generate coverage report (requires GCC)\nmake coverage\n```\n\n### Coverage Testing\n\nFYAML includes comprehensive coverage testing using `gcov`. To run coverage analysis:\n\n```bash\n# Using the provided script (macOS with Homebrew)\n./scripts/run_coverage.sh\n\n# Or manually\nmkdir build-coverage \u0026\u0026 cd build-coverage\ncmake .. -DFYAML_ENABLE_COVERAGE=ON -DBUILD_TESTING=ON\nmake coverage\n```\n\n**Current Coverage Statistics:**\n- 📊 **Overall Project**: 89.4% coverage (2,474 of 2,767 lines executed)\n- 🎯 **Main API Module**: 74.4% coverage (fyaml.f90 - 484 of 651 lines executed)\n- ✅ **Test Files**: Near 100% coverage across all test programs\n- 🔍 **Key Modules**: High coverage across all critical components\n\nCoverage reports are generated as `.gcov` files showing line-by-line execution data. Lines marked with `#####` indicate code that wasn't executed and may need additional test coverage.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- 🐛 **Issues**: [GitHub Issues](https://github.com/fyaml/fyaml/issues)\n- 💬 **Discussions**: [GitHub Discussions](https://github.com/fyaml/fyaml/discussions)\n- 📧 **Email**: [maintainers@fyaml.org](mailto:maintainers@fyaml.org)\n\n## Acknowledgments\n\n- Thanks to all contributors who have helped improve FYAML\n- Inspired by modern YAML parsers in other languages\n- Built with modern Fortran best practices\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoaa-oar-arl%2Ffyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoaa-oar-arl%2Ffyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoaa-oar-arl%2Ffyaml/lists"}