Skip to main content

Metafile Python SDK

SDK demo

import time
from metafile_sdk import Metafile
from metafile_sdk.bitsv import PrivateKey
from metafile_sdk.api.metasv import MetasvApi
from metafile_sdk.api.sensible_query import SensibleQueryApi

# metafile protocol node of your metaid
metafile_protocol = ''
# wif that can add child nodes under your metafile protocol node
wif = ''
# path to the file
file_path = ''


def whatsonchain_demo():
    metafile = Metafile()
    pk: PrivateKey = PrivateKey(wif)
    print(pk.address)
    print(pk.get_balance())
    t1 = time.time()
    txid = metafile.upload_metafile_from_path(pk, metafile_protocol, file_path)
    t2 = time.time()
    print('main txid', txid)
    print('main txid', f'https://metafile.id/download/{txid}')
    print('main txid', t2 - t1)


def sensible_query_demo():
    metafile = Metafile()
    pk: PrivateKey = PrivateKey(wif)
    # use sensible query api
    sensible_query_api = SensibleQueryApi()
    pk.network_api = sensible_query_api
    print(pk.address)
    print(pk.get_balance())
    t1 = time.time()
    txid = metafile.upload_metafile_from_path(pk, metafile_protocol, file_path)
    t2 = time.time()
    print('main txid', txid)
    print('main txid', f'https://metafile.id/download/{txid}')
    print('main txid', t2 - t1)


def metasv_demo():
    metafile = Metafile()
    pk: PrivateKey = PrivateKey(wif)
    # use metasv api
    metasv_api_key = ''
    metasv = MetasvApi(metasv_api_key)
    pk.network_api = metasv
    print(pk.address)
    print(pk.get_balance())
    t1 = time.time()
    txid = metafile.upload_metafile_from_path(pk, metafile_protocol, file_path)
    t2 = time.time()
    print('main txid', txid)
    print('main txid', f'https://metafile.id/download/{txid}')
    print('main txid', t2 - t1)


def main():
    #  pip install metafile-sdk
    # whatsonchain_demo()
    sensible_query_demo()
    # metasv_demo()


if __name__ == '__main__':
    main()

Metadata

Release files for metafile-sdk 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metafile-sdk 0.3.3
File Size Uploaded Provenance Actions
metafile_sdk-0.3.3.tar.gz 40.8 kB Without provenance Details for metafile_sdk-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metafile-sdk 0.3.3
File Interpreter ABI Platform Actions
metafile_sdk-0.3.3-py3-none-any.whl Python 3 none any Details for metafile_sdk-0.3.3-py3-none-any.whl

Total release size: 93.0 kB

Release files / metafile_sdk-0.3.3.tar.gz

Download URL metafile_sdk-0.3.3.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e5dbfc189ef7a8a080db71179bdd184abe59a2ef565984350e14ffb6d84beb67
BLAKE2b-256 checksum
How to use checksums
b0ec332ec37548f1fdfe860207768def91a6d313a356e599fef2de75684977b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / metafile_sdk-0.3.3-py3-none-any.whl

Download URL metafile_sdk-0.3.3-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87bebe43aebe9a94834e62c9726fe396fbf332818a45ba9e82cd958ea1fc2dca
BLAKE2b-256 checksum
How to use checksums
0809147f081e5e697334d11571d412f737f93d7a89f6da709183eb30eda6867c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for metafile-sdk 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page