# Accessing com.inductiveautomation.ignition packages in Python

**URL:** <https://forum.inductiveautomation.com/t/accessing-com-inductiveautomation-ignition-packages-in-python/39702>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [October 15, 2020, 6:16am UTC](https://forum.inductiveautomation.com/t/accessing-com-inductiveautomation-ignition-packages-in-python/39702 "2020-10-15T06:16:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradley.falzon](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@bradley.falzon](https://forum.inductiveautomation.com/u/bradley.falzon)\
**Post date:** [October 15, 2020, 6:16am UTC](https://forum.inductiveautomation.com/t/accessing-com-inductiveautomation-ignition-packages-in-python/39702/1 "2020-10-15T06:16:30Z")

</div>

Hi,

I’d like to use some of the helper functions scattered throughout com.inductiveautomation.ignition from within Python. In this specific case com.inductiveautomation.ignition.common has QualifiedPathUtils and I’d love to access the toTagPathNew method.

Is there a way of accessing the com.inductiveautomation.ignition packages? I’ve gone through the documentation and it mentions access Java libraries, but it’s not clear if or how I could access com.inductiveautomation.ignition packages?

I did seem to be able to import the package, but perhaps my syntax is wrong:

```auto
import com.inductiveautomation.ignition.common

QualifiedPathUtils.parsePossibleTagpathNew("prov:default:/tag:test/folder1/folder2:3/TEST420/DA_TEST:/alm:Low Low Test")

```

When running the above inside the Script Console, I get the following:

```auto
Traceback (most recent call last):
  File "<input>", line 4, in <module>
NameError: name 'QualifiedPathUtils' is not defined

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 15, 2020, 12:27pm UTC](https://forum.inductiveautomation.com/t/accessing-com-inductiveautomation-ignition-packages-in-python/39702/2 "2020-10-15T12:27:29Z")

</div>

If you import without the optional `from` clause, you have to refer to the imported objects by their full name. Such an import just makes the namespace _available_.  
Use this syntax instead:

```auto
from com.inductiveautomation.ignition.common import QualifiedPathUtils

```

Note that jython cannot do wildcard imports of java classes. Each class you want to use must be _named_ in an import statement.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 15, 2020, 12:34pm UTC](https://forum.inductiveautomation.com/t/accessing-com-inductiveautomation-ignition-packages-in-python/39702/3 "2020-10-15T12:34:07Z")

</div>

Let me elaborate a bit:

The import behavior you were expecting corresponds to java’s `import something.something.*;`. But in java, an import is really just syntactical sugar for programmer convenience. A java programmer can always spell out full class names without any import statement.

Python/jython doesn’t work this way. In python/jython, import is a fundamental operation that makes other packages _available_ within the scope, optionally removing a package prefix or renaming the object into the new scope.

---

<div class="post-metadata">

**Author:** ![bradley.falzon](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@bradley.falzon](https://forum.inductiveautomation.com/u/bradley.falzon)\
**Post date:** [October 15, 2020, 10:16pm UTC](https://forum.inductiveautomation.com/t/accessing-com-inductiveautomation-ignition-packages-in-python/39702/4 "2020-10-15T22:16:43Z")

</div>

Brilliant @pturmel, this is really appreciative and opens up a lot more functionality! Thank you.
