Easily pick a place to store data for your python package.
Project description
PyStow
👜 Easily pick a place to store data for your python package.
🚀 Installation
pip install pystow
💪 Usage
Get a directory for your application.
import pystow
# Get a directory (as a pathlib.Path) for ~/.data/pykeen
pykeen_directory = pystow.get('pykeen')
# Get a subdirectory (as a pathlib.Path) for ~/.data/pykeen/experiments
pykeen_experiments_directory = pystow.get('pykeen', 'experiments')
# You can go as deep as you want
pykeen_deep_directory = pystow.get('pykeen', 'experiments', 'a', 'b', 'c')
Ensure a file from the internet is available in your application's directory:
import pystow
url = 'https://raw.githubusercontent.com/pykeen/pykeen/master/src/pykeen/datasets/nations/test.txt'
path = pystow.ensure('pykeen', 'datasets', 'nations', url=url)
Ensure a file from the internet and load it for usage:
import pystow
url = 'https://raw.githubusercontent.com/pykeen/pykeen/master/src/pykeen/datasets/nations/test.txt'
df = pystow.ensure_csv('pykeen', 'datasets', 'nations', url=url)
Also see pystow.ensure_excel()
, pystow.ensure_zip_df()
, and pystow.ensure_tar_df()
.
⚠️ Configuration
Data gets stored in ~/.data
by default. If you want to change the name of the directory, set the environment
variable PYSTOW_NAME
. If you want to change the default parent directory to be other than the home directory,
set PYSTOW_HOME
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pystow-0.0.6.tar.gz
.
File metadata
- Download URL: pystow-0.0.6.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf007c872b84f03c65e7a5c413791ffc45a12c803d2a502b3ab9897f117ac9b |
|
MD5 | 809bc1c7168b1ed75bbdb3eb4fe70855 |
|
BLAKE2b-256 | c153cc4b390b00c45fd61067cf7ce7ff10fdb5709abd9cc8c4d45bc91250f511 |
Provenance
File details
Details for the file pystow-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: pystow-0.0.6-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09a2400d6f2f75a12871d023602c40d8cbc1ac3c88cb5b0fe4fdb8e5bc4a0408 |
|
MD5 | 86bf074ed017ceb6a48abbafdf0d1eba |
|
BLAKE2b-256 | ec4509fa703b128e7b3e620e822134dc5bc0d133ff71cbe2ae7755e00a1cd163 |