# Getting scripts within packages under the Scripting Project Library

**URL:** <https://forum.inductiveautomation.com/t/getting-scripts-within-packages-under-the-scripting-project-library/112276>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [November 19, 2025, 6:02pm UTC](https://forum.inductiveautomation.com/t/getting-scripts-within-packages-under-the-scripting-project-library/112276 "2025-11-19T18:02:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfrancia](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dfrancia](https://forum.inductiveautomation.com/u/dfrancia)\
**Post date:** [November 19, 2025, 6:02pm UTC](https://forum.inductiveautomation.com/t/getting-scripts-within-packages-under-the-scripting-project-library/112276/1 "2025-11-19T18:02:08Z")

</div>

What is the proper way to get scripts within packages under the Scripting Project Library?

My objective is to create a unit test runner and find all the scripts, regardless of their location in the Scripting Project Library with the suffix “\_tests” and run them.

Currently, I use the following to find all the modules using the following:

```python
# The list of “roots” in the project
_SYS_MODULES = list(sys.modules.keys())

```

It works, but it I can only get the scripts in the top level, not contained within packages.

I'd like to use the following structure under the Scripting tree:

```python
Scripting
- Project Library
    - test_scripts
        - test_runner
    - category_a
        - logic_1
        - logic_1_tests
    - category_b
        - logic_2
        - logic_2_tests

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 19, 2025, 6:15pm UTC](https://forum.inductiveautomation.com/t/getting-scripts-within-packages-under-the-scripting-project-library/112276/2 "2025-11-19T18:15:50Z")

</div>

Have you explored the objects with the Python builtins `dir`, `type`, and `getattr`?

---

<div class="post-metadata">

**Author:** ![dfrancia](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dfrancia](https://forum.inductiveautomation.com/u/dfrancia)\
**Post date:** [November 20, 2025, 12:18am UTC](https://forum.inductiveautomation.com/t/getting-scripts-within-packages-under-the-scripting-project-library/112276/3 "2025-11-20T00:18:29Z")

</div>

Thanks! I was able to figure out from there.
