Skip to main content

Easily add common paths to sys.path

Project description

SysPath

PyPI PyPI - Python Version PyPI - License

Build Status Maintainability Code 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 .
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.8.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: syspath-3.0.8.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for syspath-3.0.8.tar.gz
Algorithm Hash digest
SHA256 25c701f416d7645e79da19c88270f155176e75a88e8ee2209fa9bb7875ac0f5c
MD5 0eee75e30dd755ea2f590b824a7903d5
BLAKE2b-256 6606e66e4c694a58a8146577215ee103a099274f18d8d5e3f4d6ec2a88249050

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for syspath-3.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2d145f955194776dc8381f92db57a03f3b2814fb801d2ccc621b5e5a3cebedd2
MD5 1b80c5d77d18d11bd1b53b8c52a7fa2b
BLAKE2b-256 43cdafed4ce40af2fa2219afc3598306883349b768142d7823bd593f5226dbbb

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