Skip to main content

No project description provided

Project description

dirlib

dirlib is a minimum library for getting a directory that is used by putting on configuration files. This is inspired by Golang standard library function called os.UserConfigDir(). Currently, Windows, Unix and macOS are supported.

Installation

pip install dirlib

How to use

import dirlib

# On Windows
print(dirlib.user_config_dir()) #=> %AppData% or %UserProfile%

# On Unix
print(dirlib.user_config_dir()) #=> $XDG_CONFIG_HOME or $HOME/.config

# On macOS
print(dirlib.user_config_dir()) #=> $HOME/Libary/Application Support

user_config_dir() can pass the two arguments. The first one is an application name. Here is an example on Windows.

import dirlib
app_name = "mysupercooltool"
print(dirlib.user_config_dir(app_name)) #=> C:\Users\chihiro\AppData\Roaming\mysupercooltool

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

dirlib-1.2.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

dirlib-1.2.0-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

Supported by

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