Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
matrix:
# the versions for which we require the CI to pass on PRs can
# be updated in the repo settings (branch rules)
version: ['3.9', '3.10', '3.11', '3.12', '3.13']
version: ['3.13']
fail-fast: false # run for all versions even if one of them fails
with:
python-version: ${{ matrix.version }}
poetry-version: '2.2.1' # Max version supported by python 3.9
poetry-version: '2.2.1'
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ schema.json
tests/outputs
*.sq3
gen3/tools/indexing/tmp/
gen3tests-*.logs

# nextflow
.nextflow
.nextflow.log*

# AI
.claude
.serena
AGENTS.md
CLAUDE.md

.dccache
.idea
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: git@github.com:Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: '(docs\/_build|poetry.lock)'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
args: [--branch, develop, --branch, master, --pattern, release/.*]
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 26.5.1
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
76 changes: 50 additions & 26 deletions .secrets.baseline

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ The docs here contain general descriptions of the different pieces of the SDK an

* [Detailed API Documentation](https://uc-cdis.github.io/gen3sdk-python/_build/html/index.html)


## Prerequisites

This project is built with Python. Ensure you have Python 3.6 or later installed.

Other prerequisites include:

- [pip](https://pip.pypa.io/en/stable/)
- Access to a Gen3 commons.

## Installation Steps:

### Using pip

To install the latest released version of the SDK, run:

```
Expand All @@ -41,9 +42,10 @@ Additional documentation for different components is available:
- [Available Classes](docs/reference/sdkClasses.md)
- [Indexing Tools](docs/howto/diirmIndexing.md)
- [Metadata Tools](docs/howto/metadataTools.md)
- [Gen3 Discovery Page Metadata Tools](docs/howto/discoveryMetadataTools.md)
- [Gen3 Subject-level Crosswalk Metadata Tools](docs/howto/crosswalk.md)
- [Gen3 Discovery Page Metadata Tools](docs/howto/discoveryMetadataTools.md)
- [Gen3 Subject-level Crosswalk Metadata Tools](docs/howto/crosswalk.md)
- [Bundle Tools](docs/howto/bundleTools.md)
- [Nextflow with the Gen3 DPoP Proxy](docs/howto/nextflow.md)
- [Development](docs/howto/devTest.md)
- [CLI](docs/howto/cli.md)

Expand All @@ -55,4 +57,4 @@ For FAQs and commonly encountered errors, consult the documentation or use the C
gen3 --help
```

If you encounter issues, raise them on the [Gen3 SDK GitHub Issues page](https://github.com/uc-cdis/gen3sdk-python/issues).
If you encounter issues, raise them on the [Gen3 SDK GitHub Issues page](https://github.com/uc-cdis/gen3sdk-python/issues).
Binary file modified docs/_build/doctrees/auth.doctree
Binary file not shown.
15 changes: 14 additions & 1 deletion docs/_build/html/_modules/gen3/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1>Source code for gen3.auth</h1><div class="highlight"><pre>
<span class="sd"> """</span>
<span class="n">endpoint</span> <span class="o">=</span> <span class="n">endpoint_from_token</span><span class="p">(</span><span class="n">api_key</span><span class="p">[</span><span class="s2">"api_key"</span><span class="p">])</span>
<span class="c1"># attempt to get a token from Fence</span>
<span class="n">auth_url</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2">/user/credentials/cdis/access_token"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">endpoint</span><span class="p">)</span>
<span class="n">auth_url</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2">/user/credentials/api/access_token"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">endpoint</span><span class="p">)</span>
<span class="n">resp</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">post</span><span class="p">(</span><span class="n">auth_url</span><span class="p">,</span> <span class="n">json</span><span class="o">=</span><span class="n">api_key</span><span class="p">)</span>
<span class="n">token_key</span> <span class="o">=</span> <span class="s2">"access_token"</span>
<span class="k">return</span> <span class="n">_handle_access_token_response</span><span class="p">(</span><span class="n">resp</span><span class="p">,</span> <span class="n">token_key</span><span class="p">)</span>
Expand Down Expand Up @@ -486,6 +486,19 @@ <h1>Source code for gen3.auth</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_access_token</span></div>


<div class="viewcode-block" id="Gen3Auth.get_api_key">
<a class="viewcode-back" href="../../auth.html#gen3.auth.Gen3Auth.get_api_key">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">get_api_key</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">"""</span>
<span class="sd"> Returns the actual API key loaded, or None if the loaded credentials</span>
<span class="sd"> do not contain one (for example a raw access token).</span>
<span class="sd"> """</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_refresh_token</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>

<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_refresh_token</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"api_key"</span><span class="p">)</span></div>


<span class="k">def</span><span class="w"> </span><span class="nf">_get_auth_value</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">"""Returns the Authorization header value for the request</span>

Expand Down
8 changes: 8 additions & 0 deletions docs/_build/html/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ <h1>Gen3 Auth Helper<a class="headerlink" href="#gen3-auth-helper" title="Link t
in the given namespace. If idp is not set, then default to “local”</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="gen3.auth.Gen3Auth.get_api_key">
<span class="sig-name descname"><span class="pre">get_api_key</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/gen3/auth.html#Gen3Auth.get_api_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gen3.auth.Gen3Auth.get_api_key" title="Link to this definition">¶</a></dt>
<dd><p>Returns the actual API key loaded, or None if the loaded credentials
do not contain one (for example a raw access token).</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="gen3.auth.Gen3Auth.refresh_access_token">
<span class="sig-name descname"><span class="pre">refresh_access_token</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">endpoint</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/gen3/auth.html#Gen3Auth.refresh_access_token"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gen3.auth.Gen3Auth.refresh_access_token" title="Link to this definition">¶</a></dt>
Expand Down Expand Up @@ -173,6 +180,7 @@ <h1 class="logo"><a href="index.html">Gen3 SDK</a></h1>
<li class="toctree-l3"><a class="reference internal" href="#gen3.auth.Gen3Auth.curl"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.curl()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#gen3.auth.Gen3Auth.get_access_token"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.get_access_token()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#gen3.auth.Gen3Auth.get_access_token_from_wts"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.get_access_token_from_wts()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#gen3.auth.Gen3Auth.get_api_key"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.get_api_key()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#gen3.auth.Gen3Auth.refresh_access_token"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.refresh_access_token()</span></code></a></li>
</ul>
</li>
Expand Down
2 changes: 2 additions & 0 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ <h2 id="G">G</h2>
<li><a href="metadata.html#gen3.metadata.Gen3Metadata.get_aliases">get_aliases() (gen3.metadata.Gen3Metadata method)</a>
</li>
<li><a href="indexing.html#gen3.index.Gen3Index.get_all_records">get_all_records() (gen3.index.Gen3Index method)</a>
</li>
<li><a href="auth.html#gen3.auth.Gen3Auth.get_api_key">get_api_key() (gen3.auth.Gen3Auth method)</a>
</li>
<li><a href="submission.html#gen3.submission.Gen3Submission.get_dictionary_all">get_dictionary_all() (gen3.submission.Gen3Submission method)</a>
</li>
Expand Down
1 change: 1 addition & 0 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h1>Welcome to Gen3 SDK’s documentation!<a class="headerlink" href="#welcome-t
<li class="toctree-l3"><a class="reference internal" href="auth.html#gen3.auth.Gen3Auth.curl"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.curl()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="auth.html#gen3.auth.Gen3Auth.get_access_token"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.get_access_token()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="auth.html#gen3.auth.Gen3Auth.get_access_token_from_wts"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.get_access_token_from_wts()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="auth.html#gen3.auth.Gen3Auth.get_api_key"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.get_api_key()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="auth.html#gen3.auth.Gen3Auth.refresh_access_token"><code class="docutils literal notranslate"><span class="pre">Gen3Auth.refresh_access_token()</span></code></a></li>
</ul>
</li>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

Loading
Loading