The ipfshttpclient library provides a client interface to the IPFS HTTP API, allowing Python applications to interact with an IPFS daemon. This library version `0.7.0`, released in March 2021, is tested against go-ipfs v0.7.0 and strives to support the last 5 releases of go-IPFS. It was previously known as `ipfsapi`.
pip install ipfshttpclientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to a local IPFS daemon, add a file, and retrieve its content by hash. Ensure you have an IPFS daemon running in the background before executing.
Update your `pip install` command to `pip install ipfshttpclient` and change all `import ipfsapi` statements to `import ipfshttpclient`.
Consult the `ipfshttpclient` documentation or GitHub README for supported `go-ipfs` daemon versions for your `ipfshttpclient` version. Upgrade `ipfshttpclient` or downgrade `go-ipfs` as necessary. For `ipfshttpclient` 0.7.0, it's generally compatible with `go-ipfs` v0.4.23 up to v0.7.0/0.8.0.
Always use `ipfshttpclient`. Double-check import statements and `pip install` commands to ensure you are not installing or importing the defunct `ipfsApi` library.
Ensure an IPFS daemon is running locally (e.g., by executing `ipfs daemon` in your terminal) and connect to its API address, usually `http://127.0.0.1:5001` or `/dns/localhost/tcp/5001/http`.
Change `import ipfsapi` to `import ipfshttpclient`. If you explicitly need the old `ipfsapi` shim, install it via `pip install ipfsapi`, but it's recommended to migrate to `ipfshttpclient`.
Update your `ipfshttpclient` library to a version compatible with your `go-ipfs` daemon (or vice-versa). Check the `ipfshttpclient` GitHub page for current compatibility. For `ipfshttpclient` 0.7.0, it supports `go-ipfs` 0.4.23 to approximately 0.8.0.
Verify that your IPFS daemon is running (run `ipfs daemon` in a separate terminal) and that `ipfshttpclient.connect()` is configured to connect to the correct address and port (default is `/dns/localhost/tcp/5001/http`). Check firewall settings if connecting to a remote daemon.
Iterate over your list of files and call `client.add()` for each file. For adding directories, pass the directory path directly to `client.add()` with `recursive=True`.
No dependency data recorded yet.