Skip to main content

Displays the path to the user's documents directory.

Project description

mydocuments

A command line tool that returns the path to the user's Documents directory.

Description

Conventional knowledge says that in Windows, user's default Documents directory is located in %USERPROFILE%\Documents.

This is wrong.

The Documents directory can exist in multiple locations:

    %USERPROFILE%\Documents
    %USERPROFILE%\OneDrive\Documents
    %USERPROFILE%\OneDrive - [Company Name]\Documents

In fact, a folder named Documents can exist in all of the above locations simultaneously.

They all may have files inside. Which one is the correct one?

That is for windows to know, and for you to find out.

Except, it's not that easy.

You see, there is no environmental variable that tells you which one is the correct one.

There is no environment variable that tells you whether OneDrive backup is enabled or not, or if it is, if it's personal OneDrive or OneDrive for Business.

This tool was written to eliminate the guess-work and provide a definite answer by making a Windows API call to retrieve the correct path.

For platform agnosticism sake, it also provides a fuzzy find method that attempts to guess a path to a folder named Documents by process of elimination.

That part of the program is somewhat error prone. The Windows API method on the other hand, will yield the correct result every time.

Usage

    mydocuments [-f | -w | -h | -v]

      --help,    -h    Show this help message and exit.
      --version, -v Show version information and exit.
      --fuzzy,   -f   Use a fuzzy multiplatform method.
      --winapi,  -w  Use Windows API method.

By default, if run on Windows the tool will use the accurate -w method. On other platforms it will default to the fuzzy finder, for obvious reasons.

Installation

Any Platform

You can install using uv (see uv):

uv tool install mydocuments

You can also run it without installing:

uv tool run mydocuments

Windows

On Windows, this tool is distributed via scoop (see scoop.sh).

First, you need to add my bucket:

scoop bucket add maciak https://github.com/maciakl/bucket
scoop update

Next simply run:

scoop install mydocuments

If you don't want to use scoop you can simply download the executable from the release page and extract it somewhere in your path.

Project details


Download files

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

Source Distribution

mydocuments-0.1.6.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

mydocuments-0.1.6-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file mydocuments-0.1.6.tar.gz.

File metadata

  • Download URL: mydocuments-0.1.6.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for mydocuments-0.1.6.tar.gz
Algorithm Hash digest
SHA256 25ff764ed78b08e1ba310b5d977e4539710688fc7e6b255fc51926cb78076857
MD5 8cc9ec48b5e9ca201641d2c4236bcc25
BLAKE2b-256 ff09f93992713940364ac04edd7a2b37e5c9a838b79fd0481a694d09a8436a95

See more details on using hashes here.

File details

Details for the file mydocuments-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for mydocuments-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2f623b2b7731bfff0a2616849b02bf76692aafd3148ab65a4d21781d8bf2ea
MD5 9a2c8e634543c94b9551fa932da8362f
BLAKE2b-256 545c06446868032305c535f0fb739f0c704113a2734226875f5c70dc475b6fed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page