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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: findhere-0.1.2.tar.gz
  • Upload date:
  • Size: 19.6 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.2.tar.gz
Algorithm Hash digest
SHA256 184a18fa60c560b94d514cc67d64012aa1a8add67358b2e3385190d91a87cba0
MD5 2f2ff76f8fac1a9c7764897c515f9bba
BLAKE2b-256 24e419e16d506b0c74110cb37e88b6b47cd1cce7caee526268e3748f0b560167

See more details on using hashes here.

File details

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

File metadata

  • Download URL: findhere-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6228748d6dc018ca8f6e0e16a29c7a6a2ccc70fa88d114fc5ae8aaa159e91c9a
MD5 07c4f78f2e0d7069ae9cbfd6d147bdb6
BLAKE2b-256 de4408bc9bdf9c67668eab1db3ee147db69a0597ab04429c8cf88f4cf3685217

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