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_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.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

pystow-0.0.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pystow-0.0.3.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for pystow-0.0.3.tar.gz
Algorithm Hash digest
SHA256 02ac66e11a47b1cdf6c35b22a70999a835c88d32803390309078289f5f1f7480
MD5 007264909956e5408039e61534f2349d
BLAKE2b-256 9d5bcbb035c03ba4f9d20a0d8d7e8f3aca12a8bc04ba9b143b8c6877b4856c54

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pystow-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.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/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for pystow-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60b28766eed305d9aaafd119eb712665121274d3d8e1c2c209b9933ae29dbdc2
MD5 a15457adb320d63f98ba637e34d6e180
BLAKE2b-256 924c23c3c13b5379501c90c08a1b5b015a95f37bcaf1367c0a1c72af12018d4b

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