Package: ipyfs
From now on, you will be able to easily control IPFS System with IPyFS (IPFS Python CLI).IPFS RPC APIs Documnets:https://docs.ipfs.io/reference/kubo/rpcSource Code:https://github.com/837477/IPyFSIPyFS is a Python-based IPFS CLI.The key features are:Base: IPyFS is built based on IPFS RPC APIs.Easy: It is designed to be easy to use and learn. You can simply refer to the IPFS RPC APIs document.RequirementsPython 3.7+IPyFS stands on the shoulders of giants:IPFS Daemonfor the IPFS server.RequestsFor communication with IPFS Daemon.It's so obvious! Since IPyFS is a Python-based IPFS CLI,IPFS Server must be running.Installation$pipinstallipyfsExampleSimple IPyFS usagefromipyfsimportFiles,Swarm# + Etc.# Host and port can be modified for each IPyFS controller.files=Files(host="http://localhost",# Set IPFS Daemon Hostport=5001# Set IPFS Daemon Port)swarm=Swarm(host="http://sample.ipyfs.com",# Set IPFS Daemon Hostport=7477# Set IPFS Daemon Port)The parameters of the IPyFS module are designed to be almost identical to the parameters of the IPFS RPC APIs.Example of NFT Metadata UploadYou can check it in thesample.pyfile."""Example of NFT Metadata Upload"""fromipyfsimportFilesimportjson# You can customize the host and port on any controller.files=Files(host="http://localhost",# Set IPFS Daemon Hostport=5001# Set IPFS Daemon Port)# Read the file and upload it to IPFS.withopen("ipyfs.png","rb")asf:files.write(path=f"/{f.name}",file=f,create=True)# Get the information of the uploaded file.info=files.stat('/ipyfs.png')# Generate NFT metadata.metadata={"name":"Sample NFT","description":"Sample NFT Description","image":f"ipfs://{info['result']['Hash']}"}# Upload the NFT metadata to IPFS.files.write(path="/metadata.json",file=json.dumps(metadata),create=True)IPyFS is basically the same as the parameters of IPFS RPC APIs.Let's practice together !If you want to list the file in yourIPFS Daemon:Here is the IPFS Files RPC API document:https://docs.ipfs.io/reference/kubo/rpc/#api-v0-files-lsThe document needs parametersarg/long/u.Likewise, IPyFS can use the same parameters. (path/long/u)However, they are not exactly the same. In RPC, most parameter names are used asarg.This is not a good way.Therefore, IPyFS has slightly changed parameter names to suit their functions.Importantly, only the name has changed, the purpose of the parameter is the same.fromipyfsimportFilesfiles=Files(host="http://localhost",# Set IPFS Daemon Hostport=5001# Set IPFS Daemon Port)result=files.ls(path="/",long=True)print(result)If you want to know what each parameter is, please refer to theIPFS RPC API documentation.ContributingThe following is a set of guidelines for contributing to sejong-univ-auth. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.Please create a branch in this format,<Issue Number>-<Some name>Open a terminal and navigate to your project path. And enter this.git config --global commit.template .gitmessage.txtYou can use the template, withgit committhrough vi.Notgit commit -mIf you want to merge your work, please pull request to thedevbranch.Enjoy contributing!If you have any other opinions, please feel free to suggest 😀LicenseThis project is licensed under the terms of the MIT license.