Skip to main content

Easily add common paths to sys.path

Project description

SysPath

PyPI PyPI - Python Version PyPI - License

Codeship Status for albertyw/syspath 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 -r requirements-test.txt
mypy syspath --strict
coverage run setup.py test
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.4.tar.gz (6.3 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.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: syspath-2.0.4.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for syspath-2.0.4.tar.gz
Algorithm Hash digest
SHA256 4851a7612b92dd6bc6dd2c085a2e8abf5cfb3100bea1e88c35c6348e560bcfed
MD5 6e92c06911658376d39aa9c30a6304d2
BLAKE2b-256 8c4fb9f757c3fbc00208199c9a1b20c56f2834bf7137d9ce0e41bfcc44cf5981

See more details on using hashes here.

File details

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

File metadata

  • Download URL: syspath-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for syspath-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 04a5cb885fe6adac2721a3e8090abfe5282ceacd6131e920fadb41d70df057dc
MD5 aea2280affcdac522502a03903086875
BLAKE2b-256 90d80a2fcdae736fb6e9b79088088be2b7cd05d216468b95c90274a45343b91f

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