# Code structure

**URL:** <https://forums.plex.tv/t/code-structure/67014>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [May 22, 2014, 2:55pm UTC](https://forums.plex.tv/t/code-structure/67014 "2014-05-22T14:55:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles.gamble](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@charles.gamble](https://forums.plex.tv/u/charles.gamble)\
**Post date:** [May 22, 2014, 2:55pm UTC](https://forums.plex.tv/t/code-structure/67014/1 "2014-05-22T14:55:53Z")

</div>

Hi folks,

&nbsp;

I'm just starting my first plugin, it will be using a JSON web service API to fetch video URLs.

&nbsp;

I have tested the API and wrapped it in a Python class in its own API.py file, I was intending to have the \_\_init\_\_.py file contain mostly UI code and call into the API.py to handle the actual network calls.

&nbsp;

Is this code structure possible with the channels framework or do I have to put everything into \_\_init\_\_.py?

&nbsp;

What imports will I need in my API.py to be able to use the framework classes such as Dict, Prefs, JSON, etc?

&nbsp;

I've tried looking for examples and docs but not seen any explicit imports anywhere, and most channels seem to have a single \_\_init\_\_.py only.

&nbsp;

Thanks for any help,

&nbsp;

Charlie

&nbsp;

---

<div class="post-metadata">

**Author:** ![charles.gamble](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@charles.gamble](https://forums.plex.tv/u/charles.gamble)\
**Post date:** [May 23, 2014, 9:01am UTC](https://forums.plex.tv/t/code-structure/67014/3 "2014-05-23T09:01:10Z")

</div>

Yes, thanks, got it working now.

Just a simple "from MyOtherClass import \*" seems to work.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 2:09am UTC](https://forums.plex.tv/t/code-structure/67014/4 "2019-12-21T02:09:17Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
