Skip to main content

Easily pick a place to store data for your python package.

Project description

PyStow

Build status PyPI - Python Version License DOI

👜 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_rdf(), 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


Download files

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

Source Distribution

pystow-0.0.11.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

pystow-0.0.11-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file pystow-0.0.11.tar.gz.

File metadata

  • Download URL: pystow-0.0.11.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.6

File hashes

Hashes for pystow-0.0.11.tar.gz
Algorithm Hash digest
SHA256 a204cdf338b26491ddf01b2148998e5feb1c7472b6c52d72387927a58a1487b3
MD5 85099f68394e06014ccb976a0bc3f8a4
BLAKE2b-256 15f34b29e9e0c0718a9f0aabc9afcf42f05b3fb0b61758dbcf2db31a4fd051f5

See more details on using hashes here.

Provenance

File details

Details for the file pystow-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: pystow-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.6

File hashes

Hashes for pystow-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 be2641c888e29f02b3979120b149036b65e56b2f9078dc08d52ffe674a3c93c1
MD5 c1acb891d0b23a283e9f6bbcb5cb881b
BLAKE2b-256 1591aeb752483db068217c53f439852472a1063488da9d7efe59ff47daabd5de

See more details on using hashes here.

Provenance

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