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
- Register an account on Pinata
- Create a new api key on api keys page
- 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:
- Directory path of the file you want to upload
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa6c39900bc00b2c88d05325c547198cc6b0da3cb9248c9e8014bc42c3d66ac1
|
|
| MD5 |
3bfbe2049b7c080384e2c41dd8f48e57
|
|
| BLAKE2b-256 |
19151e41f0ca79450b01a9380fe72f8bc01a1432a245534a921e1d6712371fa4
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72d19a95455b7e3c2f56574ab551f7f6a9c9d9ae3441263d13f90e291b0fb829
|
|
| MD5 |
0a057a79893256c670c78d44db1d8b72
|
|
| BLAKE2b-256 |
be499866969f5ac5cfc15164d62a1807580a0ad50ca71f4ba6fc7b92d02de382
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
356402544ac9bb32a011466cd2b9d834bb9979d5b147f01ba4cf6bb7940869f7
|
|
| MD5 |
6fefc17ef39187ed91a9dd349a80211a
|
|
| BLAKE2b-256 |
c5d6764bbb463d1455a7d9ea1f87670919f8094aae15c7481d889653b2a43511
|