Skip to main content

Locate paths using relative path names locally and in the Cloud.

Project description

findhere

Overview

findhere provides functions that simplify using relative paths in your Python project.

Main Features

Installation

pip install findhere

Usage

In the init.py of the main repository, add:

import os
import pkg_resources

PROJECT_ROOT = os.path.abspath(
    pkg_resources.resource_filename("${1:project_name}", '..')) \
    if 'PROJECT_ROOT' not in os.environ else os.environ['PROJECT_ROOT']
os.environ['PROJECT_ROOT'] = PROJECT_ROOT

os.environ['CLOUD_ROOT'] = f"gs://{os.path.basename(PROJECT_ROOT)}" \
    if 'CLOUD_ROOT' not in os.environ else os.environ['CLOUD_ROOT']

If using datatracker,

os.environ['TRACKER_PATH'] = os.path.join(
    PROJECT_ROOT, os.path.basename(PROJECT_ROOT), 'db.json')

If versioneer has been added,

os.environ['VERSION'] = __version__

If defining directories for use with a script, use:

os.environ['VERSION'] = '0.1.1'
cloudir, localdir, filedir = init_directories(__file__)

Cite

Maintainer

Tarjinder Singh @ tsingh@broadinstitute.org

Acknowledgements

Release Notes

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

findhere-0.1.4.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

findhere-0.1.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file findhere-0.1.4.tar.gz.

File metadata

  • Download URL: findhere-0.1.4.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for findhere-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e458da60537dc5738916069557bd33e555b67fb5cc26a822479796228839d152
MD5 26e4683a17fc8254f3d3bef5926bfb7d
BLAKE2b-256 4ce3ce5afc55a6b2fe232b8aeb77148a9730ed2e2f5ba657c5b412df688e6b0e

See more details on using hashes here.

File details

Details for the file findhere-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: findhere-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for findhere-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7f44b00eda9e25ec00e190df5fe38d4a97dd735d0f447f1c86c4a35236bd82f8
MD5 b50796173466ea4e4cf8375400db3d77
BLAKE2b-256 3a4a7998d55dbd31afce9df86033f984330a75168ea2352eb7b8e1d071b6bddb

See more details on using hashes here.

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