foss_photo_libraries

Contribution Guidelines

To contribute a project or feature, you should only need to make changes to projects.json.

Steps

  1. Make changes to projects.json (take note of the project structure)

  2. Re-generate the README.md file:

  python3 generate_table.py
  1. Run the test suite:
  python3 -m pytest test_generate_table.py -v
  1. Submit your pull request

Files

For more involved contributions a description of the main project files are:

Project Data Structure

The projects.json file contains two main sections:

1. Projects Array

Each project requires these mandatory fields:

Optional standard fields:

Feature fields: Any feature defined in the features array can be added as:

Example:

{
  "name": "ProjectName",
  "repo": "owner/repo",
  "branch": "main",
  "logo_url": "https://...",
  "logo_alt": "Project Logo",
  "license_custom": "GPL-3.0",
  "web_app": "8",
  "web_app_url": "https://demo.example.com",
  "ios_app": "x",
  "ios_app_url": "https://github.com/owner/repo/issues/123"
  ...
}

2. Features Array

Each feature defines a row in the comparison table:

{
  "name": "Feature Name",
  "link": "features.md#feature-anchor",
  "processor": "generate_default_row",
  "description": "Feature description"
}

Processor Types:

Score Value Conversion

The system automatically converts score values to an emoji representation:

Data Validation

The validate_projects_json() function ensures data integrity:

Required Fields Check: Validates all projects have name, repo, logo_url, logo_alt ✅ Unmapped Keys Detection: Identifies project keys not mapped to any feature ✅ Error Aggregation: Collects all errors before reporting ✅ Detailed Error Messages: Shows which projects have which unmapped keys

Example validation output:

projects.json validation FAILED:
Project 'App1' is missing fields: {'repo'}
Found 2 project key(s) not mapped to any feature:
  • 'invalid_key_1' in: App1, App3
  • 'another_bad_key' in: App3

Adding New Features

To add a new feature to the comparison table:

  1. Add feature definition to projects.json:
    {
      "features": [
     {
       "name": "New Feature",
       "link": "features.md#new-feature",
       "description": "Description of the feature"
     }
      ]
    }
    
  2. Add feature values to projects:
    {
      "projects": [
     {
       "name": "ProjectName",
       "new_feature": "8",
       "new_feature_url": "https://example.com/feature"
     }
      ]
    }
    
  3. Regenerate README:
    python3 generate_table.py
    

The system automatically converts feature names (e.g., “New Feature” → “new_feature”) and handles score-to-emoji conversion.

Custom Processors

For specialized row formatting, implement a custom processor in generate_table.py:

def generate_custom_row(projects):
    """Generate a custom-formatted row."""
    row = "| [Feature Name](/foss_photo_libraries/features.html#anchor) "

    for project in projects:
        value = project.get('feature_key', '❌')
        # Custom formatting logic here
        row += f"| {value} "

    row += "|\n"
    return row

Then reference it in the feature definition:

{
  "name": "Custom Feature",
  "processor": "generate_custom_row"
}

CI/CD Integration

The project includes GitHub Actions workflow (.github/workflows/mega-linter.yml) that:

Template Customization

Edit readme.tpl to change the static content around the table. The placeholder `` will be replaced with the generated table.