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__

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

Uploaded Source

Built Distribution

findhere-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: findhere-0.1.1.tar.gz
  • Upload date:
  • Size: 19.5 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.1.tar.gz
Algorithm Hash digest
SHA256 7e89a053b2eb94a1d561a43211b127007b36145252d4f5968b1782b5669649d0
MD5 9ff27fa3ede1b7ce4590f3f9dea094ea
BLAKE2b-256 ed8b81f454dbd0481e76495c656672e4bac6f63e4ed062cbe5bb46efa1dcffd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: findhere-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce8f299b97e127f5f8bc701e5bb131c1f19675b1908f86d54291ebce779973ce
MD5 aa9fb7da311cc05f0106e7fba4b61680
BLAKE2b-256 ca740b109706d8cc24a760907a4b1017e33f77899480338918eefb099c29416c

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