# List of libraries used in import in scripts

**URL:** <https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608>\
**Category:** Ignition\
**Created:** [May 2, 2016, 9:53pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608 "2016-05-02T21:53:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![compuzak](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@compuzak](https://forum.inductiveautomation.com/u/compuzak)\
**Post date:** [May 2, 2016, 9:53pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608/1 "2016-05-02T21:53:42Z")

</div>

How can I find out what library/namespace I need to import in order for a function to work in a script?

For example, I am trying to use ‘trim’ on a variable in a project script and it gives me an error ‘trim’ is not defined.

I need to know how to find the proper namespace given a function.

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [May 9, 2016, 9:40pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608/2 "2016-05-09T21:40:41Z")

</div>

I think you are confusing expression language and python.  
The equivalent function in python for trim is strip.

`s = " this is a string "
print s.strip()`

---

<div class="post-metadata">

**Author:** ![compuzak](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@compuzak](https://forum.inductiveautomation.com/u/compuzak)\
**Post date:** [March 20, 2018, 2:21pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608/3 "2018-03-20T14:21:21Z")

</div>

Yes, I was confused between python and expression language in the example I gave. Thanks for the information. That said, the original question still applies.

How can I find out what library/namespace I need to import in order for a function to work in a script?  
I need to know how to find the proper namespace given a function. Is there a list of import libraries that I can reference that shows the functions included in the import.

Sorry such a long delay, I forgot I had asked this question and will monitor much more closely this time.

---

<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:** [March 20, 2018, 2:55pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608/4 "2018-03-20T14:55:07Z")

</div>

Generally, you want to study the [jython documentation](http://www.jython.org/docs/). There’s a few inaccuracies, as it was copied from python v2.7, and some of that doesn’t apply. As for functions supplied by IA, you generally don’t need to import at all – just spell it out. These are all documented [here](https://docs.inductiveautomation.com/display/DOC79/Scripting+Functions). Add-on modules from third parties can also supply functions in `system.*` – they won’t need imports either, but you’ll need the module documentation.  
One of the big advantages of Ignition is its Java base, which is accessible from jython. Those you need to import, though. See the Java base [here](https://docs.oracle.com/javase/8/docs/index.html) and Ignition’s object docs [here](http://files.inductiveautomation.com/sdk/javadoc/ignition79/793/index.html).

Have fun!

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 20, 2018, 3:00pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608/5 "2018-03-20T15:00:00Z")

</div>

Google searches are also great. I’m a ‘learn by example’ kind of guy. My Google searches are more task oriented (example: ‘python dictionary from csv’). Once I see an example or two, I can then modify to my own needs.

If I get really stuck, I usually ask Phil. 🙂

---

<div class="post-metadata">

**Author:** ![compuzak](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@compuzak](https://forum.inductiveautomation.com/u/compuzak)\
**Post date:** [March 22, 2018, 2:31pm UTC](https://forum.inductiveautomation.com/t/list-of-libraries-used-in-import-in-scripts/11608/6 "2018-03-22T14:31:07Z")

</div>

Thank you guys, I will reference those links you provided.
