Skip to main content

Python 3 CLI for Zipline

Project description

Discord Issues Codacy Test Build GitHub Release Version PyPI

Zipline CLI

Python 3 CLI Uploader for Zipline and Django Files. Zipline CLI is currently functional and Under Active Development.
Please open a Feature Request for new features and submit an Issue for any bugs you find.

Table of Contents

Quick Start

python3 -m pip install zipline-cli
zipline --setup

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 pip:

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

From Source using setuptools:

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

Uninstall

To completely remove from any above install methods:

python3 -m pip uninstall zipline-cli

CLI Usage

Setup Zipline URL and Token:

zipline --setup

Upload a File:

zipline test.txt

Upload Multiple Files:

zipline file1.txt file2.txt

Create Text File from Input

cat test.txt | zipline 

Create Text File from Clipboard

zipline
# Paste or Type contents, followed by a newline, then Ctrl+D (Ctrl+Z on Windows)

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_EMBED Set this enable Embed on your uploads
ZIPLINE_FORMAT Output Format after upload. Variables: {filename}, {url} and {raw_url}
ZIPLINE_EXPIRE Zipline: https://zipline.diced.tech/docs/guides/upload-options#image-expiration
ZIPLINE_EXPIRE Django Files: https://github.com/onegreyonewhite/pytimeparse2#pytimeparse2-time-expression-parser

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

You may override them by exporting the variables in your current environment or using the corresponding command line arguments. Use zipline -h for more info.

Python 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

Still have questions, concerns, or comments?

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.6.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

zipline_cli-0.1.6-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file zipline_cli-0.1.6.tar.gz.

File metadata

  • Download URL: zipline_cli-0.1.6.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for zipline_cli-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b89d5ebf6a9f0e1bbcc5e79d7fcac38e045d7c88ba21d6ac330cd15d6fa50370
MD5 7cf0069b6e5fa131d591be6b18aa572f
BLAKE2b-256 0646b0799f2d92b166d47a19ca2e319ed585f14e0ad523f3aef0d9ae62ab7899

See more details on using hashes here.

File details

Details for the file zipline_cli-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: zipline_cli-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for zipline_cli-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c597825ca526911b80eb8a0b64c65859a1cc6e97c7a7ef19b81180e0164ba5d7
MD5 c17dba5110298395cc6631380ef6219c
BLAKE2b-256 1ff7534f99d6859ba6d37f4e9fe08676ea14a202cab98a7ae80619141283e943

See more details on using hashes here.

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