iadrive


Nameiadrive JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/Andres9890/iadrive
SummaryDownload Google Drive files/folders and upload them to the Internet Archive
upload_time2025-08-17 13:21:19
maintainerNone
docs_urlNone
authorAndres99
requires_python>=3.9
licenseMIT
keywords archive.org archiving google drive internet archive file mirroring
VCS
bugtrack_url
requirements internetarchive gdown docopt-ng python-dateutil
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [License Button]: https://img.shields.io/badge/License-MIT-black
[License Link]: https://github.com/Andres9890/iadrive/blob/main/LICENSE 'MIT License.'

# IAdrive
[![License Button]][License Link]

IAdrive is A tool for archiving google drive files/folders and uploading them to the [Internet Archive](https://archive.org/), it downloads
the google drive's content, makes the metadata, and then uploads to IA

- this project is heavily based of off [tubeup](https://github.com/bibanon/tubeup) by bibanon, credits to them

## Features

- Downloads files and/or folders from Google Drive using [gdown](https://github.com/wkentaro/gdown)
- Extract file dates from images, PDFs, and media files to determine the creation date for the item
- Pass custom metadata to Archive.org using `--metadata=<key:value>`
- Supports quiet mode (`--quiet`) and debug mode (`--debug`) for log output
- Automatically cleans up downloaded files after upload
- Sanitizes identifiers and truncates subject tags to fit Archive.org requirements
- Falls back to "IAdrive" as publisher if Google Drive collaborators can't be fetched
- Improved error handling and debug output

## Installation

Requires Python 3.9 or newer

```bash
git clone https://github.com/Andres9890/iadrive
cd iadrive
pip install -r requirements.txt
```

The package makes a console script named `iadrive` once installed, You can also install from the source using `pip install .`

## Configuration

```bash
ia configure
```

You're gonna be prompted to enter your IA account's email and password

Optional envs:

- `IADRIVE_DEFAULT_COLLECTION` – default Archive.org collection (default:
  `opensource`).
- `IADRIVE_DEFAULT_MEDIATYPE` – default mediatype (default: `data`).
- `GOOGLE_API_KEY` – if set, the tool attempts to look up the owner names of
  the Google Drive file or folder for the `publisher` field in metadata

## Usage

```bash
iadrive LINK [--identifier IDENTIFIER] [--collection COLLECTION]
             [--mediatype MEDIATYPE] [--dest DIRECTORY] [--dry-run]
             [--log-level LEVEL] [--metadata=<key:value>...] [--quiet] [--debug]
```

Arguments:

- `LINK` – Google Drive file or folder URL to mirror.
- `--identifier` – override the generated Archive.org identifier (default is `drive-<drive-id>`)
- `--collection` – Archive.org collection to put the item in
- `--mediatype` – Archive.org mediatype (example, `data`, `texts`, etc)
- `--dest` – destination directory for downloaded files (default is `downloads`)
- `--dry-run` – download and prepare metadata without uploading
- `--log-level` – logging level (example, `DEBUG`, `INFO`, `WARNING`, `ERROR`)
- `--metadata=<key:value>` – custom metadata to add to the Archive.org item (can be used multiple times)
- `--quiet` – only print errors
- `--debug` – print all logs to stdout (for troubleshooting)

Example:

```bash
iadrive https://drive.google.com/drive/folders/placeholder --collection=mycol \
        --mediatype=data --log-level=DEBUG
```

## How it works

1. `iadrive` uses `gdown` to fetch the specified Google Drive file or folder
2. It walks the downloaded directory and extracts file extensions and dates using optional libraries such as Pillow, mutagen, and pypdf
3. Metadata is assembled including a file listing (with sizes), earliest embedded date, and original URL. Identifiers are sanitized and subject tags are truncated to fit Archive.org requirements. If collaborators can't be fetched, publisher defaults to "IAdrive".
4. The directory is uploaded to an Archive.org item using the `internetarchive` library
5. Downloaded files are automatically cleaned up after upload
6. Errors are handled gracefully, and debug output is available with `--debug`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Andres9890/iadrive",
    "name": "iadrive",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "archive.org, archiving, google drive, internet archive, file mirroring",
    "author": "Andres99",
    "author_email": "Andres99 <fndres195@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/83/15/e15cf01d30aa757f8fd5e33b5685f3ed6199303c4d4926e56a9bce5e96b6/iadrive-1.0.0.tar.gz",
    "platform": null,
    "description": "[License Button]: https://img.shields.io/badge/License-MIT-black\r\n[License Link]: https://github.com/Andres9890/iadrive/blob/main/LICENSE 'MIT License.'\r\n\r\n# IAdrive\r\n[![License Button]][License Link]\r\n\r\nIAdrive is A tool for archiving google drive files/folders and uploading them to the [Internet Archive](https://archive.org/), it downloads\r\nthe google drive's content, makes the metadata, and then uploads to IA\r\n\r\n- this project is heavily based of off [tubeup](https://github.com/bibanon/tubeup) by bibanon, credits to them\r\n\r\n## Features\r\n\r\n- Downloads files and/or folders from Google Drive using [gdown](https://github.com/wkentaro/gdown)\r\n- Extract file dates from images, PDFs, and media files to determine the creation date for the item\r\n- Pass custom metadata to Archive.org using `--metadata=<key:value>`\r\n- Supports quiet mode (`--quiet`) and debug mode (`--debug`) for log output\r\n- Automatically cleans up downloaded files after upload\r\n- Sanitizes identifiers and truncates subject tags to fit Archive.org requirements\r\n- Falls back to \"IAdrive\" as publisher if Google Drive collaborators can't be fetched\r\n- Improved error handling and debug output\r\n\r\n## Installation\r\n\r\nRequires Python 3.9 or newer\r\n\r\n```bash\r\ngit clone https://github.com/Andres9890/iadrive\r\ncd iadrive\r\npip install -r requirements.txt\r\n```\r\n\r\nThe package makes a console script named `iadrive` once installed, You can also install from the source using `pip install .`\r\n\r\n## Configuration\r\n\r\n```bash\r\nia configure\r\n```\r\n\r\nYou're gonna be prompted to enter your IA account's email and password\r\n\r\nOptional envs:\r\n\r\n- `IADRIVE_DEFAULT_COLLECTION` \u2013 default Archive.org collection (default:\r\n  `opensource`).\r\n- `IADRIVE_DEFAULT_MEDIATYPE` \u2013 default mediatype (default: `data`).\r\n- `GOOGLE_API_KEY` \u2013 if set, the tool attempts to look up the owner names of\r\n  the Google Drive file or folder for the `publisher` field in metadata\r\n\r\n## Usage\r\n\r\n```bash\r\niadrive LINK [--identifier IDENTIFIER] [--collection COLLECTION]\r\n             [--mediatype MEDIATYPE] [--dest DIRECTORY] [--dry-run]\r\n             [--log-level LEVEL] [--metadata=<key:value>...] [--quiet] [--debug]\r\n```\r\n\r\nArguments:\r\n\r\n- `LINK` \u2013 Google Drive file or folder URL to mirror.\r\n- `--identifier` \u2013 override the generated Archive.org identifier (default is `drive-<drive-id>`)\r\n- `--collection` \u2013 Archive.org collection to put the item in\r\n- `--mediatype` \u2013 Archive.org mediatype (example, `data`, `texts`, etc)\r\n- `--dest` \u2013 destination directory for downloaded files (default is `downloads`)\r\n- `--dry-run` \u2013 download and prepare metadata without uploading\r\n- `--log-level` \u2013 logging level (example, `DEBUG`, `INFO`, `WARNING`, `ERROR`)\r\n- `--metadata=<key:value>` \u2013 custom metadata to add to the Archive.org item (can be used multiple times)\r\n- `--quiet` \u2013 only print errors\r\n- `--debug` \u2013 print all logs to stdout (for troubleshooting)\r\n\r\nExample:\r\n\r\n```bash\r\niadrive https://drive.google.com/drive/folders/placeholder --collection=mycol \\\r\n        --mediatype=data --log-level=DEBUG\r\n```\r\n\r\n## How it works\r\n\r\n1. `iadrive` uses `gdown` to fetch the specified Google Drive file or folder\r\n2. It walks the downloaded directory and extracts file extensions and dates using optional libraries such as Pillow, mutagen, and pypdf\r\n3. Metadata is assembled including a file listing (with sizes), earliest embedded date, and original URL. Identifiers are sanitized and subject tags are truncated to fit Archive.org requirements. If collaborators can't be fetched, publisher defaults to \"IAdrive\".\r\n4. The directory is uploaded to an Archive.org item using the `internetarchive` library\r\n5. Downloaded files are automatically cleaned up after upload\r\n6. Errors are handled gracefully, and debug output is available with `--debug`\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Download Google Drive files/folders and upload them to the Internet Archive",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Andres9890/iadrive",
        "issues": "https://github.com/Andres9890/iadrive/issues",
        "source": "https://github.com/Andres9890/iadrive.git"
    },
    "split_keywords": [
        "archive.org",
        " archiving",
        " google drive",
        " internet archive",
        " file mirroring"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "48e7c44351b9918ac3654325ea832a8820e61e8fd77b734ec1f6183ef40ee98a",
                "md5": "e36bd94d6b11369dfb026c9bd460c81a",
                "sha256": "d7f9044450cf1529c4ffb679f53fffac67da11a9c9dc8877a0c7085f603d67f9"
            },
            "downloads": -1,
            "filename": "iadrive-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e36bd94d6b11369dfb026c9bd460c81a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8969,
            "upload_time": "2025-08-17T13:21:17",
            "upload_time_iso_8601": "2025-08-17T13:21:17.400130Z",
            "url": "https://files.pythonhosted.org/packages/48/e7/c44351b9918ac3654325ea832a8820e61e8fd77b734ec1f6183ef40ee98a/iadrive-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8315e15cf01d30aa757f8fd5e33b5685f3ed6199303c4d4926e56a9bce5e96b6",
                "md5": "f138fe9ccf2406065dc84ebb935e5355",
                "sha256": "9b561fd028b432e61c4232f668444e107c2659399b7991060ff34fc5cdba8619"
            },
            "downloads": -1,
            "filename": "iadrive-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f138fe9ccf2406065dc84ebb935e5355",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 8875,
            "upload_time": "2025-08-17T13:21:19",
            "upload_time_iso_8601": "2025-08-17T13:21:19.221970Z",
            "url": "https://files.pythonhosted.org/packages/83/15/e15cf01d30aa757f8fd5e33b5685f3ed6199303c4d4926e56a9bce5e96b6/iadrive-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 13:21:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Andres9890",
    "github_project": "iadrive",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "internetarchive",
            "specs": [
                [
                    ">=",
                    "5.5.0"
                ]
            ]
        },
        {
            "name": "gdown",
            "specs": [
                [
                    ">=",
                    "5.2.0"
                ]
            ]
        },
        {
            "name": "docopt-ng",
            "specs": [
                [
                    ">=",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    ">=",
                    "2.9.0.post0"
                ]
            ]
        }
    ],
    "lcname": "iadrive"
}
        
Elapsed time: 1.64167s