Skip to main content

Change working directory up a number of levels or to a named folder

Project description

ezdir

Simple utilities to change the current working directory in Python:

  • up(n) changes working folder to be up n directory levels.
  • find("foldername") changes working folder to the first parent folder matching a name.

Installation

pip install ezdir

Example

import ezdir

ezdir.up(1) # Change current working directory to one level up
ezdir.find("GitProjects") # Change current working directory to a parent folder named 'GitProjects'

Why use it?

Changing working directory in a Jupyter Notebook

If you are using a notebook on a cloud server, your working directory might be different to some elses. Normally people do something like:

import os

os.chdir(path)

But sometimes this path will be different based on the user. This library provides a more sensible way of going up folder paths whether you're using a python script or a notebook.

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

ezdir-0.2.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezdir-0.2.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file ezdir-0.2.0.tar.gz.

File metadata

  • Download URL: ezdir-0.2.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.16

File hashes

Hashes for ezdir-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7f8e40705cd3fc549851fb21921e65f24c5ba9192eb659e5cb7c08a50cf82ac7
MD5 cf46af00605ac23916a13820fe78c394
BLAKE2b-256 e47f392c1e3440db2ba87341d76be432186545d3ca9d1404234430f58da0f502

See more details on using hashes here.

File details

Details for the file ezdir-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ezdir-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.16

File hashes

Hashes for ezdir-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb440130768aaac8a88f76483a12be9320055d7f5941e927e0b9439ac52f1489
MD5 c6e50fbe6c16e8cb60e3d939a5a30244
BLAKE2b-256 b9d08f7670e0dc3a9b30b07b6172f70c64d0f79a204dfc10be554636f97b81ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page