Skip to content

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.

License

Notifications You must be signed in to change notification settings

tahaafarooq/web3storagepy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web3storagepy

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 Downloads License: MIT Made in Tanzania

Installation

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

~$ git clone https://github.com/tahaafarooq/web3storagepy
~$ cd web3storagepy
~$ 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 !!!

About

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.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages