Coder Social home page Coder Social logo

colab-project-utils's Introduction

Colab Project Utils

Utility package to help you save your colab project files in your Google Drive account and fetch them back when you continue working on you project.

The goal of this project is to save you time while working on complex projects using Colab.

Getting Started

1. Mount Google Drive

DRIVE_PATH = '/gdrive'
from google.colab import drive
drive.mount(DRIVE_PATH)
Drive already mounted at /gdrive; to attempt to forcibly remount, call drive.mount("/gdrive", force_remount=True).

2. Download and import ColabUtils

!wget https://raw.githubusercontent.com/islammohamedd1/colab-project-utils/main/colab_utils.py
from colab_utils import ColabUtils

3. Initialize ColabUtils

When you initialize ColabUtils, it will look if the project already exists in your Google Drive using the following path {drive_root}/{project_root}/{project_name} If the project exists, it will copy all the files to the current session storage.

PROJECT_NAME = "Test Project"
PROJECT_ROOT = 'colab_projects'

cu = ColabUtils(PROJECT_NAME, DRIVE_PATH, PROJECT_ROOT)
Initialized project Test Project using the following path: /gdrive/MyDrive/colab_projects/Test Project
Project does not exist, creating new project
Created project Test Project at /gdrive/MyDrive/colab_projects/Test Project

4. Write a test file

%%writefile test.py
print('hello world')
Writing test.py

5. Save the project

cu.save_project()
Saved project Test Project

Voila! Your project is now saved to your Google Drive account. When you start working on you project again, the files will be fetched automatically when you initialize the ColabUtils object as described in step 3

colab-project-utils's People

Contributors

iislamm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.