Skip to content

sarvesh4396/pantry-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pantry-cloud

PyPI version Language GitHub issues GitHub forks GitHub stars GitHub license GitHub last commit (branch) Pull Requests

This lightweight package is a python implementation of Free JSON Storage API pantry.

Features

  • Creates a basket.
  • Deletes a basket.
  • Updates a basket.
  • Shows account details.
  • Writes basket data in json file.

The aim of this package is to make pantry api usage simple.

Installation

pantry-cloud requires python3.7+ to run.

Windows

pip install pantry-cloud
or
pip install --upgrade pantry-cloud

Linux

pip3 install pantry-cloud
or 
pip3 install --upgrade pantry-cloud

Module Usage

Creating basket

from pantry_cloud import Pantry

pantry = Pantry(api_key='your api key')
res = pantry.create(basket='hello', inputfile='path to json file') # Use inputfile if you want to upload data
print(res)

Basket detail

from pantry_cloud import Pantry

pantry = Pantry(api_key='your api key')
res = pantry.basket(basket='hello', outputfile='path to json file') # Use outputfile if you want to write data data
print(res)

CLI Usage

usage: pantry [-h] -a API [-o OUTPUT_FILE] [-i INPUT_FILE] [-s] [-b BASKET] [-u UPDATE] [-c CREATE] [-d DELETE]

optional arguments:
  -h, --help            show this help message and exit
  -a API, --api API     api key.
  -o OUTPUT_FILE, --output OUTPUT_FILE
                        output file.
  -i INPUT_FILE, --input INPUT_FILE
                        input file.
  -s, --show            Shows account details.
  -b BASKET, --basket BASKET
                        Shows data of a basket.
  -u UPDATE, --update UPDATE
                        Updates a basket.
  -c CREATE, --create CREATE
                        Creates a new basket , or replace an existing one.
  -d DELETE, --delete DELETE
                        Deletes the entire basket.