Python utility to quickly share a file to ipfs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Victor Roest 512a03f3f9
add url encode
7 months ago
.vscode Added clipboard support 7 months ago
ipfs_share add url encode 7 months ago
.gitignore Add Gitignore 7 months ago
.gitmodules First ipfshttpclient based version 7 months ago
Pipfile Switched to ipfshttpclient (vendored) 7 months ago
Pipfile.lock Switched to ipfshttpclient (vendored) 7 months ago
README.md First ipfshttpclient based version 7 months ago
setup.py Split into multiple files 7 months ago

README.md

ipfs-share

A utility to make sharing files over IPFS more convenient by generating gateway urls, pinning the CID to a remote node and copying the url to your clipboard.

Usage

usage: ipfs-share [-h] [-p] [--no-clipboard] path

Share a file using IPFS

positional arguments:
  path            The file or folder to share

optional arguments:
  -h, --help      show this help message and exit
  -p, --pin       Pin target to a remote node or cluster
  --no-clipboard  Disable clipboard support

Environment:
  IPFS_GATEWAYS              A list of IPFS Gateway URLs to be used for generating urls
  IPFS_REMOTE_PINNER_TYPE    Either 'node' or 'cluster' depending on what remote pinner you want to use
  IPFS_REMOTE_PINNER_URL     The URL for a remote pinner

Example

> ipfs_share index.html

CID: QmTeLU7tgi82xU9Hmmp4GwTV11XDPF6Ts5qvCciPNKhs3r
https://cloudflare-ipfs.com/ipfs/QmTeLU7tgi82xU9Hmmp4GwTV11XDPF6Ts5qvCciPNKhs3r/index.html
https://ipfs.xirion.net/ipfs/QmTeLU7tgi82xU9Hmmp4GwTV11XDPF6Ts5qvCciPNKhs3r/index.html

Requirements

  • python version 3.9 (untested on older versions)
  • python-requests for sending http requests
  • (optional) tk for clipboard support