{"id":13794143,"url":"https://github.com/MikeHibbert/arweave-python-client","last_synced_at":"2025-05-12T20:31:31.755Z","repository":{"id":37466309,"uuid":"234777379","full_name":"MikeHibbert/arweave-python-client","owner":"MikeHibbert","description":"This client allows you to integrate your python apps with the Arweave network allowing you to perform wallet operations and transactions","archived":false,"fork":false,"pushed_at":"2025-03-29T05:40:36.000Z","size":1225,"stargazers_count":103,"open_issues_count":14,"forks_count":45,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-30T03:04:07.143Z","etag":null,"topics":["arweave","cryptocurrency","python","transaction","wallet"],"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/MikeHibbert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-01-18T18:20:17.000Z","updated_at":"2024-12-06T16:25:35.000Z","dependencies_parsed_at":"2023-01-29T15:15:36.510Z","dependency_job_id":"fa04ca76-f8e5-4757-b7d9-ddc1085bfda9","html_url":"https://github.com/MikeHibbert/arweave-python-client","commit_stats":{"total_commits":92,"total_committers":13,"mean_commits":7.076923076923077,"dds":"0.23913043478260865","last_synced_commit":"e142b89f593bd73bd5d0e98fcfa9d620af1d2e3b"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHibbert%2Farweave-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHibbert%2Farweave-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHibbert%2Farweave-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHibbert%2Farweave-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MikeHibbert","download_url":"https://codeload.github.com/MikeHibbert/arweave-python-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253816762,"owners_count":21968878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["arweave","cryptocurrency","python","transaction","wallet"],"created_at":"2024-08-03T23:00:36.437Z","updated_at":"2025-05-12T20:31:28.258Z","avatar_url":"https://github.com/MikeHibbert.png","language":"Python","funding_links":[],"categories":["Tools ⚙️"],"sub_categories":[],"readme":"# arweave-python-client\nThis client allows you to integrate your python apps with the Arweave network allowing you to got wallet operations and transactions\n\n## Installing\nTo use the library simply install it:\n```buildoutcfg\npip install arweave-python-client\n```\n\n## Using your wallet\nOnce installed you can import it and supply the wallet object with the path to your wallet JSON file:\n```buildoutcfg\nimport arweave\n\n\nwallet_file_path = \"/some/folder/on/your/system\"\nwallet = arweave.Wallet(wallet_file_path)\n\nbalance =  wallet.balance\n\nlast_transaction = wallet.get_last_transaction_id()\n```\n\n## Loading your wallet\nIf your wallet data is stored in a secret manager or anywhere other than a file, you can load it with the `from_data` classmethod:\n```buildoutcfg\nimport arweave\n\nwallet_data = // Load from cloud storage or wherever\nwallet = arweave.Wallet.from_data(wallet_data)\n\nbalance =  wallet.balance\n```\n\n## Transactions\nTo send a transaction you will need to open your wallet, create a transaction object, sign the transaction and then finally post the transaction:\n```buildoutcfg\nimport arweave\n\n\nwallet_file_path = \"/some/folder/on/your/system\"\nwallet = arweave.Wallet(wallet_file_path)\n\ntransaction = arweave.Transaction(wallet, quantity=0.3, to='\u003csome wallet address')\ntransaction.sign()\ntransaction.send()\n```\n\n#####ATTENTION! quantity is in AR and is automatically converted to Winston before sending\n\n## Uploading large files\nUploading large data files is now possible! you can now upload data larger than your physical memory or maximum transaction size (12MB) in the following way\n```buildoutcfg\nfrom arweave.arweave_lib import Wallet, Transaction\nfrom arweave.transaction_uploader import get_uploader\n\nwallet = Wallet(jwk_file)\n\nwith open(\"my_mahoosive_file.dat\", \"rb\", buffering=0) as file_handler:\n    tx = Transaction(wallet, file_handler=file_handler, file_path=\"/some/path/my_mahoosive_file.dat\")\n    tx.add_tag('Content-Type', 'application/dat')\n    tx.sign()\n\n    uploader = get_uploader(tx, file_handler)\n\n    while not uploader.is_complete:\n        uploader.upload_chunk()\n\n        logger.info(\"{}% complete, {}/{}\".format(\n            uploader.pct_complete, uploader.uploaded_chunks, uploader.total_chunks\n        ))\n```\nNOTE: When uploading you only need to supply a file handle with buffering=0 instead of reading in the data all at once. The data will be read progressively in small chunks\n\nTo check the status of a transaction after sending:\n```buildoutcfg\nstatus = transaction.get_status()\n```\n\nTo check the status much later you can store the ```transaction.id``` and reload it:\n```buildoutcfg\ntransaction = Transaction(wallet, id='some id you stored')\nstatus = transaction.get_status()\n```\n\n## Storing data\nAs you know Arweave allows you to permanently store data on the network and you can do this by supplying data to the transaction as a string object:\n```buildoutcfg\nwallet = Wallet(jwk_file)\n\nwith open('myfile.pdf', 'r') as mypdf:\n    pdf_string_data = mypdf.read()\n\n    transaction = Transaction(wallet, data=pdf_string_data)\n    transaction.sign()\n    transaction.send()\n```\n\n## Retrieving transactions/data\nTo get the information about a transaction you can create a transaction object with the ID of that transaction:\n```\ntx = Transaction(wallet, id=\u003cyour tx id\u003e)\ntx.get_transaction()\n```\n\nIn addition you may want to get the data attached to this transaction once you've decided you need it:\n```\ntx.get_data()\nprint(tx.data)\n\u003e \"some data\"\n```\n\n## Sending to a specific Node\nYou can specify a specific node by setting the api_url of the wallet/transaction object:\n```\nwallet = Wallet(jwk_file)\nwallet.api_url = 'some specific node ip/address and port'\n\nOr\n\ntransaction = Transaction(wallet, data=pdf_string_data)\ntransaction.api_url = 'some specific node ip/address and port'\n\n```\n\n## Arql\nYou can now perform searches using the arql method:\n```buildoutcfg\nfrom arweave.arweave_lib import arql\n\nwallet_file_path = \"/some/folder/on/your/system\"\nwallet = arweave.Wallet(wallet_file_path)\n\ntransaction_ids = arql(\n    wallet,\n    {\n        \"op\": \"equals\",\n        \"expr1\": \"from\",\n        \"expr2\": \"Some owner address\"\n    })\n```\n\nAlternatively, you can use a the helper method arql_with_transaction_data() to get all transaction ids as well as all the data stored in the blockchain\n```buildoutcfg\nimport arweave\n\nwallet_file_path = \"/some/folder/on/your/system\"\nwallet = arweave.Wallet(wallet_file_path)\n\ntransactions = aweave.arql_with_transaction_data(\n    wallet,\n    {\n        \"op\": \"equals\",\n        \"expr1\": \"from\",\n        \"expr2\": \"Some owner address\"\n    })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMikeHibbert%2Farweave-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMikeHibbert%2Farweave-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMikeHibbert%2Farweave-python-client/lists"}