Page cover image

[TBD] Data to compute

Import code and data locally into your IDE

Basic dPid Fetch usage (WIP)

You can find the dPid Fetch repository here https://github.com/desci-labs/desci-fetch

Quick start guide

  1. Clone the dpid fetch repository https://github.com/desci-labs/desci-fetch

  2. Open up the file 'example-run.py', take note of the dpid being passed in, and the mapping of files to variables (WIP - EXAMPLE BEING UPDATED FOR LATEST RESOLVER).

  3. Run the example in your IDE using 'python3 example-run.py'

Syntax Guide

import desci.fetch as dpid

with dpid.fetch([('hello.py', 'imported')], dpid="3/v1/1"):

import imported

print(str.upper(imported.hello()) + " world!")

Given the above example, the parameters passed in are as such;

dpid.fetch([('hello.py', 'imported')], dpid="3/v1/1")

The first parameter is an array of tuples that accepts a valid string path to a python file within the imported code repository, and a variable name that the imported code should be assigned to, e.g. in this instance, 'hello.py' will be assigned to variable 'imported'.

dpid.fetch([('hello.py', 'imported')], dpid="3/v1/1")

The second parameter is a string that accepts a dpid query that points to a code file, as a reminder the syntax for dPIDs is as follows; {dpid}/{version}/{component Index}

dpid: The identifier assigned for a published node.

version: A number that's zero indexed, or a version with a 'v' prefix. e.g. for the first version specify "0" or "v1", for the second version specify "1" or "v2"

component index: The index number of the component as specified in the manifest file, which you could access by appending ?raw to the dpid link as such: "https://beta.dpid.org/2/v1?raw"

Last updated