{"id":49884055,"url":"https://github.com/kacpermajcher/firebase-product-uploader","last_synced_at":"2026-05-15T17:04:33.057Z","repository":{"id":324298195,"uuid":"1096753816","full_name":"KacperMajcher/firebase-product-uploader","owner":"KacperMajcher","description":"A Python script to batch-upload product data and images from a local folder/JSON to Firebase Storage and Firestore.","archived":false,"fork":false,"pushed_at":"2025-11-14T23:01:33.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-15T00:26:27.396Z","etag":null,"topics":["automation","firebase","firebase-storage","firestore","python","seeder","uploader"],"latest_commit_sha":null,"homepage":"","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/KacperMajcher.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-14T22:34:34.000Z","updated_at":"2025-11-14T23:01:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/KacperMajcher/firebase-product-uploader","commit_stats":null,"previous_names":["kacpermajcher/firebase-product-uploader"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/KacperMajcher/firebase-product-uploader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KacperMajcher%2Ffirebase-product-uploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KacperMajcher%2Ffirebase-product-uploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KacperMajcher%2Ffirebase-product-uploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KacperMajcher%2Ffirebase-product-uploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KacperMajcher","download_url":"https://codeload.github.com/KacperMajcher/firebase-product-uploader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KacperMajcher%2Ffirebase-product-uploader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33072971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automation","firebase","firebase-storage","firestore","python","seeder","uploader"],"created_at":"2026-05-15T17:04:32.055Z","updated_at":"2026-05-15T17:04:33.050Z","avatar_url":"https://github.com/KacperMajcher.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Firebase Seeder (Uploader)\n\nA flexible Python script to batch-upload product data (from a JSON file) and corresponding images to Cloud Firestore and Firebase Storage.\n\nThis project is separated into user-editable files and the core script logic:\n\n* **`config.py`**: **This is the main file you edit.** It contains all your project settings, paths, and data mapping logic.\n* **`products.json`**: An example data file. You can edit this or point `config.py` to a different JSON file.\n* **`uploader.py`**: The core script engine. **You don't need to edit this file.**\n* **`key.json`**: (You must add this) Your private Firebase Admin SDK key.\n\n---\n\n## Requirements\n\n* Python 3.x\n* A Google Firebase project\n* **Cloud Firestore** and **Firebase Storage** services enabled (requires \"Blaze\" plan, but the free tier is generous).\n\n---\n\n## 1. Installation\n\n1.  **Clone the repository:**\n    ```bash\n    git clone [YOUR_REPO_URL]\n    cd [YOUR_REPO_NAME]\n    ```\n\n2.  **Install the required library:**\n    ```bash\n    pip install firebase-admin\n    ```\n\n3.  **Get Your Service Account Key:**\n    1.  Go to your [Firebase Console](https://console.firebase.google.com/) -\u003e Project Settings -\u003e Service Accounts.\n    2.  Click **\"Generate new private key\"**.\n    3.  A `.json` file will be downloaded.\n    4.  Rename this file to match the `SERVICE_ACCOUNT_KEY` setting in `config.py` (default is **`key.json`**) and place it in the same folder as this script.\n\n    ⚠️ **CRITICAL: This key file is a secret.** The `.gitignore` file is set up to ignore `key.json`, but never share this file publicly.\n\n---\n\n## 2. Configuration\n\n**Open `config.py` and edit the variables:**\n\n* **`SERVICE_ACCOUNT_KEY`**: Path to your downloaded service account key (e.g., `'key.json'`).\n* **`BUCKET_NAME`**: Your Firebase Storage bucket URL (e.g., `'my-project.appspot.com'`).\n* **`LOCAL_IMAGES_PATH`**: The absolute path to the folder on your computer containing the images.\n* **`PRODUCTS_JSON_PATH`**: The name (or path) of the JSON file containing your data (e.g., `'products.json'`).\n* **`STORAGE_FOLDER`**: The folder name inside Firebase Storage where images will be uploaded (e.g., `'products'`).\n* **`COLLECTION_NAMES`**: A dictionary mapping the `type` field from your JSON to your Firestore collection names (e.g., `{ 'coffee': 'coffees', 'pastry': 'pastries' }`).\n* **`map_product_to_firestore` function**: This is the most powerful part. You can completely change the logic here to define *how* the data from your JSON should be structured (i.e., your \"data tree\") when it's saved to Firestore.\n\n---\n\n## 3. Data File\n\nOpen **`products.json`** (or your custom JSON file) and add your data.\n\n* It must be a valid JSON list `[ ... ]`.\n* Each object in the list must have an **`\"id\"`** key.\n* The `\"id\"` must match the name of the image file (e.g., `\"id\": \"Cappuccino\"` requires a `Cappuccino.png` file in your `LOCAL_IMAGES_PATH`).\n\n---\n\n## 4. Usage\n\nOnce `config.py` is set up and your `products.json` is ready:\n\n1.  Open your terminal in the script's folder.\n2.  Run the uploader:\n\n    ```bash\n    python uploader.py\n    ```\n\nThe script will handle the rest and show the progress in the terminal.# Python Firebase Seeder (Uploader)\n\nA flexible Python script to batch-upload product data (from a JSON file) and corresponding images to Cloud Firestore and Firebase Storage.\n\nThis project is separated into user-editable files and the core script logic:\n\n* **`config.py`**: **This is the main file you edit.** It contains all your project settings, paths, and data mapping logic.\n* **`products.json`**: An example data file. You can edit this or point `config.py` to a different JSON file.\n* **`uploader.py`**: The core script engine. **You don't need to edit this file.**\n* **`key.json`**: (You must add this) Your private Firebase Admin SDK key.\n\n---\n\n## Requirements\n\n* Python 3.x\n* A Google Firebase project\n* **Cloud Firestore** and **Firebase Storage** services enabled (requires \"Blaze\" plan, but the free tier is generous).\n\n---\n\n## 1. Installation\n\n1.  **Clone the repository:**\n    ```bash\n    git clone [YOUR_REPO_URL]\n    cd [YOUR_REPO_NAME]\n    ```\n\n2.  **Install the required library:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n3.  **Get Your Service Account Key:**\n    1.  Go to your [Firebase Console](https://console.firebase.google.com/) -\u003e Project Settings -\u003e Service Accounts.\n    2.  Click **\"Generate new private key\"**.\n    3.  A `.json` file will be downloaded.\n    4.  Rename this file to match the `SERVICE_ACCOUNT_KEY` setting in `config.py` (default is **`key.json`**) and place it in the same folder as this script.\n\n    ⚠️ **CRITICAL: This key file is a secret.** The `.gitignore` file is set up to ignore `key.json`, but never share this file publicly.\n\n---\n\n## 2. Configuration\n\n**Open `config.py` and edit the variables:**\n\n* **`SERVICE_ACCOUNT_KEY`**: Path to your downloaded service account key (e.g., `'key.json'`).\n* **`BUCKET_NAME`**: Your Firebase Storage bucket URL (e.g., `'my-project.appspot.com'`).\n* **`LOCAL_IMAGES_PATH`**: The absolute path to the folder on your computer containing the images.\n* **`PRODUCTS_JSON_PATH`**: The name (or path) of the JSON file containing your data (e.g., `'products.json'`).\n* **`STORAGE_FOLDER`**: The folder name inside Firebase Storage where images will be uploaded (e.g., `'products'`).\n* **`COLLECTION_NAMES`**: A dictionary mapping the `type` field from your JSON to your Firestore collection names (e.g., `{ 'coffee': 'coffees', 'pastry': 'pastries' }`).\n* **`map_product_to_firestore` function**: This is the most powerful part. You can completely change the logic here to define *how* the data from your JSON should be structured (i.e., your \"data tree\") when it's saved to Firestore.\n\n---\n\n## 3. Data File\n\nOpen **`products.json`** (or your custom JSON file) and add your data.\n\n* It must be a valid JSON list `[ ... ]`.\n* Each object in the list must have an **`\"id\"`** key.\n* The `\"id\"` must match the name of the image file (e.g., `\"id\": \"Cappuccino\"` requires a `Cappuccino.png` file in your `LOCAL_IMAGES_PATH`).\n\n---\n\n## 4. Usage\n\nOnce `config.py` is set up and your `products.json` is ready:\n\n1.  Open your terminal in the script's folder.\n2.  Run the uploader:\n\n    ```bash\n    python uploader.py\n    ```\n\nThe script will handle the rest and show the progress in the terminal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkacpermajcher%2Ffirebase-product-uploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkacpermajcher%2Ffirebase-product-uploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkacpermajcher%2Ffirebase-product-uploader/lists"}