Skip to main content

python-onedrivepath

Resolve a path inside your local OneDrive folder, cross-platform

Install

pip install onedrivepath

To edit, install in editable mode instead and just modify the files in this repo directly:

pip install -e .

Installed via PyPI, so update to the latest published version with:

pip install --upgrade onedrivepath

OneDrivePath

Resolves a path inside your local OneDrive folder (Windows/macOS; best-effort on Linux via unofficial clients).

from OneDrivePath import onedrivePath

onedrivePath("/folder/I/Care/About/")
# 'C:/Users/.../OneDrive/folder/I/Care/About'

onedrivePath()
# 'C:/Users/.../OneDrive'

If you have multiple OneDrive accounts (e.g. personal + work/school), pass account to pick one. Matching is a case- and punctuation-insensitive substring check against the local folder name, the same way on every platform:

onedrivePath(account="google")
# 'C:/Users/.../OneDrive - Google'

onedrivePath("Research/Data", account="google")
# 'C:/Users/.../OneDrive - Google/Research/Data'

This matches whatever your OneDrive folder is actually named.

e.g. if your school's folder is OneDrive - Neuromob University:

onedrivePath(account="neuromob")
# 'C:/Users/.../OneDrive - Neuromob University'

onedrivePath("Coursework", account="neuromob")
# 'C:/Users/.../OneDrive - Neuromob University/Coursework'

If you'll be using the same account for most calls, set it once with setAccount instead of passing account every time. It validates immediately, so a bad name fails fast:

from OneDrivePath import onedrivePath, setAccount

setAccount("neuromob")

onedrivePath()
# 'C:/Users/.../OneDrive - Neuromob University'

onedrivePath("Coursework")
# 'C:/Users/.../OneDrive - Neuromob University/Coursework'

onedrivePath("Photos", account="google")  # per-call account still overrides
# 'C:/Users/.../OneDrive - Google/Photos'

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onedrivepath-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onedrivepath-0.2.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file onedrivepath-0.2.0.tar.gz.

File metadata

  • Download URL: onedrivepath-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.9

File hashes

Hashes for onedrivepath-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f5b19c42353785772558ee61a63e36579e070914ea8c17bd13cb6e7d363f380f
MD5 091b35edc0260336981ea47d38b47a49
BLAKE2b-256 641d4b41e0870a0fc361d522504dcfcb6a2d1448980d9d28b44fe880e3832e34

See more details on using hashes here.

File details

Details for the file onedrivepath-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: onedrivepath-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.9

File hashes

Hashes for onedrivepath-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf9b1f08c7baffc4c0439de8bb1d85f1daf1ef6b6c6049e0271011507c59b23
MD5 2be86abbc106d1904207f0502a0a1abb
BLAKE2b-256 a53aaff4ae190bd9fe7249e63d947e862ac7cbfddd59c048cb6b5ef62671383e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 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