Skip to content

Reference

Zipline CLI

Environment Variables

Environment Variables are stored in the .zipline file in your home directory.

  • Location: ~/.zipline or $HOME/.zipline
Variable Description
ZIPLINE_URL URL to your Zipline Instance
ZIPLINE_TOKEN Authorization Token from Zipline
ZIPLINE_FORMAT Output Format. Variables: {filename}, {url} and {raw_url}

See .zipline.example for an example .zipline file.

Deprecated Variables

Both ZIPLINE_EXPIRE and ZIPLINE_EMBED have been deprecated. These options will be restored in a future release.

You may override them by exporting the variables in your current environment or using the corresponding command line arguments.

API Reference

Initialize the class with your Zipline URL. Everything else is a header passed as a kwarg. The API does not yet support environment variables.

Zipline Token/Authorization is a header kwarg and can be passed as follows:

from zipline import Zipline
zipline = Zipline('ZIPLINE_URL', authorization='ZIPLINE_TOKEN')

Upload a File

from zipline import Zipline
zipline = Zipline('ZIPLINE_URL', authorization='ZIPLINE_TOKEN')
with open('text.txt') as f:
    url = zipline.send_file('test.txt', f)
print(url)

For more details, view the src/zipline.py file.

Command Line

For more details see zipline -h.

 Usage: zipline [OPTIONS] [FILES]...

 Zipline CLI

┌─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────┐
│   files      [FILES]...  Files...                                                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─ Options ───────────────────────────────────────────────────────────────────────────────────────────────┐
│ --name                   -n           File Name (sent with upload).                             │
│ --url                    -u           Zipline URL. [env var: ZIPLINE_URL]                       │
│ --token,--authorization  -t,-a        Zipline token.                                            │
│                                       [env var: ZIPLINE_TOKEN, ZIPLINE_AUTHORIZATION]           │
│ --verbose                -v           Verbose Output (jq safe). [env var: ZIPLINE_VERBOSE]      │
│ --setup                  -S           Run interactive setup.                                    │
│ --info                   -I           Show saved information.                                   │
│ --version                -V           Show installed version.                                   │
│ --install-completion                  Install completion for the current shell.                 │
│ --show-completion                     Show completion for the current shell, to copy it or      │
│                                       customize the installation.                               │
│ --help                   -h           Show this message and exit.                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘

 

Question

If you need help getting started or run into any issues, support is available!