{"id":22157976,"url":"https://github.com/lucavallin/uppa","last_synced_at":"2025-10-05T03:40:12.970Z","repository":{"id":241410664,"uuid":"806768063","full_name":"lucavallin/uppa","owner":"lucavallin","description":"Unsplash Photo Performance Analyzer.","archived":false,"fork":false,"pushed_at":"2025-06-30T10:56:30.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T07:47:15.140Z","etag":null,"topics":["analyzer","data","photo","python","unsplash"],"latest_commit_sha":null,"homepage":"https://lucavall.in/photography","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucavallin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-05-27T21:31:34.000Z","updated_at":"2025-06-30T10:56:33.000Z","dependencies_parsed_at":"2024-05-28T07:43:10.692Z","dependency_job_id":"8f8c7315-1d0b-4b9c-81c6-05b22931b45e","html_url":"https://github.com/lucavallin/uppa","commit_stats":null,"previous_names":["lucavallin/uppa"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucavallin/uppa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucavallin%2Fuppa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucavallin%2Fuppa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucavallin%2Fuppa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucavallin%2Fuppa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucavallin","download_url":"https://codeload.github.com/lucavallin/uppa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucavallin%2Fuppa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270796219,"owners_count":24647319,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["analyzer","data","photo","python","unsplash"],"created_at":"2024-12-02T03:16:45.228Z","updated_at":"2025-10-05T03:40:07.267Z","avatar_url":"https://github.com/lucavallin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UPPA (Unsplash Photo Performance Analyzer)\n\nThis script analyzes the performance of your photos on Unsplash. It fetches your photos, calculates performance scores, identifies outliers, filters them, normalizes the scores, and generates a visualization.\n\n## What does this script do?\n\n1. **Fetch Photos from Unsplash**: Retrieves your photos using the Unsplash API.\n2. **Calculate Performance Scores**: Computes raw performance scores based on views per day and downloads per view.\n3. **Identify Upper Bound Outliers**: Uses the Interquartile Range (IQR) method to calculate the upper bound for outliers.\n4. **Filter Upper Bound Outliers**: Removes photos identified as upper bound outliers.\n5. **Recalculate Min and Max Scores**: Recalculates the minimum and maximum raw scores after removing outliers.\n6. **Normalize Scores**: Normalizes the scores of the remaining photos to a scale of 0 to 100.\n7. **Output Results**: Prints the normalized scores, generates a bar chart, and optionally saves the results to a JSON file.\n\n## Prerequisites\n\n- Python 3.x\n- `requests` library\n- `numpy` library\n- `matplotlib` library\n\nYou can install the required libraries using pip:\n\n```sh\npip install requests numpy matplotlib\n```\n\n## Setup\n\n1. **Unsplash API Access Key**: You need an Unsplash API access key. You can get it by registering as a developer on the Unsplash website.\n\n2. **Environment Variables**: Set the `UNSPLASH_ACCESS_KEY` and `UNSPLASH_USERNAME` environment variables with your Unsplash access key and username.\n\n### Setting Environment Variables\n\n#### On macOS/Linux:\n\nAdd the following lines to your `.bashrc` or `.bash_profile`:\n\n```sh\nexport UNSPLASH_ACCESS_KEY='your_unsplash_access_key'\nexport UNSPLASH_USERNAME='your_unsplash_username'\n```\n\nThen, source the file to apply the changes:\n\n```sh\nsource ~/.bashrc  # or source ~/.bash_profile\n```\n\n#### On Windows:\n\nSet the environment variables using the command line or through the System Properties dialog:\n\n```sh\nsetx UNSPLASH_ACCESS_KEY \"your_unsplash_access_key\"\nsetx UNSPLASH_USERNAME \"your_unsplash_username\"\n```\n\n## Usage\n\nRun the script using Python:\n\n```sh\npython uppa.py\n```\n\nThe script will:\n\n1. Check if `photos.json` exists. If it does, it will load photos from the file.\n2. If `photos.json` does not exist, it will fetch photos from Unsplash, save them to `photos.json`, and proceed.\n3. Calculate raw performance scores for each photo.\n4. Filter out photos with fewer than 30 days online.\n5. Identify and filter out upper bound outliers.\n6. Recalculate min and max scores and normalize the scores to a range of 0 to 100.\n7. Sort the photos by their normalized scores and print the results.\n8. Generate a bar chart showing the normalized scores of the photos.\n\n## Example Output\n\n```sh\nPhoto URL: https://unsplash.com/photos/abc123, Days Online: 45, Views: 1200, Downloads: 150, Normalized Score: 92.50\nPhoto URL: https://unsplash.com/photos/def456, Days Online: 60, Views: 1500, Downloads: 180, Normalized Score: 85.30\n...\n```\n\nA bar chart will also be displayed, visualizing the normalized scores of your photos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucavallin%2Fuppa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucavallin%2Fuppa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucavallin%2Fuppa/lists"}