<?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: Programatic access to Files in Repos in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13106#M7825</link>
    <description>&lt;P&gt;Hi Sandeep, is it really possible to download files (not notebooks) from Repos using the export API? Last time I tried, only notebooks were exported and all files were skipped...&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 08:21:19 GMT</pubDate>
    <dc:creator>Jiri_Koutny</dc:creator>
    <dc:date>2021-11-11T08:21:19Z</dc:date>
    <item>
      <title>Programatic access to Files in Repos</title>
      <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13098#M7817</link>
      <description>&lt;P&gt;Hi, we are testing the new Files support in Databricks repos. Is there a way how to programmatically read notebooks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2386i184CE417CD26E261/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled" alt="Untitled" /&gt;&lt;/span&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 14:17:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13098#M7817</guid>
      <dc:creator>Jiri_Koutny</dc:creator>
      <dc:date>2021-10-18T14:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Programatic access to Files in Repos</title>
      <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13100#M7819</link>
      <description>&lt;P&gt;Thanks @Kaniz Fatma​&amp;nbsp; for quick reply. Looking forward to the answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 14:24:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13100#M7819</guid>
      <dc:creator>Jiri_Koutny</dc:creator>
      <dc:date>2021-10-18T14:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Programatic access to Files in Repos</title>
      <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13102#M7821</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2379iC303B16C0D754B4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;We definitely work with Python files in Databricks Repos, not with local files.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 09:25:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13102#M7821</guid>
      <dc:creator>Jiri_Koutny</dc:creator>
      <dc:date>2021-10-20T09:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Programatic access to Files in Repos</title>
      <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13105#M7824</link>
      <description>&lt;P&gt;@Jiri Koutny​&amp;nbsp;Alternatively, using export API, you can download it and use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;curl -n -o example.scala \&lt;/P&gt;&lt;P&gt;  'https://&amp;lt;databricks-instance&amp;gt;/api/2.0/workspace/export?path=/Users/user@example.com/ScalaExampleNotebook&amp;amp;direct_download=true'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Documentation &lt;A href="https://docs.databricks.com/dev-tools/api/latest/workspace.html#export" target="test_blank"&gt;https://docs.databricks.com/dev-tools/api/latest/workspace.html#export&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 16:06:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13105#M7824</guid>
      <dc:creator>Sandeep</dc:creator>
      <dc:date>2021-11-10T16:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Programatic access to Files in Repos</title>
      <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13106#M7825</link>
      <description>&lt;P&gt;Hi Sandeep, is it really possible to download files (not notebooks) from Repos using the export API? Last time I tried, only notebooks were exported and all files were skipped...&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 08:21:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13106#M7825</guid>
      <dc:creator>Jiri_Koutny</dc:creator>
      <dc:date>2021-11-11T08:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Programatic access to Files in Repos</title>
      <link>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13107#M7826</link>
      <description>&lt;P&gt;Hi @Jiri Koutny​&amp;nbsp;these files anyway should be synced to your remote repository (git, bitbucket, GitLab etc). The APIs from version control tools  Git API for example might help you achieve what you want. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/38491722/reading-a-github-file-using-python-returns-html-tags" target="test_blank"&gt;https://stackoverflow.com/questions/38491722/reading-a-github-file-using-python-returns-html-tags&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/env python3
import base64
import requests
&amp;nbsp;
&amp;nbsp;
url = 'https://api.github.com/repos/{user}/{repo_name}/contents/{path_to_file}'
req = requests.get(url)
if req.status_code == requests.codes.ok:
    req = req.json()  # the response is a JSON
    # req is now a dict with keys: name, encoding, url, size ...
    # and content. But it is encoded with base64.
    content = base64.decodestring(req['content'])
else:
    print('Content was not found.')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 03:37:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatic-access-to-files-in-repos/m-p/13107#M7826</guid>
      <dc:creator>User16871418122</dc:creator>
      <dc:date>2021-11-24T03:37:48Z</dc:date>
    </item>
  </channel>
</rss>

