Skip to main content

Easily add common paths to sys.path

Project description

SysPath

PyPI PyPI - Python Version PyPI - License

Build Status Dependency Status Code Climate Code Climate Test Coverage

SysPath is a package to easily set common paths into sys.path. Instead of having to do a lot of path manipulation to properly import files, a file can import from SysPath instead.

Installation

pip install syspath

Usage

To append the current file's directory to sys.path:

import syspath
syspath.append_current_path()
# or
from syspath import current_path

To append the current file's parent directory to sys.path:

import syspath
syspath.append_parent_path()
# or
from syspath import parent_path

To append the current file's git repository root to sys.path:

import syspath
syspath.append_git_root()
# or
from syspath import git_root

Each of the shortcut modules also provide a path variable that can be used to get the path added.

Development

pip install -e .[test]
ruff check .
mypy . --strict
coverage run -m unittest
coverage report -m
ruff check .

Publishing

  1. Update CHANGELOG.md
  2. Update syspath/__version__.py
  3. Commit, tag with the version number, and push

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

syspath-3.0.6.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

syspath-3.0.6-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file syspath-3.0.6.tar.gz.

File metadata

  • Download URL: syspath-3.0.6.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for syspath-3.0.6.tar.gz
Algorithm Hash digest
SHA256 951e3113763e01854edb8ee2fa11fffb43f351cc705b1b540df66a8d12703ea8
MD5 f921c344268d0e9e77d93f6034373111
BLAKE2b-256 8b8b3bc54fd4a5ca1632feb89bc79ab75f40be81312d8f0f2d010c8d7a84b327

See more details on using hashes here.

File details

Details for the file syspath-3.0.6-py3-none-any.whl.

File metadata

  • Download URL: syspath-3.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for syspath-3.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ce533d71bf26ad2975fe66fca5fed4c1e1aa27232fac9cb42726bfa06b27b475
MD5 a9101a74bfc4de099207c50616374a75
BLAKE2b-256 e40d9b2960b41cbcdf88e1473a7dcf744a57919d69122611eac47d5f78bd63df

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