{"id":17307328,"url":"https://github.com/thewtex/pytest-web3-data","last_synced_at":"2026-01-20T14:33:08.958Z","repository":{"id":66616898,"uuid":"536833335","full_name":"thewtex/pytest-web3-data","owner":"thewtex","description":"A pytest plugin to fetch test data from IPFS HTTP gateways during pytest execution.","archived":false,"fork":false,"pushed_at":"2023-10-04T00:35:47.000Z","size":24,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T05:21:09.014Z","etag":null,"topics":["ipfs","pytest","web3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thewtex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-15T02:23:06.000Z","updated_at":"2023-10-05T14:16:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5812ac4-565f-4f5d-afab-64e7120ffcc8","html_url":"https://github.com/thewtex/pytest-web3-data","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"af10fb88ecb8bc290ee462227a296a0e27305611"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thewtex/pytest-web3-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewtex%2Fpytest-web3-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewtex%2Fpytest-web3-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewtex%2Fpytest-web3-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewtex%2Fpytest-web3-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thewtex","download_url":"https://codeload.github.com/thewtex/pytest-web3-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewtex%2Fpytest-web3-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28604908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipfs","pytest","web3"],"created_at":"2024-10-15T12:00:57.856Z","updated_at":"2026-01-20T14:33:08.938Z","avatar_url":"https://github.com/thewtex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pytest Web3 Data\n\n[![PyPI - Version](https://img.shields.io/pypi/v/pytest-web3-data.svg)](https://pypi.org/project/pytest-web3-data)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-web3-data.svg)](https://pypi.org/project/pytest-web3-data)\n[![test](https://github.com/thewtex/pytest-web3-data/actions/workflows/test.yml/badge.svg)](https://github.com/thewtex/pytest-web3-data/actions/workflows/test.yml)\n\n-----\n\nA pytest plugin to fetch test data from IPFS HTTP gateways during pytest execution.\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Installation\n\n```console\npip install pytest-web3-data\n```\n\n## Usage\n\nLet's say we want to store our testing data at `test/data/*`.\n\nOptionally, first add `test/data/` to `.gitignore`.\n\nCreate example test data:\n\n```console\nmkdir -p test/data/staging/\necho 'hello world!' \u003e ./test/data/staging/hello.txt\n```\n\nUpload the data to the [InterPlanetary File System (IPFS)](https://en.wikipedia.org/wiki/InterPlanetary_File_System).\n\nOne option is to use [web3.storage](https://web3.storage). Install [Node/NPM](https://nodejs.org/en/download/), and install the [w3 CLI](https://www.npmjs.com/package/@web3-storage/w3):\n\n\n```console\nnpm install --location=global @web3-storage/w3\n```\n\nThe set your upload token from [https://web3.storage](https://web3.storage):\n\n```console\nw3 token\n# Paste in token from the web UI\n```\n\nUpload the testing data to IPFS:\n\n```console\nw3 put ./test/data/staging --name pytest-web3-data-example --hidden --no-wrap\n```\n\nThis outputs a reference to the [Content Identifier (CID)](https://proto.school/anatomy-of-a-cid/01), e.g.:\n\n```\n# Packed 1 file (0.0MB)\n# bafybeigvfmtttajzj5no3jt2xavkdncxy3xapw3rndvoxmao72vhwy4osu\n⁂ Stored 1 file\n⁂ https://w3s.link/ipfs/bafybeigvfmtttajzj5no3jt2xavkdncxy3xapw3rndvoxmao72vhwy4osu\n```\n\nWhen we create a test, e.g.:\n\n```python\n# content of test_usage.py\ndef test_usage(web3_data):\n    assert web3_data.exists()\n    assert (web3_data / 'hello.txt').read_text() == \"hello world!\\n\"\n```\n\nWe can reference our CID either with a flag:\n\n```console\npytest --web3-data-dir=test/data/bafybeigvfmtttajzj5no3jt2xavkdncxy3xapw3rndvoxmao72vhwy4osu\n```\n\nor in the `pytest.ini` file:\n\n```\n# content of pytest.ini\n[pytest]\nweb3_data_dir = test/data/bafybeigvfmtttajzj5no3jt2xavkdncxy3xapw3rndvoxmao72vhwy4osu\n```\n\nTo add new data, copy the current `web3_data` directory into a staging directory, e.g. `test/data/staging`, add new data, and use this staging directory path for `--web3-data-dir`. Upload to IPFS before committing to Git.\n\nFor a robust and performant experience, we recommend running a local IPFS daemon, e.g. with [ipfs-deskop](https://docs.ipfs.tech/install/ipfs-desktop/).\n\nEnjoy! 😊\n\n## License\n\n`pytest-web3-data` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthewtex%2Fpytest-web3-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthewtex%2Fpytest-web3-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthewtex%2Fpytest-web3-data/lists"}