# Ignition Scripting API now available via pypi

**URL:** <https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800>\
**Category:** Ignition\
**Tags:** ignition81, ignition80, scripting\
**Created:** [September 9, 2021, 9:26pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800 "2021-09-09T21:26:32Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [September 9, 2021, 9:26pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/1 "2021-09-09T21:26:33Z")

</div>

In the past I have shared with this community the Ignition repo I maintain at GitHub:

> **[GitHub - thecesrom/Ignition: ⚡ A set of packages and modules that allows...](https://github.com/thecesrom/Ignition)**
>
> ⚡ A set of packages and modules that allows developers to get code completion for Ignition Scripting API scripting functions in their IDE of choice. - GitHub - thecesrom/Ignition: ⚡ A set of packag...

And inspired by a comment made by @kgamble and someone’s [fork](https://github.com/PlentyAg/ignition_mock), I created the `ignition-api` package available to anyone interested.

> **[ignition-api](https://pypi.org/project/ignition-api/)**
>
> Ignition Scripting API.

Currently I have only created releases for versions `8.0.17` (`8.0` branch from the repo), `8.1.9`, and `8.1.10` (`main` branch from the repo).

I recommend using Python 2.7.18, and to install you may use any of the following:

To get the latest and/or upgrade:

```bash
$ python2 -m pip install --upgrade ignition-api

```

Or to get a specific version:

```bash
$ python2 -m pip install ignition-api==8.0.17.post1

```

or

```bash
$ python2 -m pip install ignition-api==8.1.9

```

For the `7.9` branch I am relying on Python 2.5 (since Ignition relies on Jython 2.5.3), so `pip` doesn’t appear to work, but you may still do the following:

```bash
$ git clone --single-branch --branch 7.9 https://github.com/thecesrom/Ignition.git 7.9
$ cd 7.9
$ python2 setup.py install --record files.txt

```

**Note:** Starting with release 7.9.19 all you’d have to do is download the source code for its release, un[zip|tar] it and use the `setup.py` from each release.

The `--record` option is so you create a receipt of all installed files in case you want to uninstall it by running:

```bash
$ cat files.txt | xargs rm -rf

```

As for the `jython` branch, the process is somewhat similar to `7.9`'s but with certain distinctions.

**Note** : I recommend installing Jython with `pip` included to make it a lot easier to install/uninstall packages.

Starting with the [`8.1.10-jython`](https://github.com/thecesrom/Ignition/releases/tag/v8.1.10-jython) release, just run the following:

```bash
$ jython -m pip install https://github.com/thecesrom/Ignition/archive/refs/tags/v8.1.10-jython.zip
DEPRECATION: A future version of pip will drop support for Python 2.7.
Collecting https://github.com/thecesrom/Ignition/archive/refs/tags/v8.1.10-jython.zip
  Using cached https://github.com/thecesrom/Ignition/archive/refs/tags/v8.1.10-jython.zip
Installing collected packages: ignition-api-jython
  Running setup.py install for ignition-api-jython ... done
Successfully installed ignition-api-jython-8.1.10

```

Just replace `v#.#.#-jython.zip` using the latest stable version.

And to uninstall:

```bash
$ jython -m pip uninstall ignition-api -y

```

And that’s it.

Happy coding!

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [September 9, 2021, 9:32pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/2 "2021-09-09T21:32:23Z")

</div>

This has been tested using Python 2.7.18, 2.5.6, and Jython 2.7.1 and 2.7.2, as well as PyCharm. All of this was so it could also work on Visual Studio Code, but unfortunately it does not.

See here:

> <https://twitter.com/thecesrom/status/1433560474386268161>

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [September 10, 2021, 9:57pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/3 "2021-09-10T21:57:49Z")

</div>

If at some point `jython -m pip install ignition-api-jython` from PyPI works, I have also created that package.

> **[ignition-api-jython](https://pypi.org/project/ignition-api-jython/)**
>
> Ignition Scripting API.

Alternatively if you wish to install it, you may use the latest release from the [`jython`](https://github.com/thecesrom/Ignition/tree/jython) branch.

For release `8.1.10-jython` you would do the following:

```bash
$ jython -m pip install https://github.com/thecesrom/Ignition/archive/refs/tags/v8.1.10-jython.zip
Collecting https://github.com/thecesrom/Ignition/archive/refs/tags/v8.1.10-jython.zip
  Downloading https://github.com/thecesrom/Ignition/archive/refs/tags/v8.1.10-jython.zip
     \ 225kB 1.6MB/s
Installing collected packages: ignition-api-jython
  Running setup.py install for ignition-api-jython ... done
Successfully installed ignition-api-jython-8.1.10
$ jython -m pip list
Package Version
------------------- -------
ignition-api-jython 8.1.10
pip 19.1
setuptools 41.0.1

```

This will allow you to do something like:

```bash
$ jython
Jython 2.7.2 (v2.7.2:925a3cc3b49d, Mar 21 2020, 10:03:58)
[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)] on java11.0.11
Type "help", "copyright", "credits" or "license" for more information.
>>> import system.gui
>>> system.gui.warningBox("This one is a warning.")

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/61d1e7bb32620c4b1ab223eda8ad3a0b205e5cea.png)

Just make sure you change the version number from the URL, i.e. `v#.#.#-jython.zip` to the latest. But note that the `ignition-api-jython` package is for version 8.1.10 onwards.

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [September 23, 2021, 8:23pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/4 "2021-09-23T20:23:11Z")

</div>

An update.

After `pip`-installing `ignition-api` I am able to get code completion on Visual Studio Code, so I can mark the following feature request as implemented.

> [@Ignition repo now with branches](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/6):
>
> I feel like combining your repository with a VS extension would be a pretty easy way to add an “Ignition” extension that automatically includes the libraries

The following versions now include the `com.inductiveautomation` package, just consider that it is not a one-to-one implementation. I have only created the necessary code for some use cases.

Latest versions and how to install them:

8.1.10

```bash
$ python2 -m pip install ignition-api

```

8.0.17

```bash
$ python2 -m pip install ignition-api==8.0.17.post3

```

7.9.18

```bash
$ python2 -m pip install ignition-api==7.9.18.post2

```

Code completion works on PyCharm 2021.2.2 (also when running the code from its Python Console) and Visual Studio Code 1.60.2 for the following versions:  
 7.9.18 (from [`7.9`](https://github.com/thecesrom/Ignition/tree/7.9) branch)  
 8.0.17 (from [`8.0`](https://github.com/thecesrom/Ignition/tree/8.0) branch)  
 8.1.10 (from [`main`](https://github.com/thecesrom/Ignition/tree/main) branch)

As for `8.1.10-jython`, Visual Studio Code does not appear to support Jython as an interpreter, and on PyCharm these are the features that work:  
 Code completion (a.k.a. intellisense)  
 Python Console (see: [PY-44759](https://youtrack.jetbrains.com/issue/PY-44759), [PY-50491](https://youtrack.jetbrains.com/issue/PY-50491))

And apparently Jython appears to struggle when trying to import anything under `com.inductiveautomation`.

So, considering all of the above, the `jython` branch, as fun as it was to work on it, will no longer be maintained. It will be kept until `8.1.11` is released just in case something or someone steps in.

---

<div class="post-metadata">

**Author:** ![Jarrid\_Fraley](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@Jarrid\_Fraley](https://forum.inductiveautomation.com/u/Jarrid_Fraley)\
**Post date:** [July 14, 2023, 5:49pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/5 "2023-07-14T17:49:11Z")

</div>

How would I leverage this package to read memory tags from an ignition gateway?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 14, 2023, 5:56pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/6 "2023-07-14T17:56:40Z")

</div>

You wouldn’t, that’s not its purpose. It’s a bunch of mocks that can be used when editing code in an editor with auto completion, so that mocks for Ignition’s system functions also auto complete.

Start a new topic about what you’re asking.

---

<div class="post-metadata">

**Author:** ![Jarrid\_Fraley](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@Jarrid\_Fraley](https://forum.inductiveautomation.com/u/Jarrid_Fraley)\
**Post date:** [July 14, 2023, 6:03pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/7 "2023-07-14T18:03:12Z")

</div>

Ok understood. Thank you!

---

<div class="post-metadata">

**Author:** ![Jarrid\_Fraley](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@Jarrid\_Fraley](https://forum.inductiveautomation.com/u/Jarrid_Fraley)\
**Post date:** [July 14, 2023, 6:08pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/8 "2023-07-14T18:08:28Z")

</div>

My new topic is Accessing Ignition tags from external micro service

---

<div class="post-metadata">

**Author:** ![John\_S1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@John\_S1](https://forum.inductiveautomation.com/u/John_S1)\
**Post date:** [September 20, 2024, 5:43am UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/9 "2024-09-20T05:43:09Z")

</div>

Hi guys, can somebody guide me how to use this in the visual studio code, i have tried cloning the repo and i was able to see all those in my vs code editor and then i created a python file, but no auto completion or code execution is happening.  
python version is 2.7.18  
even for system function its showing to import  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/6/46c3408502541004e6c63323b0ddaefc13e17232.png)  
somebody please guide. Am i missing something, any configurations in the vs code editor?

---

<div class="post-metadata">

**Author:** ![cesarcoatl](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cesarcoatl/32/84168_2.png) [@cesarcoatl](https://forum.inductiveautomation.com/u/cesarcoatl)\
**Post date:** [September 24, 2024, 6:36am UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/10 "2024-09-24T06:36:36Z")

</div>

Hello, @John_S1.

You should either install `ignition-api` on Python 2.7.18 or a virtual environment created with Python 2.7.18.

1. Install `virtualenv`:

2. Create virtual environment:

3. Activate virtual environment:

4. On Visual Studio Code, select `./.venv/bin/python` as your project's interpreter.

5. Install `ignition-api`:

6. Get code completion:

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [September 25, 2024, 4:28am UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/11 "2024-09-25T04:28:34Z")

</div>

> **devcontainer.json all-in-one**
>
> ```json
> {
> "name": "Ignition",
> "dockerComposeFile": [
> "docker-compose.yaml",
> "docker-compose.stack.yaml"
> ],
> "service": "Ignition",
> "workspaceFolder": "/usr/local/bin/ignition", // /data”,
> "features": {
> "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
> "upgradePackages": true,
> "packages": "build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git ca-certificates"
> }
> },
> "postCreateCommand": "bash -c 'curl https://pyenv.run | bash && export PYENV_ROOT=\"$HOME/.pyenv\" && [[-d $PYENV_ROOT/bin]] && export PATH=\"$PYENV_ROOT/bin:$PATH\" && eval \"$(pyenv init -)\" && eval \"$(pyenv virtualenv-init -)\" && pyenv install 2.7.18 && pyenv global 2.7.18 && pip install ignition-api && pip install --upgrade pip'",
> "customizations": {
> "vscode": {
> "extensions": [
> "donjayamanne.python-extension-pack",
> "donjayamanne.git-extension-pack"
> ],
> "settings": {
> "python.autoComplete.extraPaths": [
> "/root/.pyenv/versions/2.7.18/lib/python2.7/site-packages/"
> ],
> "python.analysis.extraPaths": [
> "/root/.pyenv/versions/2.7.18/lib/python2.7/site-packages/"
> ]
> }
> }
> },
> "remoteUser": "root"
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![cesarcoatl](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cesarcoatl/32/84168_2.png) [@cesarcoatl](https://forum.inductiveautomation.com/u/cesarcoatl)\
**Post date:** [September 26, 2024, 6:21am UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/12 "2024-09-26T06:21:30Z")

</div>

For dev containers I use `quay.io/ignition-devs/devcontainer-base`, which uses `quay.io/coatldev/six` as base.

> <https://github.com/ignition-devs/incendium/blob/6a761ae7f391749d6cfccf7d343ee578dc6a114d/.devcontainer/Dockerfile>

And `devcontainer.json`:

> <https://github.com/ignition-devs/incendium/blob/6a761ae7f391749d6cfccf7d343ee578dc6a114d/.devcontainer/devcontainer.json>

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [September 28, 2024, 3:09am UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/13 "2024-09-28T03:09:14Z")

</div>

Also have to `import system`

---

<div class="post-metadata">

**Author:** ![Joost\_t](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Joost\_t](https://forum.inductiveautomation.com/u/Joost_t)\
**Post date:** [January 24, 2025, 8:09am UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/14 "2025-01-24T08:09:44Z")

</div>

Do you know if there is a way around this? would love to have intellisense in VScode. But adding all imports to the file just for intellisense seems redundant since it's not needed in Ignition.

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [January 28, 2025, 9:16pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/15 "2025-01-28T21:16:50Z")

</div>

> [@hunterdg](#):
>
> `python.analysis.extraPaths`

FWIW, I’m almost certain I solved this with some combination of `python.analysis.include/extraPaths/etc` settings in VSCode, and perhaps an ` __init__.py` file, but of course I’ve since wiped that local environment after assuming I fully understood the fix and had it sorted in my devcontainer… only to be unable to replicate it. My VSCode settings.json file is a commented mess and I eventually gave up. I’m all for explicit imports myself, but wish I could get this to work for existing code. 😕

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 28, 2025, 9:19pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/16 "2025-01-28T21:19:18Z")

</div>

Are you VS Code users just ignoring the syntax highlighting errors / false positives / false negatives / whatever caused by pylance not supporting Python 2?

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [January 28, 2025, 9:19pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/17 "2025-01-28T21:19:59Z")

</div>

`# type: ignore - VSCode` 😆

it’s relatively rare in my experience/almost always pretty easy to get 0 issues, even with `"python.analysis.typeCheckingMode": "standard", // “basic"`

Suppose that doesn’t cover “false negatives” though…

---

<div class="post-metadata">

**Author:** ![cesarcoatl](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cesarcoatl/32/84168_2.png) [@cesarcoatl](https://forum.inductiveautomation.com/u/cesarcoatl)\
**Post date:** [January 30, 2025, 8:30pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/18 "2025-01-30T20:30:59Z")

</div>

Hello, @Joost_t.

I get your point that you don't have to explicitly `import system` on the Ignition Designer, since it's a builtin module, which is not the case in the Python world.

I'm so used to it that it does not bother me.

---

<div class="post-metadata">

**Author:** ![cesarcoatl](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cesarcoatl/32/84168_2.png) [@cesarcoatl](https://forum.inductiveautomation.com/u/cesarcoatl)\
**Post date:** [January 30, 2025, 8:35pm UTC](https://forum.inductiveautomation.com/t/ignition-scripting-api-now-available-via-pypi/50800/19 "2025-01-30T20:35:26Z")

</div>

I thought that with Pylance taking over Jedi my projects would be full of red squiggly lines, but it did not.

As far as the `python.defaultInterpreterPath` points at the Python 2 virtual env, there are no highlighting errors.
