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.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

pystow-0.0.4-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pystow-0.0.4.tar.gz
  • Upload date:
  • Size: 10.8 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

Hashes for pystow-0.0.4.tar.gz
Algorithm Hash digest
SHA256 28db7097c4d9b63bd1714276d6a56bf7c6df29a5071738b1991b066c7e1f67e3
MD5 0b1ffd626d25f2fd5d259c8b60b7db29
BLAKE2b-256 a377f6928a7b977e1eb139d4ae691129da6f46ad1d95be617c10783aa8cbd477

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pystow-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.4 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

Hashes for pystow-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 caafed346ba94f4e0723388ca7217536f08f00cad79de3bab1d9c2d87a2ab90a
MD5 b3f3705f6051b9c77ec5039a5d05687f
BLAKE2b-256 b847fe4570c56221191690fb17c475bcf5fe2856f93e4b1c507e52f550da2761

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