|
|
@@ -7,8 +7,8 @@ up simple code as a Python package, you can import it directly via |
|
|
|
the hash. |
|
|
|
|
|
|
|
There is the concept of aliases to make the import statements easier |
|
|
|
to read. This is currently limited to packages (on disk). An example |
|
|
|
is the randpkg in the fixtures directory. You can put a file named |
|
|
|
to read. This is currently limited to packages. An example is the |
|
|
|
randpkg in the fixtures directory. You can put a file named |
|
|
|
cas_aliases.txt along side your __init__.py file. Each line of the |
|
|
|
file is: |
|
|
|
``` |
|
|
@@ -16,13 +16,24 @@ file is: |
|
|
|
``` |
|
|
|
|
|
|
|
Where alias is a simple name, and url is a location to find the file |
|
|
|
at. Currently, at least on hash url that follows the |
|
|
|
[hash-uri](https://github.com/hash-uri/hash-uri) format w/ a hash |
|
|
|
value of sha256. The other supported url type is ipfs. The format |
|
|
|
follows the [IPFS Addressing](https://github.com/ipfs/in-web-browsers/blob/master/ADDRESSING.md) |
|
|
|
at. Currently, at least one hash url must be specified. |
|
|
|
|
|
|
|
The following url schemes are supported: |
|
|
|
<dl> |
|
|
|
<dt>hash</dt> |
|
|
|
<dd>At least one of these MUST be specified. This is specified at |
|
|
|
[hash-uri](https://github.com/hash-uri/hash-uri) and currently only |
|
|
|
a hash value of sha256 is supported.</dd> |
|
|
|
<dt>ipfs</dt> |
|
|
|
<dd>The format follows the |
|
|
|
[IPFS Addressing](https://github.com/ipfs/in-web-browsers/blob/master/ADDRESSING.md) |
|
|
|
document, and it is recommend that CIDv1 addresses are used, as the |
|
|
|
host portion of a URL is case insensitive, and CIDv0 (the current |
|
|
|
default) values are case sensitive. |
|
|
|
default) values are case sensitive. An example is: |
|
|
|
`ipfs://bafkreibtbcckul7lwxqz7nyzj3dknhwrdxj5o4jc6gsroxxjhzz46albym`.</dd> |
|
|
|
<dt>https</dt> |
|
|
|
<dd>This is the standard web url that everyone is familar with.</dd> |
|
|
|
</dl> |
|
|
|
|
|
|
|
Usage |
|
|
|
----- |
|
|
@@ -43,3 +54,15 @@ Currently v1 is defined, and has the following types: |
|
|
|
Example generated via: shasum -a 256 hello.py |
|
|
|
a An alias. Any aliases must be loaded before being |
|
|
|
processed. This is a short name that could be used. |
|
|
|
|
|
|
|
Configuration |
|
|
|
------------- |
|
|
|
|
|
|
|
By default, a configuration file is read from `~/.casimport/casimport.conf`. |
|
|
|
This specifies the priority of the different modules (do you search IPFS or |
|
|
|
HTTPS urls first), and configures each of the modules. |
|
|
|
|
|
|
|
The first time you import casimport, a sample configuration will be created. |
|
|
|
The default is a local cache the home directory, and then to use IPFW |
|
|
|
gateway, followed by normal https urls. |
|
|
|
|