Here
Python package that replicates the R package called "here".
Overview
The here package provides utility functions to determine the root directory of your project and easily resolve paths relative to it. This is particularly useful for managing file paths when calling the code from shells that cd to other directories before executing the script.
With here in R, you never ever have to deal with setwd junk.
With here in Python, you never ever have to deal with hard-coding full filepaths or working directory junk.
With both, you can define file paths *relative to the file that calls here() and it will always work!
Features
- Determine the directory of the current file.
- Resolve paths relative to the root directory.
- Supports usage in Jupyter notebooks, .py scripts, and interactive Python shells.
Installation
You can install the package using pip:
pip install --upgrade here
Example Usage
# Get the file working directory
file_working_directory = get_file_working_directory()
print(f"File working directory: {file_working_directory}")
>>> "/Users/michaelboerman/Code/here/here"
# Resolve a relative path using the here function
resolved_path = here("data/output")
print(f"Resolved path: {resolved_path}")
>>> "/Users/michaelboerman/Code/here/data/output"
It works on both .py and .ipynb files!
Metadata
Release files for here 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| here-1.4.1.tar.gz | 3.2 kB | With provenance | Details for here-1.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| here-1.4.1-py3-none-any.whl | Python 3 | none | any | Details for here-1.4.1-py3-none-any.whl |
Total release size: 6.2 kB
Release files / here-1.4.1.tar.gz
| Download URL | here-1.4.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b969dc174d6879061699ff903ec37a63cddbfd07e2b74107bc7ef13449c65e23
|
|
BLAKE2b-256 checksum How to use checksums |
bd05cc1de4b16a2ad0444c27283b6266b92dcfa271b2690b32ea6d6bc795e675
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.
Transparency logRelease files / here-1.4.1-py3-none-any.whl
| Download URL | here-1.4.1-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b1b24da7657b86a8a4fbbe40e68710e3a7950867ba52c7a1b8d6ea890a00ad3
|
|
BLAKE2b-256 checksum How to use checksums |
3299ec8a150569902ea0eb915d64c5b8f8f40c3679963e4f615066a34e36dc2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.
Transparency logSecurity for here 1.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for here-1.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.