Skip to main content

Unofficial library for accessing Pinata's IPFS APIs

Project description

Pinata-Python

Unofficial IPFS python library for interacting with Pinata APIs

Installation

Run the following to install:

pip install Pinata-Python

Usage

  1. Register an account on Pinata
  2. Create a new api key on api keys page
  3. Copy your api key, api secret and secret key to be used below.
from pinata import Pinata

pinata = Pinata(ap_key, secret_key, access_token)

Pin a file

To upload your file to Pinata, you can either provide:

  1. Directory path of the file you want to upload
  2. File itself as a Byte Stream, eg. If from flask request:
file = request.files["file_name"]

Finally,

from pinata import Pinata

pinata = Pinata(ap_key, secret_key, access_token)

response = pinata.pin_file(file)
print(response)

Unpin a file

To unpin a file, you will need the file's IpfsHash.

from pinata import Pinata

pinata = Pinata(ap_key, secret_key, access_token)

response = pinata.unpin_file(ipfs_hash)
print(response)

Get all pins

If you want to get all pins in your account:

from pinata import Pinata

pinata = Pinata(ap_key, secret_key, access_token)

response = pinata.get_pins()
print(response)

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

pinata-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distributions

pinata-0.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

Pinata-0.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pinata-0.0.1.tar.gz.

File metadata

  • Download URL: pinata-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pinata-0.0.1.tar.gz
Algorithm Hash digest
SHA256 aa6c39900bc00b2c88d05325c547198cc6b0da3cb9248c9e8014bc42c3d66ac1
MD5 3bfbe2049b7c080384e2c41dd8f48e57
BLAKE2b-256 19151e41f0ca79450b01a9380fe72f8bc01a1432a245534a921e1d6712371fa4

See more details on using hashes here.

File details

Details for the file pinata-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pinata-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pinata-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72d19a95455b7e3c2f56574ab551f7f6a9c9d9ae3441263d13f90e291b0fb829
MD5 0a057a79893256c670c78d44db1d8b72
BLAKE2b-256 be499866969f5ac5cfc15164d62a1807580a0ad50ca71f4ba6fc7b92d02de382

See more details on using hashes here.

File details

Details for the file Pinata-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: Pinata-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for Pinata-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 356402544ac9bb32a011466cd2b9d834bb9979d5b147f01ba4cf6bb7940869f7
MD5 6fefc17ef39187ed91a9dd349a80211a
BLAKE2b-256 c5d6764bbb463d1455a7d9ea1f87670919f8094aae15c7481d889653b2a43511

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