Skip to content

RaphaelBajon/mydropbox

Repository files navigation

MyDropbox

A Python library for managing UHM Ocean BGC Group Dropbox paths in research code.

Python Version License: MIT

Why?

Hardcoded Dropbox paths break on other machines and when folders are renamed. mydropbox auto-discovers your Dropbox tree and exposes every folder as a chainable Python attribute — no configuration needed.

Installation

pip install git+https://github.com/raphaelbajon/mydropbox.git
# or clone and install locally
git clone https://github.com/raphaelbajon/mydropbox.git && pip install -e mydropbox

Quick Start

from mydropbox import get_dropbox

db = get_dropbox(personal_folder="Your Name")

# Group folders
db.group.datasets / "observations.nc"
db.group.collaborative_projects

# Personal folders
db.personal.mycode / "scripts"
db.personal.projects / "new_analysis"

Configuration

Inline (simplest)

db = get_dropbox(personal_folder="Raphaël Bajon")

Config file (recommended — keeps your name out of shared code)

# 1. Copy and edit: cp mydropbox_config_template.py mydropbox_config.py
# 2. Set PERSONAL_FOLDER = "Your Name" in that file
from mydropbox.config.mydropbox_config import PERSONAL_FOLDER
db = get_dropbox(personal_folder=PERSONAL_FOLDER)

Group only

db = get_dropbox()   # personal is None
db.group.datasets / "shared.nc"

Discovery Depth

By default, get_dropbox discovers 2 levels deep for fast startup. Adjust with group_depth / personal_depth:

db = get_dropbox(personal_folder="Your Name", group_depth=1, personal_depth=3)

Drill deeper into a specific branch at runtime without re-loading everything:

db.group.datasets.expand(2)          # 2 more levels from here
db.group.datasets.argo.floats_2025   # now accessible

# Chain directly
node = db.group.datasets.expand(2).argo

Full pathlib API

Every node is a pathlib.Path-compatible object. All Path methods work at every level:

db.group.datasets.exists()
db.group.datasets.glob("*.nc")
db.personal.projects.iterdir()
db.personal.mycode.stat()

# Path join
file = db.group.datasets / "cruise_2025.nc"   # returns plain Path

Projects

See PROJECTS_GUIDE.md for creating and managing standardized research project structures.

License

MIT — free to modify for your research needs. See CONTRIBUTING.md to contribute.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages