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 . --strict
coverage run -m unittest
coverage report -m
flake8

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.1.tar.gz (6.9 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.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: syspath-3.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for syspath-3.0.1.tar.gz
Algorithm Hash digest
SHA256 f5e36cf5873d8c9016b848320c265d762cd240ad92616c66677989fbe6b8db1a
MD5 30e9c26fcae3b3956976ce2227bc3238
BLAKE2b-256 42c48b5c49d06cd04b2f882d1a459111f0d1686b16b801d7a85f73640c93ecfc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: syspath-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for syspath-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cecf711b677369a3c34a528181f58538a6e7dc3c88decde2ffe3898b8c374c36
MD5 dc490ed6a08a8c4c190232a2d4672067
BLAKE2b-256 e5c38234e438868e71747d318781bd3c23cde55d334554d373b98d2c8339175f

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