Skip to content

[Feature] Automate Flickr Data Fetching #164

Description

@SaurabhCodesAI

Caution

Because it requires a paid subscription (Flickr Pro), Flickr is not currently a viable data source.

Problem

I've been exploring the codebase and noticed that Flickr data collection is still in pre-automation/flickr/ while other sources like Google Custom Search and GitHub have been automated. The current Flickr scripts appear to be manual and haven't been integrated with the automated pipeline yet.

Description

Looking at pre-automation/flickr/photos.py, it currently:

  • Searches for photos with different Creative Commons licenses (IDs: 1,2,3,4,5,6,9,10)
  • Gets 500 photos per license
  • Saves everything to a JSON file

I noticed some differences compared to the automated scripts:

  • Output: Flickr uses JSON, but GCS/GitHub use CSV
  • Arguments: The automated scripts have --enable-save, --enable-git etc.
  • Setup: Automated scripts use shared.setup() instead of the old quantify.setup()
  • Integration: They integrate with git automation and quarterly folders

The Pipfile already mentions flickrapi and has a planned script path: flickr_fetched = "./scripts/1-fetch/flickr_fetched.py"

Implementation Plan

Following the guidance to plan each phase before implementation, and after studying the 2025Q3 report structure:

Research Findings

The GCS report is way more detailed than I expected, it's not just counting licenses, but showing breakdowns by different countries, languages, and grouping licenses into categories. All the charts look the same with bars on the left and pie charts on the right, and they use the same colors throughout.

Looking at this made me understand why planning carefully is important, with such a large Flickr dataset, I could easily collect tons of data that doesn't actually help with making useful reports.

Fetch Phase

Build new automation (using pre-automation as reference only):

  • Create scripts/1-fetch/flickr_fetch.py following the same pattern as gcs_fetch.py
  • Use the same setup method, save to CSV files, same command options
  • Focus on collecting data that will actually be useful for the reporting phase
  • Get license types (1,2,3,4,5,6,9,10) plus any metadata that supports analysis

Process Phase

Transform data to support reporting:

  • Map Flickr license IDs to actual CC license names and versions using the Flickr API reference
  • Group licenses the same way as GCS (Latest/Prior/Retired categories)
  • Process any geographic or language data to match the report structure
  • Make sure everything aligns with what will actually be shown in charts

Report Phase

Create visualizations that add value:

  • License distribution analysis (similar to GCS "Products totals")
  • Status breakdown (Latest/Prior/Retired)
  • Geographic or language analysis if the data supports it
  • Focus on analyses that make sense for visual content

Next Steps

I'd like to start by understanding the license mapping and what kinds of reports would be most useful. Then build the fetch script to collect only the data that will actually be used in reporting.

This way I can avoid doing a lot of fetch work that won't end up being helpful for the final reports.

Alternatives

  • Build Flickr automation following a different pattern than GCS/GitHub
  • Focus on other data sources first and return to Flickr later
  • Start with a smaller subset of licenses to test the approach

Additional Context

  • I'm still learning the codebase patterns, but I can see the structure used by other automated sources
  • The scripts use Creative Commons license IDs that Flickr recognizes
  • Currently limited to 500 photos per license and outputs to JSON format
  • Could potentially be modernized to follow the pattern used by other automated sources in scripts/1-fetch/
  • Pre-automation effort:

