Skip to main content

Cross-platfom provisioning of home directory storage

Project description

pypaxtor: Package Storage provisioning

Simple module that provides a path to a storage location under the user home directory in a cross-platform manner.

Under MacOS this will be in ~/Library/Application Support; under Windows it will be in $HOME/AppData/Local; and under Linux it will be in ~/.local/share.

Packages using this module supply a package name when requesting a storage location. A directory with that name is created under the directory named PyPaxtor in the os-appropriate location.

Usage:

>>> import pypaxtor
>>> savedir = pypaxtor.get_storage_location('my_package')
>>> savedir  # if on Mac as user `rlyacht`
PosixPath('/Users/rlyacht/Library/Application Support/pypaxtor/my_package')
>>> with open(savedir / 'SaveFile.txt') as savefile:
...     # do stuff

If the above code is executed on a linux system, the saved file will be located at /home/rlyacht/.local/share/pypaxtor/my_package/SaveFile.txt.

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

pypaxtor-0.1.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

pypaxtor-0.1.0-py3-none-any.whl (3.3 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