pssepath


Namepssepath JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://github.com/danifus/pssepath
SummarySimplified PSSe python importing
upload_time2023-08-05 02:56:44
maintainer
docs_urlNone
authorDaniel Hillier
requires_python>=2.5
licenseMIT
keywords psse extension utility pssepath
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
pssepath - Easy PSSE Python coding
====================================

*author*: whit. (whit.com.au)

`pssepath` simplifies the code required to setup the Python environment necessary
to use the PSSE API. Using `pssepath` all you have to do is::

```python
    import pssepath
    pssepath.add_pssepath()

    import psspy
```

Tested and works on:

- PSSE 32
- PSSE 33
- PSSE 34
- PSSE 35

Supports 32 and 64 bit windows (and provides warnings when using mismatched 64
bit python when PSSE requires 32 bit python).

Using this module makes the PSSE system files available for use while avoiding
making modifications to system paths or hardcoding the location of the PSSE
system folders. This makes PSSE easy to use.

Without `pssepath`, you have to do something like this::

```python
    import os
    import sys

    PSSE_LOCATION = r"C:\Program Files\PTI\PSSE32\PSSBIN"
    sys.path.append(PSSE_LOCATION)
    os.environ['PATH'] = os.environ['PATH'] + ';' +  PSSE_LOCATION

    import psspy
```

Furthermore, by including `pssepath` with any scripts you distribute, others will
be able to use your code without having to edit your code to suit their
varying install paths (such as different versions of PSSE).

It can also provide information about which version of Python to use with a
particular install of PSSE to avoid `ImportError: Bad magic number...`.

Installation
-------------

`pip install pssepath`

or copy the `pssepath` code directory (the dir that contains `core.py`) to your
project's root directory.


Usage
------
`pssepath` provides 3 methods for setting up the PSSE paths:


- `pssepath.add_pssepath()`

    Adds the most recent version of PSSE that works with the currently
    running version of Python.

- `pssepath.add_pssepath(<version>)`

    Adds the requested version of PSSE. Remember that specifying a version
    number may make your code less portable if you or your colleagues ever use a
    different version.  `pssepath.add_pssepath(33)`

- `pssepath.select_pssepath()`

    Produces a menu of all the PSSE and Python installs on your system,
    along with the required version of Python.

If you have set up your system to have the PSSE system files on the system path
at all times, `pssepath` will only use these files.

For information about the PSSE versions installed on your system, either:

- execute the pssepath.py file from windows; or
- run `python -m pssepath.pssepathinfo` You may have to specify the python
  install path: ie. `c:\Python25\python -m pssepath.pssepathinfo` or `py.exe
  -2.5 -m pssepath.pssepathinfo`

This will provide you with a summary similar to the following::

```
Found the following versions of PSSE installed:

    1. PSSE version 32
        Requires Python 2.5-32bit (Current running Python)
    2. PSSE version XX
        Requires Python 2.X-32bit (Installed)
    3. PSSE version XX
        Requires Python 2.X-32bit

Found the following Python installations:
  2.5-32bit (currently running):
    PythonCore: C:\Python25\
  3.7-64bit:
    PythonCore: C:\Users\dan\AppData\Local\Programs\Python\Python37\
```

The status next to the Python version indicates the installation status of the
required Python for the particular PSSE install.

- `Current running Python`

    indicates the Python version used to invoke the script
    (`c:\Python25\python.exe` if invoked as `c:\Python25\python.exe -m pssepath`) is
    appropriate for that version of PSSE.

- `Installed`

  indicates that a Python version different to the one used to invoke the
  script is required for that PSSE version, but that it is already installed
  on your system.

`<nothing>`

  The absence of a status means that a different version of Python is
  required to run that version of PSSE and it is not installed on your
  system. As Python comes bundled with PSSE, this status is unlikely.

Ensuring you use the correct version of Python for the version of PSSE you are
running will avoid seeing `ImportError: Bad magic number...` ever again.

License
--------
This program is released under the very permissive MIT license. You may freely
use it for commercial purposes, without needing to provide modified source.

Read the LICENSE file for more information.

Tips on managing multiple Python versions
-------------------------------------------
I like to use batch files that point to a specific python version.  For
example::

```shell
$ more C:\bin\python25.bat
@C:\Python25\python.exe %*
```

Where the PATH includes `c:\bin`.  Now you can run python scripts with the
command::

