<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python Extension 2.0 - read from json config file in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/253132#M4969</link>
    <description>&lt;P&gt;Hello, sorry for the delay&lt;BR /&gt;Indeed, that's something that seems to work!&lt;BR /&gt;except the wildcard (config/*.json) was not accepted, so I added all the config files 1 by 1.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2024 08:11:07 GMT</pubDate>
    <dc:creator>Jan_VanBelle</dc:creator>
    <dc:date>2024-08-12T08:11:07Z</dc:date>
    <item>
      <title>Python Extension 2.0 - read from JSON config file</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/251984#M4904</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Our custom python plugins (EF1) often have JSON files included which contain a huge part of config settings&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;urls to check&lt;/LI&gt;
&lt;LI&gt;folders to check&lt;/LI&gt;
&lt;LI&gt;team configurations&lt;/LI&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I just wonder how to import/migrate those files into the EF2 equivalent of the plugins.&lt;BR /&gt;I noticed they are never included in the compiled packages and thus give an error when trying to access them.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jan_VanBelle_0-1722343305458.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21484iF1C6BF533832CD0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jan_VanBelle_0-1722343305458.png" alt="Jan_VanBelle_0-1722343305458.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now testing with various settings in the 'setup.py', but no results so far&lt;/P&gt;
&lt;P&gt;Thanks for the ideas/feedback&lt;/P&gt;
&lt;P&gt;Jan&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 07:18:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/251984#M4904</guid>
      <dc:creator>Jan_VanBelle</dc:creator>
      <dc:date>2024-08-19T07:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python Extension 2.0 - read from json config file</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/252305#M4922</link>
      <description>&lt;P&gt;You will have to include package_data in your setup.py file, as illustrated in &lt;A href="https://setuptools.pypa.io/en/latest/userguide/datafiles.html#package-data" target="_self"&gt;the setuptools docs.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So if your directory structure looks like this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;extension_folder/&lt;UL&gt;&lt;LI&gt;setup.py&lt;/LI&gt;&lt;LI&gt;extension/&lt;UL&gt;&lt;LI&gt;extension.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;servicebus_plugin/&lt;UL&gt;&lt;LI&gt;__init__.py&lt;/LI&gt;&lt;LI&gt;__main__.py&lt;/LI&gt;&lt;LI&gt;config/&lt;UL&gt;&lt;LI&gt;my_file.json&lt;/LI&gt;&lt;LI&gt;another_file.json&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You would want to have something like this in your setup.py file:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;setup(name="servicebus_plugin",
      version=find_version(),
      description="Demo plugin for community",
      author="You :)",
      packages=find_packages(),
      package_data={"servicebus_plugin": [
          "config/*.json"
      ]},
      python_requires="&amp;gt;=3.10",
      include_package_data=True,
      install_requires=["dt-extensions-sdk"],
      extras_require={"dev": ["dt-extensions-sdk[cli]"]},
      )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 06:52:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/252305#M4922</guid>
      <dc:creator>TomásSeroteRoos</dc:creator>
      <dc:date>2024-08-02T06:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python Extension 2.0 - read from json config file</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/253132#M4969</link>
      <description>&lt;P&gt;Hello, sorry for the delay&lt;BR /&gt;Indeed, that's something that seems to work!&lt;BR /&gt;except the wildcard (config/*.json) was not accepted, so I added all the config files 1 by 1.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 08:11:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-Extension-2-0-read-from-JSON-config-file/m-p/253132#M4969</guid>
      <dc:creator>Jan_VanBelle</dc:creator>
      <dc:date>2024-08-12T08:11:07Z</dc:date>
    </item>
  </channel>
</rss>

