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
ruff check .
mypy . --strict
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.3.tar.gz (5.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-3.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: syspath-3.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for syspath-3.0.3.tar.gz
Algorithm Hash digest
SHA256 4b16bdc396988cd36acc53d11f04ddae9f5bd608a88f6e766d60fb30bbdc5d0d
MD5 4602fcfb9fc8b02dbe546ae4a8b75214
BLAKE2b-256 7557736799ce711bd714c4611cc5cc208cf5d85bf4dc8240d2ee7f6054c944bb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for syspath-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8c311b843a78db7837e981f53ba3ac8b0efbb910d0cc6e633a28716ab9bd90de
MD5 377154f24a6c4e9b70493e5450af3d0a
BLAKE2b-256 357c8bdc8d9666162aff6476a9721649507cc2c2f689654ddea715b14ec26aa7

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