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

async 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
  await pantry.update_basket("another_basket", {"hello": [1,2,3]}) # also returns a Basket object
  # --- or ---
  basket = await pantry.get_basket("test_basket")
  async 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.post1

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.post1
File Size Uploaded Provenance
getpantry_py-1.1.0.post1.tar.gz 5.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 12.4 kB

Release files / getpantry_py-1.1.0.post1.tar.gz

Download URL getpantry_py-1.1.0.post1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
287f8fa381a1e00dfd55a5f5042fdce0c5d0d6fc3e6b3dcd6fb6aaf8a38a7116
BLAKE2b-256 checksum
How to use checksums
0b891de987e5ec1b201be00f7519d891b50dc6be358d264ad8ffea137d95186d
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.post1-py3-none-any.whl

Download URL getpantry_py-1.1.0.post1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08251bb3036bf8c504881273579ec632538699b81bf888af670ada4c5df3cced
BLAKE2b-256 checksum
How to use checksums
8149a6f13a361dea949fa95a749df27c6ab945d306b8091d70029fde656ca39e
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.post1

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