Skip to main content

Python 3 CLI for Zipline

Project description

Discord Codacy Badge PyPI

Zipline CLI

Python 3 CLI Uploader for Zipline.

This is currently a WIP and not complete, but has some useful functions.

Install

From PyPi using pip:

python3 -m pip install zipline-cli

From GitHub using pip:

python3 -m pip install git+https://github.com/cssnr/zipline-cli.git

From Source using setuptools:

git clone https://github.com/cssnr/zipline-cli.git
cd zipline-cli
python3 setup.py install

Uninstall:

python3 -m pip uninstall zipline-cli

CLI Usage

You will need a Zipline URL and Token to use the utility.

Setup Zipline URL and Token:

zipline --setup

Upload a File:

zipline test.txt

Create Text File from Input

cat test.txt | zipline 

Create Text File from Text

zipline
# type or paste contents followed by Ctrl+D (Ctrl+Z on Windows)

Environment Variables

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

  • Location: ~/.zipline
Variable Description
ZIPLINE_URL URL to your Zipline Instance
ZIPLINE_TOKEN Authorization Token from Zipline
ZIPLINE_EMBED Set this enable Embed on your uploads
ZIPLINE_EXPIRE See: https://zipline.diced.tech/docs/guides/upload-options#image-expiration

You may also override them by exporting the variables in your current environment.

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)

Additional Information

If you have more questions, concerns, or comments? Join our Discord for more information...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zipline-cli-0.1.2.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

zipline_cli-0.1.2-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page