GithubHelp home page GithubHelp logo

wildland-creative / pyhere Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 1.0 50 KB

A Python 2.x / 3.x equivalent of R's here package - trivial relative paths for python data science / analysis projects.

Home Page: https://wildland-creative.github.io/pyhere/

License: MIT License

Python 100.00%
analysis data-science here relative-path

pyhere's People

Contributors

joshpsawyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

supperundsupper

pyhere's Issues

full sphinx documentation

It's probably worth learning sphinx / rst for this module and getting the documentation up on readthedocs.

Why is this package needed?

You can always get the path of the current script with __file__

$ python bar.py 
/Users/myuser/tmp/foo/bar.py
$ cd ..
$ python foo/bar.py 
/Users/myuser/tmp/foo/bar.py
$ more foo/bar.py 
import os
print(os.path.abspath(__file__))

Sync with upstream repository, pyprojroot

Hello ๐Ÿ‘‹ @joshpsawyer we've made a bunch of internal changes to pyprojroot. Wondering if you are potentially sync up with the repository?
My main thinking was we would make pyhere.here() as a thin wrapper around pyprojroot.here.here()? would reduce potential maintenance things on your end, and we can work on how both packages can share a common root_indicator values.

Mainly asking because I think it would be nice to have both of these packages be submitted as a pair for pyopensci and potentially a JOSS publication.

Related "upstream" issues: chendaniely/pyprojroot#40 chendaniely/pyprojroot#18 chendaniely/pyprojroot#14

Finish writing tests

Only one test exists so far to verify find_root() and only for one root_indicator. Need to parameterize the tests, create additional tests for other functions and then verify code coverage

Returns current working directory + relative path with here()

Hi,

Firstly, thank you so much for developing this. I appreciate having an equivalent to R's here in Python.

When I try to use pyhere's here, I am instead returned the concatenation of the current working directory and the relative path to the desired directory/file:

>>> here(f"flows/02_gcp/data/yellow/yellow_tripdata_2021_01.parquet")
PosixPath('/Users/artas/GithubProjects/DE-Zoomcamp-FollowAlong/week_2_workflow_orchestration/flows/03-deployments/../../../flows/02_gcp/data/yellow/yellow_tripdata_2021_01.parquet')

Strictly speaking, I don't expect this to cause any problems, but I was wondering why it doesn't cleanly display the relative path from the project root directory. There are, as far as I can tell, no root indicators in 03-deployments/. I added a .here to root dir even though it already had a .git but that didn't change anything.

Anyway, not really causing a problem, was just curious.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.