syspath


Namesyspath JSON
Version 3.0.6 PyPI version JSON
download
home_page
SummaryEasily add common paths to sys.path
upload_time2024-03-18 04:27:32
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords python path utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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)
[![Dependency Status](https://pyup.io/repos/github/albertyw/syspath/shield.svg)](https://pyup.io/repos/github/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 . --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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "syspath",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "python,path,utility",
    "author": "",
    "author_email": "Albert Wang <git@albertyw.com>",
    "download_url": "https://files.pythonhosted.org/packages/8b/8b/3bc54fd4a5ca1632feb89bc79ab75f40be81312d8f0f2d010c8d7a84b327/syspath-3.0.6.tar.gz",
    "platform": null,
    "description": "SysPath\n=======\n\n[![PyPI](https://img.shields.io/pypi/v/syspath.svg)]( https://pypi.python.org/pypi/syspath/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syspath)\n![PyPI - License](https://img.shields.io/pypi/l/syspath)\n\n[![Build Status](https://drone.albertyw.com/api/badges/albertyw/syspath/status.svg)](https://drone.albertyw.com/albertyw/syspath)\n[![Dependency Status](https://pyup.io/repos/github/albertyw/syspath/shield.svg)](https://pyup.io/repos/github/albertyw/syspath/)\n[![Code Climate](https://codeclimate.com/github/albertyw/syspath/badges/gpa.svg)](https://codeclimate.com/github/albertyw/syspath)\n[![Code Climate Test Coverage](https://codeclimate.com/github/albertyw/syspath/badges/coverage.svg)](https://codeclimate.com/github/albertyw/syspath/coverage)\n\n\nSysPath is a package to easily set common paths into `sys.path`. Instead\nof having to do a lot of path manipulation to properly import files, a\nfile can import from SysPath instead.\n\nInstallation\n------------\n\n```bash\npip install syspath\n```\n\nUsage\n-----\n\nTo append the current file's directory to `sys.path`:\n\n```python\nimport syspath\nsyspath.append_current_path()\n# or\nfrom syspath import current_path\n```\n\nTo append the current file's parent directory to `sys.path`:\n\n```python\nimport syspath\nsyspath.append_parent_path()\n# or\nfrom syspath import parent_path\n```\n\nTo append the current file's git repository root to `sys.path`:\n\n```python\nimport syspath\nsyspath.append_git_root()\n# or\nfrom syspath import git_root\n```\n\nEach of the shortcut modules also provide a `path` variable that can be\nused to get the path added.\n\nDevelopment\n-----------\n\n```bash\npip install -e .[test]\nruff check .\nmypy . --strict\ncoverage run -m unittest\ncoverage report -m\nruff check .\n```\n\nPublishing\n----------\n\n1.  Update `CHANGELOG.md`\n2.  Update `syspath/__version__.py`\n3.  Commit, tag with the version number, and push\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Easily add common paths to sys.path",
    "version": "3.0.6",
    "project_urls": {
        "Homepage": "https://github.com/albertyw/syspath"
    },
    "split_keywords": [
        "python",
        "path",
        "utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e40d9b2960b41cbcdf88e1473a7dcf744a57919d69122611eac47d5f78bd63df",
                "md5": "a9101a74bfc4de099207c50616374a75",
                "sha256": "ce533d71bf26ad2975fe66fca5fed4c1e1aa27232fac9cb42726bfa06b27b475"
            },
            "downloads": -1,
            "filename": "syspath-3.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a9101a74bfc4de099207c50616374a75",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5091,
            "upload_time": "2024-03-18T04:27:30",
            "upload_time_iso_8601": "2024-03-18T04:27:30.904845Z",
            "url": "https://files.pythonhosted.org/packages/e4/0d/9b2960b41cbcdf88e1473a7dcf744a57919d69122611eac47d5f78bd63df/syspath-3.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b8b3bc54fd4a5ca1632feb89bc79ab75f40be81312d8f0f2d010c8d7a84b327",
                "md5": "f921c344268d0e9e77d93f6034373111",
                "sha256": "951e3113763e01854edb8ee2fa11fffb43f351cc705b1b540df66a8d12703ea8"
            },
            "downloads": -1,
            "filename": "syspath-3.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "f921c344268d0e9e77d93f6034373111",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5308,
            "upload_time": "2024-03-18T04:27:32",
            "upload_time_iso_8601": "2024-03-18T04:27:32.234137Z",
            "url": "https://files.pythonhosted.org/packages/8b/8b/3bc54fd4a5ca1632feb89bc79ab75f40be81312d8f0f2d010c8d7a84b327/syspath-3.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 04:27:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "albertyw",
    "github_project": "syspath",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "syspath"
}
        
Elapsed time: 0.20942s