A cross-platform CLI tool to ignore files and folders in Dropbox
Project description
dropblock-cli
A cross-platform CLI tool to ignore or unblock files and folders in Dropbox using platform-specific methods, based on official documentation here https://help.dropbox.com/sync/ignored-files
Features
- Cross-platform support (Windows, macOS, Linux)
- Wildcard and glob pattern support
- Automatic detection and removal of Dropbox conflicted copies
- Batch processing of multiple paths
- Unblock (reverse) operation to restore syncing for previously ignored files
- Verbose and quiet modes
- PyPI distribution for easy installation
Installation
From PyPI (Recommended)
pip install dropblock-cli
From Source
git clone https://github.com/yourusername/dropbox-ignore-cli.git
cd dropbox-ignore-cli
pip install -e .
Or for system-wide installation:
pip install .
Usage
Basic Operations
Ignore files/folders (stop Dropbox sync):
dropblock /path/to/file
dropblock /path/to/folder
Unblock files/folders (restore Dropbox sync):
dropblock --unblock /path/to/file
dropblock --unblock /path/to/folder
Multiple paths
Ignore multiple files/folders:
dropblock file1.txt folder1 file2.pdf
Unblock multiple files/folders:
dropblock --unblock file1.txt folder1 file2.pdf
Wildcard patterns
Ignore parent folder (path ending with *):
dropblock /path/to/folder/*
Ignore files matching a pattern:
dropblock /path/*/specific/file.txt
dropblock /home/user/*/node_modules
Options
--unblock: Unblock files instead of ignoring them (restore Dropbox syncing)--ignore-conflicts: Don't remove conflicted copies when ignoring files-n, --no-output: Suppress the list of ignored/unblocked files-v, --verbose: Show verbose output
Examples
Ignoring files and folders:
# Ignore node_modules in all projects
dropblock ~/projects/*/node_modules
# Ignore a folder and don't remove conflicts
dropblock --ignore-conflicts ~/Dropbox/large-folder
# Quiet mode - no output
dropblock -n ~/Dropbox/temp/*
# Verbose mode
dropblock -v ~/Dropbox/cache ~/Dropbox/logs
Unblocking files and folders:
# Restore syncing for a previously ignored folder
dropblock --unblock ~/Dropbox/large-folder
# Unblock multiple paths with verbose output
dropblock --unblock -v ~/projects/*/node_modules
# Restore syncing for cache folders
dropblock --unblock ~/Dropbox/cache ~/Dropbox/logs
Common workflows:
# Temporarily ignore large folders during initial sync
dropblock ~/Dropbox/videos ~/Dropbox/archives
# Later restore syncing when needed
dropblock --unblock ~/Dropbox/videos ~/Dropbox/archives
How it works
The tool uses platform-specific methods to set or remove the ignore attribute:
Ignore Operation (Default)
- Windows: Uses PowerShell to set the
com.dropbox.ignoredstream - macOS: Uses
xattrto setcom.dropbox.ignoredattribute - Linux: Uses
attrcommand to setcom.dropbox.ignoredattribute
Unblock Operation (--unblock flag)
- Windows: Uses PowerShell to clear the
com.dropbox.ignoredstream - macOS: Uses
xattrto remove thecom.dropbox.ignoredattribute - Linux: Uses
attrcommand to remove thecom.dropbox.ignoredattribute
When files are ignored, Dropbox stops syncing them but keeps local copies. When unblocked, Dropbox resumes syncing and the files become available across all devices again.
Conflict handling
By default, the tool automatically detects and removes Dropbox conflicted copies (files matching the pattern filename (user's conflicted copy date).ext). Use --ignore-conflicts to disable this behavior.
Requirements
- Python 3.8+
- Platform-specific tools:
- Windows: PowerShell (built-in)
- macOS: xattr (built-in)
- Linux: attr package (
sudo apt install attron Debian/Ubuntu)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dropblock_cli-1.0.1.tar.gz.
File metadata
- Download URL: dropblock_cli-1.0.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0377089e46919944a7f5dcbce68becafba936fec2768cd04790e226bf92ba465
|
|
| MD5 |
5a7920f27f9e93a0524de3975f4cb1b1
|
|
| BLAKE2b-256 |
11d284d0315a441b5c1ae2feacfb224f72576f656c6d1dc08031b1be65de6e99
|
Provenance
The following attestation bundles were made for dropblock_cli-1.0.1.tar.gz:
Publisher:
publish.yml on Ottermatics/dropbox-ignore-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dropblock_cli-1.0.1.tar.gz -
Subject digest:
0377089e46919944a7f5dcbce68becafba936fec2768cd04790e226bf92ba465 - Sigstore transparency entry: 498018068
- Sigstore integration time:
-
Permalink:
Ottermatics/dropbox-ignore-cli@5db6f24585ecb65ef9848df89014f1d496a14ad8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ottermatics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5db6f24585ecb65ef9848df89014f1d496a14ad8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dropblock_cli-1.0.1-py3-none-any.whl.
File metadata
- Download URL: dropblock_cli-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2549ff705d4aa090e4aadc881df94bfe410a58f28c7dd29fd817fe6845f172d1
|
|
| MD5 |
184bd34f7b536c0503a772e064f087bc
|
|
| BLAKE2b-256 |
6e3878cd32319800ad13a24dc20a1c94e266145e82a34a8214ed5a0100dadc85
|
Provenance
The following attestation bundles were made for dropblock_cli-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on Ottermatics/dropbox-ignore-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dropblock_cli-1.0.1-py3-none-any.whl -
Subject digest:
2549ff705d4aa090e4aadc881df94bfe410a58f28c7dd29fd817fe6845f172d1 - Sigstore transparency entry: 498018085
- Sigstore integration time:
-
Permalink:
Ottermatics/dropbox-ignore-cli@5db6f24585ecb65ef9848df89014f1d496a14ad8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ottermatics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5db6f24585ecb65ef9848df89014f1d496a14ad8 -
Trigger Event:
push
-
Statement type: