Skip to main content

Easily add common paths to sys.path

Project description

PyPI Python Versions

Codeship Status for albertyw/syspath Dependency Status 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

Syspath should work with both python 2 and 3.

pip install -r requirements-test.txt
pip install -r requirements-test-python3.txt
mypy syspath/syspath.py
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-1.1.0.tar.gz (4.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-1.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: syspath-1.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for syspath-1.1.0.tar.gz
Algorithm Hash digest
SHA256 858e030020211260e292a82e18edc240939bf68704ac81ecb43d95270d856b1a
MD5 ace9432a4999fc6c5f8448941471f765
BLAKE2b-256 617a0731b6943871960ae5b417037e3d7f54d15b6aebcacfd2f4cc1f48828d2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for syspath-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4a3632b717d3243d83b210c08173811d08877dd91b1ef739c13cdfc4e22664c
MD5 1724b9110d7a96c8b650653c2bab74a5
BLAKE2b-256 f5eeb46d7c9b662a5fb93498b032715f5104dbae494fb7dc79c1650c65c0368d

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