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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file dirlib-1.2.0.tar.gz.

File metadata

  • Download URL: dirlib-1.2.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.1 Windows/10

File hashes

Hashes for dirlib-1.2.0.tar.gz
Algorithm Hash digest
SHA256 ab2964afb51b7f6ccc596ad904f5e8beb2a0f7bcec5787f4055fa5d28b668acb
MD5 dc9cddd4bb41157988d1966b1969ffe8
BLAKE2b-256 b72e827015ff4f380df34dc66b9cd20374617180a9188927331c468a7c1ba56c

See more details on using hashes here.

File details

Details for the file dirlib-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: dirlib-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.1 Windows/10

File hashes

Hashes for dirlib-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d68ed46d4d17af167a18148cbeb23128275c2f9e46eac4d1accf7849d4a077
MD5 620e217bad56c122c4a5a414bd1dc65b
BLAKE2b-256 ad309f1d9a9a626f41b65e5db9e5ad0daeff68a7c3bedb8c9d8c73032c08124b

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