Skip to main content

vdropbox

Utilities to read/write objects to/from Dropbox.

📦 Installation

pip install vdropbox

# With pandas support (csv/excel/parquet helpers)
pip install vdropbox[pandas]

🚀 Usage

The first step is to declare the Vdropbox object using a token:

from vdropbox import Vdropbox
vdp = Vdropbox("my_secret")

Unlike the official dropbox Python package, it is not required to have a leading / in all file names.

[!NOTE] Ensure your Dropbox token has the necessary permissions.

🛠 Custom Logger

You can pass a custom logger to Vdropbox if you want to control logging behavior:

import logging
from vdropbox import Vdropbox

logger = logging.getLogger("my_logger")
vdp = Vdropbox("my_secret", logger=logger)

[!TIP] Using a custom logger allows you to integrate Vdropbox logs into your existing logging setup.

🔄 Automatic Retries

Transient errors (connection drops, timeouts, Dropbox 5xx, rate limits) are retried automatically with exponential backoff. You can tune or disable it:

vdp = Vdropbox("my_secret", max_retries=4)  # default; use 0 to disable

📁 Basic Functions

# Check if a file exists
vdp.file_exists("my_file.txt")
vdp.file_exists("folder/my_file.txt")

# Check contents of a folder
vdp.ls("my_folder")

# List all files recursively (returns paths relative to the folder)
vdp.ls("my_folder", recursive=True)

# Create a folder (and missing parents)
vdp.mkdir_p("folder/subfolder")

# Move/rename a file
vdp.move("my_file.txt", "folder/my_file.txt")

# Delete a file
vdp.delete("my_file.txt")

[!WARNING] Deleting a file is irreversible!

📝 Reading and Writing Text Files

data = "Hello world"

# Write a text file
vdp.write_file(data, "my_file.txt")

# Read a text file
vdp.read_file("my_file.txt")

[!NOTE] The default encoding is UTF-8.

📜 Reading and Writing YAML Files

data = {"a": 4, "b": 2}

# Write a YAML file
vdp.write_yaml(data, "my_file.yaml")

# Read a YAML file
vdp.read_yaml("my_file.yaml")

[!TIP] YAML files are written with sort_keys=False, so key order is preserved.

🧾 Reading and Writing JSON Files

data = {"a": 4, "b": 2}

# Write a JSON file
vdp.write_json(data, "my_file.json")

# Read a JSON file
vdp.read_json("my_file.json")

📊 Reading and Writing Excel Files with Pandas

import pandas as pd
# Create a dummy DataFrame
df = pd.DataFrame(list("ABCDE"), columns=["col"])

# Write an Excel file
vdp.write_excel(df, "df.xlsx")

# Read an Excel file
df = vdp.read_excel("df.xlsx")

[!TIP] You can pass keyword arguments to pd.read_excel or df.to_excel.

Example:

vdp.write_excel(df, "test.xlsx", index=False)

🔹 Reading and Writing Parquet Files with Pandas

import pandas as pd
# Create a dummy DataFrame
df = pd.DataFrame(list("ABCDE"), columns=["col"])

# Write a Parquet file
vdp.write_parquet(df, "df.parquet")

# Read a Parquet file
df = vdp.read_parquet("df.parquet")

[!TIP] You can pass keyword arguments to pd.read_parquet or df.to_parquet.

👥 Authors

📜 License

The content of this repository is licensed under MIT.

Metadata

Release files for vdropbox 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vdropbox 2.0.0
File Size Uploaded
vdropbox-2.0.0.tar.gz 63.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vdropbox 2.0.0
File Interpreter ABI Platform
vdropbox-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.4 kB

Release files / vdropbox-2.0.0.tar.gz

Download URL vdropbox-2.0.0.tar.gz
Size 63.4 kB
Tags Source
SHA-256 checksum
How to use checksums
10dcc48133cce66077d31725dc9c8d0c70532bdb64c035c1defad70d1d68002c
BLAKE2b-256 checksum
How to use checksums
6798efdee23828cd0dde500554b6cca4b181e42c6b9af096e15eafe6ca5f2330
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / vdropbox-2.0.0-py3-none-any.whl

Download URL vdropbox-2.0.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d1d245b44535304141c38d2fbc2f069cddbe3c3d218cd2a2c9a29be80ad2b96
BLAKE2b-256 checksum
How to use checksums
fb886fd3bcf5cc799daf493c0ff5d554c5839b0d9cc4271f9bdbf0bb894c4ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page