```shell
python25 myscript.py args
```

instead of:

```shell
c:\Python25\python.exe myscript.py args
```

Contributers
--------------
Discussion about this module was conducted at the [Python for PSSE Forum](https://psspy.org/psse-help-forum/question/3/how-do-i-import-the-psspy-module-in-a-python>) involving the following members:

- Daniel Hillier
- JervisW
- Chip Webber

Improvements or suggestions
-----------------------------
Visit the [Python for PSSE Forum](https://psspy.org/psse-help-forum/question/3/how-do-i-import-the-psspy-module-in-a-python>)

See also:

- github: https://github.com/danifus/pssepath
- contact: daniel@whit.com.au

For any other questions about Python and PSSE, feel free to raise them on the
[Python for PSSE Forum](https://psspy.org>)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/danifus/pssepath",
    "name": "pssepath",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.5",
    "maintainer_email": "",
    "keywords": "psse extension utility pssepath",
    "author": "Daniel Hillier",
    "author_email": "daniel.hillier@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/db/63/a2a0853e28b0d7fa7f8fb1a81e3cb8eeb236d92dff849a098748a04bc170/pssepath-0.2.3.tar.gz",
    "platform": null,
    "description": "\npssepath - Easy PSSE Python coding\n====================================\n\n*author*: whit. (whit.com.au)\n\n`pssepath` simplifies the code required to setup the Python environment necessary\nto use the PSSE API. Using `pssepath` all you have to do is::\n\n```python\n    import pssepath\n    pssepath.add_pssepath()\n\n    import psspy\n```\n\nTested and works on:\n\n- PSSE 32\n- PSSE 33\n- PSSE 34\n- PSSE 35\n\nSupports 32 and 64 bit windows (and provides warnings when using mismatched 64\nbit python when PSSE requires 32 bit python).\n\nUsing this module makes the PSSE system files available for use while avoiding\nmaking modifications to system paths or hardcoding the location of the PSSE\nsystem folders. This makes PSSE easy to use.\n\nWithout `pssepath`, you have to do something like this::\n\n```python\n    import os\n    import sys\n\n    PSSE_LOCATION = r\"C:\\Program Files\\PTI\\PSSE32\\PSSBIN\"\n    sys.path.append(PSSE_LOCATION)\n    os.environ['PATH'] = os.environ['PATH'] + ';' +  PSSE_LOCATION\n\n    import psspy\n```\n\nFurthermore, by including `pssepath` with any scripts you distribute, others will\nbe able to use your code without having to edit your code to suit their\nvarying install paths (such as different versions of PSSE).\n\nIt can also provide information about which version of Python to use with a\nparticular install of PSSE to avoid `ImportError: Bad magic number...`.\n\nInstallation\n-------------\n\n`pip install pssepath`\n\nor copy the `pssepath` code directory (the dir that contains `core.py`) to your\nproject's root directory.\n\n\nUsage\n------\n`pssepath` provides 3 methods for setting up the PSSE paths:\n\n\n- `pssepath.add_pssepath()`\n\n    Adds the most recent version of PSSE that works with the currently\n    running version of Python.\n\n- `pssepath.add_pssepath(<version>)`\n\n    Adds the requested version of PSSE. Remember that specifying a version\n    number may make your code less portable if you or your colleagues ever use a\n    different version.  `pssepath.add_pssepath(33)`\n\n- `pssepath.select_pssepath()`\n\n    Produces a menu of all the PSSE and Python installs on your system,\n    along with the required version of Python.\n\nIf you have set up your system to have the PSSE system files on the system path\nat all times, `pssepath` will only use these files.\n\nFor information about the PSSE versions installed on your system, either:\n\n- execute the pssepath.py file from windows; or\n- run `python -m pssepath.pssepathinfo` You may have to specify the python\n  install path: ie. `c:\\Python25\\python -m pssepath.pssepathinfo` or `py.exe\n  -2.5 -m pssepath.pssepathinfo`\n\nThis will provide you with a summary similar to the following::\n\n```\nFound the following versions of PSSE installed:\n\n    1. PSSE version 32\n        Requires Python 2.5-32bit (Current running Python)\n    2. PSSE version XX\n        Requires Python 2.X-32bit (Installed)\n    3. PSSE version XX\n        Requires Python 2.X-32bit\n\nFound the following Python installations:\n  2.5-32bit (currently running):\n    PythonCore: C:\\Python25\\\n  3.7-64bit:\n    PythonCore: C:\\Users\\dan\\AppData\\Local\\Programs\\Python\\Python37\\\n```\n\nThe status next to the Python version indicates the installation status of the\nrequired Python for the particular PSSE install.\n\n- `Current running Python`\n\n    indicates the Python version used to invoke the script\n    (`c:\\Python25\\python.exe` if invoked as `c:\\Python25\\python.exe -m pssepath`) is\n    appropriate for that version of PSSE.\n\n- `Installed`\n\n  indicates that a Python version different to the one used to invoke the\n  script is required for that PSSE version, but that it is already installed\n  on your system.\n\n`<nothing>`\n\n  The absence of a status means that a different version of Python is\n  required to run that version of PSSE and it is not installed on your\n  system. As Python comes bundled with PSSE, this status is unlikely.\n\nEnsuring you use the correct version of Python for the version of PSSE you are\nrunning will avoid seeing `ImportError: Bad magic number...` ever again.\n\nLicense\n--------\nThis program is released under the very permissive MIT license. You may freely\nuse it for commercial purposes, without needing to provide modified source.\n\nRead the LICENSE file for more information.\n\nTips on managing multiple Python versions\n-------------------------------------------\nI like to use batch files that point to a specific python version.  For\nexample::\n\n```shell\n$ more C:\\bin\\python25.bat\n@C:\\Python25\\python.exe %*\n```\n\nWhere the PATH includes `c:\\bin`.  Now you can run python scripts with the\ncommand::\n\n```shell\npython25 myscript.py args\n```\n\ninstead of:\n\n```shell\nc:\\Python25\\python.exe myscript.py args\n```\n\nContributers\n--------------\nDiscussion about this module was conducted at the [Python for PSSE Forum](https://psspy.org/psse-help-forum/question/3/how-do-i-import-the-psspy-module-in-a-python>) involving the following members:\n\n- Daniel Hillier\n- JervisW\n- Chip Webber\n\nImprovements or suggestions\n-----------------------------\nVisit the [Python for PSSE Forum](https://psspy.org/psse-help-forum/question/3/how-do-i-import-the-psspy-module-in-a-python>)\n\nSee also:\n\n- github: https://github.com/danifus/pssepath\n- contact: daniel@whit.com.au\n\nFor any other questions about Python and PSSE, feel free to raise them on the\n[Python for PSSE Forum](https://psspy.org>)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simplified PSSe python importing",
    "version": "0.2.3",
    "project_urls": {
        "Homepage": "https://github.com/danifus/pssepath"
    },
    "split_keywords": [
        "psse",
        "extension",
        "utility",
        "pssepath"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13d5029113733657beff2afa23ec0edea5019c47e1088afc20541ab498215c8c",
                "md5": "c9f453cce70675ec40b2f7ade6adfda9",
                "sha256": "160565fbddf54470fed9f38e75195ec316fab724c10307b585c1885b3b20f377"
            },
            "downloads": -1,
            "filename": "pssepath-0.2.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9f453cce70675ec40b2f7ade6adfda9",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.5",
            "size": 13803,
            "upload_time": "2023-08-05T02:56:43",
            "upload_time_iso_8601": "2023-08-05T02:56:43.244132Z",
            "url": "https://files.pythonhosted.org/packages/13/d5/029113733657beff2afa23ec0edea5019c47e1088afc20541ab498215c8c/pssepath-0.2.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db63a2a0853e28b0d7fa7f8fb1a81e3cb8eeb236d92dff849a098748a04bc170",
                "md5": "60629cf7fdcd7cb14c7a321779a883e7",
                "sha256": "6700801269cce389cccefe6867ef9e0956d049437fd832b4f012a6f2613e106f"
            },
            "downloads": -1,
            "filename": "pssepath-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "60629cf7fdcd7cb14c7a321779a883e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.5",
            "size": 15287,
            "upload_time": "2023-08-05T02:56:44",
            "upload_time_iso_8601": "2023-08-05T02:56:44.999952Z",
            "url": "https://files.pythonhosted.org/packages/db/63/a2a0853e28b0d7fa7f8fb1a81e3cb8eeb236d92dff849a098748a04bc170/pssepath-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-05 02:56:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "danifus",
    "github_project": "pssepath",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pssepath"
}
        
Elapsed time: 0.09640s