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.5.tar.gz
(20.4 kB
view details)
Built Distribution
File details
Details for the file findhere-0.1.5.tar.gz
.
File metadata
- Download URL: findhere-0.1.5.tar.gz
- Upload date:
- Size: 20.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e6a2902daa29585061d09ce37cc69e1366ba55a624c52cebfb51af7f778fc7b |
|
MD5 | 10807478b2acdbf1fb6af8735a6f4922 |
|
BLAKE2b-256 | 715f7664fac8a0333e3a12b0d96af32166c5779a180bebb27f934aab000dd338 |
File details
Details for the file findhere-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: findhere-0.1.5-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21f08051ebc8ffc8be220cdf94fd743e80fb7bdfa435e02999861a52fd1df54f |
|
MD5 | 3959a1da378d2a5ee9ad7085fa06aa55 |
|
BLAKE2b-256 | c0e49325e65a7f3bf9f44b891bd5a4fe83150019e8d5a95685b8877dedf6b3f8 |