Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

syspath

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syspath

Easily add common paths to sys.path

  • 3.0.6
  • PyPI
  • Socket score

Maintainers
1

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

pip install -e .[test]
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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc