Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertyw/syspath
Easily add common paths to sys.path
https://github.com/albertyw/syspath
hacktoberfest path python python-library utilities
Last synced: 2 months ago
JSON representation
Easily add common paths to sys.path
- Host: GitHub
- URL: https://github.com/albertyw/syspath
- Owner: albertyw
- License: mit
- Created: 2017-12-18T13:21:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-18T04:26:20.000Z (10 months ago)
- Last Synced: 2024-04-14T05:53:08.956Z (9 months ago)
- Topics: hacktoberfest, path, python, python-library, utilities
- Language: Python
- Homepage:
- Size: 94.7 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
SysPath
=======[![PyPI](https://img.shields.io/pypi/v/syspath.svg)]( https://pypi.python.org/pypi/syspath/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syspath)
![PyPI - License](https://img.shields.io/pypi/l/syspath)[![Build Status](https://drone.albertyw.com/api/badges/albertyw/syspath/status.svg)](https://drone.albertyw.com/albertyw/syspath)
[![Code Climate](https://codeclimate.com/github/albertyw/syspath/badges/gpa.svg)](https://codeclimate.com/github/albertyw/syspath)
[![Code Climate Test Coverage](https://codeclimate.com/github/albertyw/syspath/badges/coverage.svg)](https://codeclimate.com/github/albertyw/syspath/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
------------```bash
pip install syspath
```Usage
-----To append the current file's directory to `sys.path`:
```python
import syspath
syspath.append_current_path()
# or
from syspath import current_path
```To append the current file's parent directory to `sys.path`:
```python
import syspath
syspath.append_parent_path()
# or
from syspath import parent_path
```To append the current file's git repository root to `sys.path`:
```python
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
-----------```bash
pip install -e .[test]
ruff check .
mypy .
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