Skip to content

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

Open
@fahadh4ilyas

Description

@fahadh4ilyas

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

sample_dict = {
    "some_key": "some_value"
}

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

Instead, I have to do this

sample_dict = {
    "some_key": "some_value"
}

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

client.add('some_data.json')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions