Code Monkey home page Code Monkey logo

iagitup's Introduction

iagitup.py - v1.1 - archive a github repository on archive.org

A small tool to archive a GitHub repository on the Internet Archive. The script downloads the GitHub repository, creates a git bundle and uploads it on archive.org The upload is enriched with metadata from the github api and the README.md

Install

Prerequisites (with debian or ubuntu):

apt-get install python python-dev python-virtualenv 
apt-get install libffi-dev libssl-dev  git

Clone the repo and create the virtualenv and all things...

git clone https://github.com/gdamdam/iagitup.git
cd iagitup

create the virtualenv:

virtualenv venv
source venv/bin/activate

install the requirements:

pip install -r requirements.txt

If you don't already have an Internet Archive account, register for one to give the script upload privileges.

Configure internetarchive with your Internet Archive account:

    ia configure

Usage

    python iagitup.py [-h] --githuburl/-u <github_repo_url>

you can add also custom metadata:

    python iagitup.py [-h] --githuburl/-u <github_repo_url> --metadata=<key:value,key2:val2>

as example:

    python iagitup.py -u https://github.com/<GITHUBUSER>/<RESPOSITORY>

The script downloads the git repo from github, creates a git bundle and uploads it on the Internet Archive.

The repo will be archived in an item at url containing the repository name and the date of the last push, something like:

https://archive.org/details/github.com-<GITHUBUSER>-<RESPOSITORY>_-_<DATE-LAST-PUSH>

The git repo bundle will be available at url:

https://archive.org/download/github.com-<GITHUBUSER>-<RESPOSITORY>_-_<DATE-LAST-PUSH>/<BUNDLENAME>.bundle

Restore an archived github repository

Download the bundle file, form the archived item:

https://archive.org/download/.../<ARCHIVED_REPO>.bundle

Just download the .bundle file and run:

 git clone file.bundle -b master

License (GPLv3)

Copyright (C) 2017 Giovanni Damiola

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

iagitup's People

Contributors

gdamdam avatar jjjake avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.