{"id":24613,"library":"soma-sdk","title":"SOMA SDK","description":"Python SDK for the SOMA network, enabling interaction with the SOMA blockchain, wallet management, and transaction building. Current version is 0.1.15, with active development on testnet-v0.1.21. Release cadence is rapid, with frequent patch releases.","status":"active","version":"0.1.15","language":"python","source_language":"en","source_url":"https://github.com/soma-org/soma","tags":["blockchain","sdk","soma","crypto","web3"],"install":[{"cmd":"pip install soma-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP calls to SOMA nodes","package":"requests","optional":false},{"reason":"Data models and validation","package":"pydantic","optional":false},{"reason":"Key generation and signing","package":"cryptography","optional":false}],"imports":[{"note":"The correct package name is `somasdk`, not `soma_sdk`.","wrong":"from soma_sdk import SomaClient","symbol":"SomaClient","correct":"from somasdk import SomaClient"},{"note":"No common mistake known.","symbol":"Wallet","correct":"from somasdk import Wallet"},{"note":"No common mistake known.","symbol":"Transaction","correct":"from somasdk import Transaction"}],"quickstart":{"code":"import os\nfrom somasdk import SomaClient, Wallet\n\n# Initialize client (no auth required for public testnet)\nclient = SomaClient(node_url=os.environ.get('SOMA_NODE_URL', 'https://testnet.soma.org'))\n\n# Create a new wallet\nwallet = Wallet.generate()\nprint(\"Address:\", wallet.address)\nprint(\"Mnemonic:\", wallet.mnemonic)\n\n# Get balance\nbalance = client.get_balance(wallet.address)\nprint(\"Balance:\", balance)","lang":"python","description":"Basic usage: create a client and generate a wallet."},"warnings":[{"fix":"Use `import somasdk` or `from somasdk import ...`.","message":"The SDK uses `somasdk` as the package name, not `soma_sdk`. The PyPI distribution is `soma-sdk` but imports use `somasdk`.","severity":"gotcha","affected_versions":"all"},{"fix":"Update code to use `headers={'Authorization': f'Bearer {token}'}` instead of `api_key`.","message":"The `SomaClient` constructor changed in testnet-v0.1.18: `api_key` parameter removed; authentication is now via `auth_token` header.","severity":"breaking","affected_versions":">=0.1.18"},{"fix":"Replace `Wallet.from_mnemonic(mnemonic)` with `Wallet.from_phrase(mnemonic)`.","message":"`Wallet.from_mnemonic()` is deprecated in favor of `Wallet.from_phrase()`.","severity":"deprecated","affected_versions":">=0.1.15"},{"fix":"Always include scheme: `https://testnet.soma.org`.","message":"Node URLs must include `http://` or `https://` prefix; otherwise silent failure.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install: `pip install soma-sdk`\nImport: `import somasdk` or `from somasdk import ...`","cause":"Incorrect import name: the correct module is 'somasdk' (no underscore).","error":"ModuleNotFoundError: No module named 'soma_sdk'"},{"fix":"Upgrade: `pip install --upgrade soma-sdk`\nThen: `from somasdk import Wallet`.","cause":"The SDK version is too old (pre-0.1.0) or the class is in a submodule.","error":"ImportError: cannot import name 'Wallet' from 'somasdk'"},{"fix":"Use `client.get_balance_v2(address)` for version >=0.1.20.","cause":"The method was renamed to `get_balance_v2` in testnet-v0.1.20.","error":"AttributeError: 'SomaClient' object has no attribute 'get_balance'"},{"fix":"Set the `SOMA_AUTH_TOKEN` environment variable or pass `headers` to SomaClient.","cause":"Missing or invalid auth token when connecting to a private node.","error":"somasdk.exceptions.UnauthorizedError: 401 Client Error: Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}