ipfs-shipyard / ipfs-shipyard/py-ipfs-http-client

Add bytes or json with filename without saving it to a temporary file

Open
#295 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
685
Forks
200
PR merge metrics
No merged PRs in 30d

Description

Is there any way to add bytes or JSON data without saving it to a temporary file before adding it to IPFS? I wanna do something like

```python
sample_dict = {
"some_key": "some_value"
}

client.add_json(sample_dict, filename="some_data.json")
```

Instead, I have to do this

```python
sample_dict = {
"some_key": "some_value"
}

with open('some_data.json', 'w') as f:
json.dump(sample_dict, f)

client.add('some_data.json')
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.