Skip to main content

getpantry.py

A getpantry.cloud API Wrapper written in Python

Example

from pantry_cloud import Pantry

pantry = Pantry("pantry_id")
# you could also optionally add "wait_for_ratelimits = True"
# so the code would wait if there is a ratelimit, which WILL SLOW DOWN your program

# create a basket
bask = pantry.create_basket("basket_name", {"key": "value"}) # returns a Basket object

# get a basket
bask2 = pantry.get_basket("another_basket") # also returns a Basket object

# update a basket
pantry.update_basket("another_basket", {"key": 123, "hello": "world"}) # also returns a Basket object
# --- or ---
basket = pantry.get_basket("basket_to_update")
with basket:
  basket["testkey"] = "testvalue" # it updates the basket automatically on context exit

# delete a basket
pantry.delete_basket("basket_to_delete")

# get a basket's public id
public_id = pantry.get_basket_public_id("public_basket") # returns a string
# get a public basket
public_bask = Pantry.get_public_basket(public_id) # returns a PublicBasket object

# get pantry info
pantry.get_info() # returns PantryInformation object
# --- or ---
pantry.me # returns PantryInformation object

# update pantry info
pantry.update_info("new name", "new description") # also returns a PantryInformation object

Asynchronous example

pip install getpantry.py[asynchronnous]

from pantry_cloud import AsyncPantry
import async

pantry = AsyncPantry("pantry_id")
# this version has wait_for_ratelimits always on, so you should
# probably put the updates on background

def main():
  # create a basket
  bask = await pantry.create_basket("basket_name", {"key": "value"}) # returns a Basket object

  # get a basket
  bask2 = await pantry.get_basket("basket_two") # returns a Basket object

  # update a basket
  pantry.update_basket("another_basket", {"hello": [1,2,3]}) # also returns a Basket object
  # --- or ---
  basket = pantry.get_basket("test_basket")
  with basket:
    basket["test"] = [1, 2, 3 ,4] # it updates the basket automatically on context exit

  # delete basket
  await pantry.delete_basket("basket_begone")

  # get a basket's public id
  public_id = await pantry.get_basket_public_id("pretend_this_is_a_public_basket") # returns a string
  # get a public basket
  public_bask = await pantry.get_public_basket(public_id) # returns a PublicBasket object

  # get pantry info
  await pantry.get_info() # returns a PantryInformation object  
    
asyncio.run(main())

Metadata

Release files for getpantry.py 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getpantry.py 1.1.0
File Size Uploaded Provenance
getpantry_py-1.1.0.tar.gz 5.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for getpantry.py 1.1.0
File Interpreter ABI Platform
getpantry_py-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / getpantry_py-1.1.0.tar.gz

Download URL getpantry_py-1.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1bdbfaaca43da695dd3b894c8358a11f871bf96da59255089c4789d1bdc7e7a3
BLAKE2b-256 checksum
How to use checksums
ffe6bac71ad937667059bc281260937089a89101d10964a640b07f834e82a807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / getpantry_py-1.1.0-py3-none-any.whl

Download URL getpantry_py-1.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5a3441e01f8e65421ace7d5f77a0ceeb5e22186ae912966e4f49191f59030ce
BLAKE2b-256 checksum
How to use checksums
a1e3e7d9142e96f891a062da096624f202af8c59cdcb0bc657e247ece6599af1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for getpantry.py 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page