Skip to main content

An IPFS web3.storage unofficial library.

Project description

web3.storage

This is IPFS web3.storage unofficial library written in python. I have made it simple and easier to integrate with web3.storage API using this masterpiece of codes.

Releases License: MIT

Installation

You can either install it from git, or using pip.

~$ git clone https://github.com/tahaafarooq/web3.storage
~$ cd web3.storage
~$ pip3 install -r requirements.txt 
~$ python3 setup.py install
~$ pip3 install web3storagepy

Usage

To upload a file to the IPFS web3 storage API we will do the following;

>> > import web3storagepy
>> > w3s = web3storagepy
>> > upload = w3s.upload(file="XXXXXX", token="XXXXXXX")
>> > upload
{'STATUS_CODE': 200, 'RESPONSE': '{"cid":"XXXXXXXXXXXXXXXX","carCid":"XXXXXXXXXXXX"}'}

Using the CID you are provided with you can decide to check the status of the uploaded file with;

>> > import web3storagepy
>> > w3s = web3storagepy
>> > status = w3s.status(cid="XXXXXXXX", token="XXXXXXXXXXXX")
>> > status
{'RESPONSE': '{xxx:xxx}'}

You can retrieve all your uploaded files with;

>> > import web3storagepy
>> > w3s = web3storagepy
>> > all_files = w3s.user_uploads(token="XXXXXXXXX")
>> > all_files
'XXXXXXXXXXXXXXXXX'

You can access your uploaded file by providing only the CID as follows;

>> > import web3storagepy
>> > w3s = web3storagepy
>> > get_file = w3s.get_upload(cid="XXXXXXXXX")
>> > get_file
'https://XXXXXXXXX.ipfs.w3s.link'

Give it star

If you happen to find this repository useful or helpful , give it a star!

Issues

Are you facing any issue with usage of the package, just raise an issue and I will look into fixing it as soon as possible

Contributions

If there is anything yould would like to add warmly welcome, Just fork it

Disclaimers

This is not an official package, therefore I'm not responsible for any misinformation or misuse of the package of any kind !!!

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

web3storagepy-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web3storagepy-0.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web3storagepy-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for web3storagepy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2d135e1f705d6913e1f1c3da0b9f00446b959a6f9d4ab7e448e8249ea72f1344
MD5 e65bcfdd32d6a3bc5688cc050f8eeee1
BLAKE2b-256 73002468f94660fce328e836fd7d4c5480b12f5e5843c56aa43d27f21ca94e33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: web3storagepy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for web3storagepy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ea14e9fb36d4862b821a0c8fb666ec6fd346514fda8cb51b7d96f9c587897f1
MD5 918e0a9b8a12e2cb3c3aa3fe996c80a2
BLAKE2b-256 1173fbf3a92eed031b3232d46e48435b50e61ed1e09d0a67438a6d2797a97184

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page