{"__v":2,"_id":"562da6b1e01a430d00c2c873","category":{"__v":5,"_id":"562d4dcc8c6e5a0d00d6ed1d","pages":["562d4df5e01a430d00c2c821","562d4f7ae01a430d00c2c823","562d514e54a5be0d00070b3d","562da6b1e01a430d00c2c873","562e652656486b0d00e3dc05"],"project":"5476bf0f817e8d080031f988","version":"5476bf10817e8d080031f98b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-25T21:46:52.564Z","from_sync":false,"order":6,"slug":"command-line-interface","title":"Command-Line Interface"},"parentDoc":null,"project":"5476bf0f817e8d080031f988","user":"5476beec817e8d080031f986","version":{"__v":17,"_id":"5476bf10817e8d080031f98b","project":"5476bf0f817e8d080031f988","createdAt":"2014-11-27T06:05:04.263Z","releaseDate":"2014-11-27T06:05:04.263Z","categories":["5476bf10817e8d080031f98c","5477c46cf3736008009e9eb5","5477c474f3736008009e9eb6","5477c47ef3736008009e9eb7","5477c48ff3736008009e9eb8","5477c4948deb230800808bf0","54e68328154f8e0d0007b55c","54e90194c8e0c00d007ac061","54eed2275bf74a0d00ef4076","54f7a7be0a3cbb0d00d666fb","559b0ebf7ae7f80d0096d871","55d697f9ae529e0d00d34f03","562d4dcc8c6e5a0d00d6ed1d","562e591c4376430d006f17e0","568f0e73bdb9260d00149d8c","5719542aac1e2e0e001834c6","57a14a8ed778850e0047e230"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-26T04:06:09.270Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create a New Package\"\n}\n[/block]\n`$ transcriptic create-package test_package \"for testing protocols\"`\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"List Existing Packages\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/AaSnXhoSKaSWMJthGSwl_transcripticpackages.png\",\n        \"transcripticpackages.png\",\n        \"496\",\n        \"119\",\n        \"#6b9ecb\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Initialize a Directory With An Empty Manifest Template\"\n}\n[/block]\nThe init command creates an empty `manifest.json` file with the proper structure within the current directory (by default) or a directory passed as an argument.  Read below or [here](https://developers.transcriptic.com/v1.0/docs/the-manifest) to find out more about what a manifest does.   This command will prompt to overwrite if your folder already contains a file called `manifest.json`.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ohYEXRbpRNGWgSO2C3U7_transcripticinit.png\",\n        \"transcripticinit.png\",\n        \"301\",\n        \"222\",\n        \"#6c9bc4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Compress All Files in Working Directory into a Release\"\n}\n[/block]\n`$ transcriptic build-release`\n\nPassing a `--name` argument allows you to name your release, otherwise it will be named `release_<version from manifest>` automatically\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Compress All Files in Working Directory into a Release and Upload to a Package\"\n}\n[/block]\n`$ transcriptic build-release test_package`\n\nPassing a package name as an argument automatically uploads the release created to that package.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Upload a Release to an Existing Package\"\n}\n[/block]\n`$ transcriptic upload-release release_v1.0.0.zip test_package`\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"More About Packages\"\n}\n[/block]\nThe [autoprotocol-python](https://github.com/autoprotocol/autoprotocol-python) library helps you generate Autoprotocol with easy to use functions. [autoprotocol.harness](https://github.com/autoprotocol/autoprotocol-python/blob/master/autoprotocol/harness.py) parses a set of typed input parameters contained in a `manifest.json` file and passes them back to the specified script when you run `transcriptic preview` (see above).  Input types also define protocol browser UI elements on transcriptic's website.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Worked Example\"\n}\n[/block]\nThe example below assumes the following file structure:\n```\ntest_package/\n\tmanifest.json\n\trequirements.txt\n\ttest.py\n```\n\nA manifest.json file contains metadata about protocols required when uploading a package to Transcriptic. A package can contain many protocols but for our example it will contain just one.  The `\"inputs\"` stanza defines expected parameter types which translate into the proper UI elements for that type when you upload the package to Transcriptic.  Read more about the manifest file [here](http://developers.transcriptic.com/v1.0/docs/the-manifest).  The preview section serves to provide your script with hard-coded parameters and refs for local testing:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/T7KvmmwReCvbkyV3SWSc_manifest_json.png\",\n        \"manifest_json.png\",\n        \"953\",\n        \"577\",\n        \"#699188\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe following is what your `test.py` file would look like.  Note that there is no need to declare a Protocol object within the script or print the protocol to standard out, both of these things are taken care of by `autoprotocol.harness`.  **The `protocol_name` parameter in `autoprotocol.harness.run()` must match the name of that protocol within your manifest.json file**:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/jZcTi6AQSOY9vDQJAzan_test_py.png\",\n        \"test_py.png\",\n        \"630\",\n        \"223\",\n        \"#618eaa\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nA requirements.txt file is necessary for any modules your code relies on to run.  In the example below, the file specifies a specific commit SHA of the [autoprotocol-python](https://github.com/autoprotocol/autoprotocol-python) library.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3tlwA8tlTvufPkgetwQ2_requirements_txt.png\",\n        \"requirements_txt.png\",\n        \"704\",\n        \"211\",\n        \"#6090b5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nA release consists of everything within the protocols_folder folder **(but do not zip the folder itself: the manifest.json file must be at the top level of the archive.)**.  You can prepare a release automatically from within a directory by using the `transcript release` command as outlined above.","excerpt":"","slug":"working-with-packages","type":"basic","title":"Working With Packages"}

Working With Packages


[block:api-header] { "type": "basic", "title": "Create a New Package" } [/block] `$ transcriptic create-package test_package "for testing protocols"` [block:api-header] { "type": "basic", "title": "List Existing Packages" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/AaSnXhoSKaSWMJthGSwl_transcripticpackages.png", "transcripticpackages.png", "496", "119", "#6b9ecb", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Initialize a Directory With An Empty Manifest Template" } [/block] The init command creates an empty `manifest.json` file with the proper structure within the current directory (by default) or a directory passed as an argument. Read below or [here](https://developers.transcriptic.com/v1.0/docs/the-manifest) to find out more about what a manifest does. This command will prompt to overwrite if your folder already contains a file called `manifest.json`. [block:image] { "images": [ { "image": [ "https://files.readme.io/ohYEXRbpRNGWgSO2C3U7_transcripticinit.png", "transcripticinit.png", "301", "222", "#6c9bc4", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Compress All Files in Working Directory into a Release" } [/block] `$ transcriptic build-release` Passing a `--name` argument allows you to name your release, otherwise it will be named `release_<version from manifest>` automatically [block:api-header] { "type": "basic", "title": "Compress All Files in Working Directory into a Release and Upload to a Package" } [/block] `$ transcriptic build-release test_package` Passing a package name as an argument automatically uploads the release created to that package. [block:api-header] { "type": "basic", "title": "Upload a Release to an Existing Package" } [/block] `$ transcriptic upload-release release_v1.0.0.zip test_package` [block:api-header] { "type": "basic", "title": "More About Packages" } [/block] The [autoprotocol-python](https://github.com/autoprotocol/autoprotocol-python) library helps you generate Autoprotocol with easy to use functions. [autoprotocol.harness](https://github.com/autoprotocol/autoprotocol-python/blob/master/autoprotocol/harness.py) parses a set of typed input parameters contained in a `manifest.json` file and passes them back to the specified script when you run `transcriptic preview` (see above). Input types also define protocol browser UI elements on transcriptic's website. [block:api-header] { "type": "basic", "title": "Worked Example" } [/block] The example below assumes the following file structure: ``` test_package/ manifest.json requirements.txt test.py ``` A manifest.json file contains metadata about protocols required when uploading a package to Transcriptic. A package can contain many protocols but for our example it will contain just one. The `"inputs"` stanza defines expected parameter types which translate into the proper UI elements for that type when you upload the package to Transcriptic. Read more about the manifest file [here](http://developers.transcriptic.com/v1.0/docs/the-manifest). The preview section serves to provide your script with hard-coded parameters and refs for local testing: [block:image] { "images": [ { "image": [ "https://files.readme.io/T7KvmmwReCvbkyV3SWSc_manifest_json.png", "manifest_json.png", "953", "577", "#699188", "" ] } ] } [/block] The following is what your `test.py` file would look like. Note that there is no need to declare a Protocol object within the script or print the protocol to standard out, both of these things are taken care of by `autoprotocol.harness`. **The `protocol_name` parameter in `autoprotocol.harness.run()` must match the name of that protocol within your manifest.json file**: [block:image] { "images": [ { "image": [ "https://files.readme.io/jZcTi6AQSOY9vDQJAzan_test_py.png", "test_py.png", "630", "223", "#618eaa", "" ] } ] } [/block] A requirements.txt file is necessary for any modules your code relies on to run. In the example below, the file specifies a specific commit SHA of the [autoprotocol-python](https://github.com/autoprotocol/autoprotocol-python) library. [block:image] { "images": [ { "image": [ "https://files.readme.io/3tlwA8tlTvufPkgetwQ2_requirements_txt.png", "requirements_txt.png", "704", "211", "#6090b5", "" ] } ] } [/block] A release consists of everything within the protocols_folder folder **(but do not zip the folder itself: the manifest.json file must be at the top level of the archive.)**. You can prepare a release automatically from within a directory by using the `transcript release` command as outlined above.