diff --git a/README.md b/README.md index d0141cc..8b3aeb5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,33 @@ casimport ========= +This is a python module that is designed to load Python code from a +cryptographic hash. The idea is that instead of having to package +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 +cas_aliases.txt along side your __init__.py file. Each line of the +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) +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. + Usage ----- +Top level usage: ``` import casimport from cas.v1_f_330884aa2febb5e19fb7194ec6a69ed11dd3d77122f1a5175ee93e73cf0161c3 import hello @@ -11,7 +35,7 @@ from cas.v1_f_330884aa2febb5e19fb7194ec6a69ed11dd3d77122f1a5175ee93e73cf0161c3 i print(repr(hello('Alice'))) ``` -Defintion of hash: +Defintion of module names in cas package: v__ Currently v1 is defined, and has the following types: