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

python setup.py develop
pip install -r requirements-test.txt
flake8
mypy syspath --strict
coverage run -m unittest
coverage report
flake8

Publishing

pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*

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-2.0.6.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

syspath-2.0.6-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: syspath-2.0.6.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for syspath-2.0.6.tar.gz
Algorithm Hash digest
SHA256 8b76e9f1f4a5e2de25080c3e75bc50a89541d244aa8b3412ed3bb79f64a2c5d7
MD5 a072367394d3aad3981ea291398dbfae
BLAKE2b-256 45bb4a7821605decb2d3fc806055d56d40ad1342bf587dd212e41f457c2150e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: syspath-2.0.6-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for syspath-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c8468f29741dde900dd254ed95fa948623fa576da20d8a9bb369b822827c80be
MD5 53e53525eaddc7a4c41a5a227e346c05
BLAKE2b-256 a62b9f1c42f03463086399953349da5a231ae8fce43c25fb276e907cf4b4f986

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