Activity

  1. oree-xx commented on Oct 10, 2025

    @oree-xx
    Contributor

    Hi @SaurabhCodesAI I just like to share some insight. So contribute to the project now, you would follow the structure of the three phase process of fetching, processing and reporting the data which in under the script directory. So from the pre automation code you have gotten some insights on how flickr api works and all, you just need to adapt it to the structure of gcs_fetch.py or github_fetch.py which has the best practices to implement the flickr data source.

  2. TimidRobot commented on Oct 10, 2025

    @TimidRobot
    Member

    @SaurabhCodesAI Yes, adding Flickr would be helpful.

    Please note that the nothing in the pre-automation/ directory is currently used (is is there as a reference, not a manual approach).

  3. moved this from Triage to Backlog in TimidRoboton Oct 10, 2025
  4. TimidRobot commented on Oct 10, 2025

    @TimidRobot
    Member

    @SaurabhCodesAI Also, the Flickr dataset is quite large. I recommend documenting what will be done in each phase (fetch, process, report) prior to implementation. It would be easy to do a lot of fetch work that wouldn't be merged because it isn't helpful for reporting.

  5. SaurabhCodesAI commented on Oct 10, 2025

    @SaurabhCodesAI
    ContributorAuthor

    Thank you @TimidRobot! Really excited to work on this.

    @oree-xx thanks for the tip about following the three phase structure!

    Got it about the pre automation directory being reference only, that makes much more sense now. And your point about planning before implementation is really important , I don't want to fetch a bunch of data that won't be useful for reporting.

    I'll put together a planning document covering what to do in each phase. Should I post that here or create a separate issue for it?

    Also, would it help if I look at the existing GCS/GitHub reports first to understand what kind of output we're aiming for?

    Thanks for the guidance!

  6. TimidRobot commented on Oct 10, 2025

    @TimidRobot
    Member

    @SaurabhCodesAI I think here in this issue is a good place to post your plan.

    The most recent report is here: https://github.com/creativecommons/quantifying/tree/main/data/2025Q3

  7. SaurabhCodesAI commented on Oct 10, 2025

    @SaurabhCodesAI
    ContributorAuthor

    Thanks for the report link @TimidRobot , I'm going through the 2025Q3 analysis to understand the structure and will put together the planning document. Should have it ready soon.

  8. SaurabhCodesAI commented on Oct 13, 2025

    @SaurabhCodesAI
    Author
  9. TimidRobot commented on Oct 14, 2025

    @TimidRobot
    Member

    Key question: How should I map Flickr license IDs to match the CC license classification used in reports?

    Yes. See https://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html

  10. TimidRobot commented on Oct 14, 2025

    @TimidRobot
    Member

    @SaurabhCodesAI Also, I prefer that you edit the description instead of replacing it with a comment.

  11. SaurabhCodesAI commented on Oct 14, 2025

    @SaurabhCodesAI
    ContributorAuthor

    Thanks for the API link @TimidRobot! I've updated the issue description as you suggested.

    I studied the license mapping and I'm ready to start building the fetch script following the gcs_fetch.py pattern.

    Could you assign this issue to me? I'd like to get started on the implementation and should have some initial progress to show soon.

    Let me know if there are any specific priorities I should focus on first.

  12. SaurabhCodesAI commented on Oct 14, 2025

    @SaurabhCodesAI
    ContributorAuthor

    Hi @TimidRobot,

    I've been working on this implementation over the past few days following your guidance. I'm ready to submit a PR shortly.

    I noticed PR #194 was also submitted for this issue. While reviewing both implementations, I wanted to clarify the scope to ensure we're aligned with the project requirements.

    Scope Question:
    The pre automation reference (pre-automation/flickr/photos.py line 39) shows 8 license IDs: {1, 2, 3, 4, 5, 6, 9, 10}. Should the automation include all 8 of these licenses?

    License Names:
    I cross referenced the official Flickr API documentation (https://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html) for the exact license name format. Just wanted to confirm this is the preferred source for naming consistency.

    My Implementation:
    I've completed an implementation that:

    • Includes all 8 CC licenses (1, 2, 3, 4, 5, 6, 9, 10)
    • Uses license names from the official Flickr API documentation
    • Follows the patterns from github_fetch.py and gcs_fetch.py
    • Tested successfully in dev mode with CSV output generation

    Note: I wasn't able to test with live Flickr API as they now require a PRO subscription for API access. The code follows established patterns and should work once credentials are available.

    I'll submit my PR for review. Happy to collaborate with @chrisjindu if needed to ensure we get the best solution merged!

    Thanks!

  13. added 3 commits that reference this issue on Oct 14, 2025
    c602696
    62cb7e3
    fd8e294
  14. TimidRobot commented on Oct 15, 2025

    @TimidRobot
    Member

    Unfortunately, the Flickr API documentation is out of date:

    Their Help Center has more current information:

    Because it requires a paid subscription (Flickr Pro), Flickr is not currently a viable data source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ goal: improvementImprovement to an existing feature💻 aspect: codeConcerns the software code in the repository🚧 status: blockedBlocked & therefore, not ready for work🟩 priority: lowLow priority and doesn't need to be rushed

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions