# Circle Web3 APIs Python SDK
The Circle Web3 Python SDK provides convenient access to the Circle Web3 APIs for
applications written in Python. For the API reference, see the [Circle Web3 API Docs](https://developers.circle.com/w3s/reference/getping).
Also see this project's [PyPI Package Page [TODO]]().
## Requirements
Python 3.7+.
Java 11 and Node 10+ (optional for contributing and development).
## Installation
The recommended way of installation is using the Python Package Index (PyPI):
```sh
pip install circle-developer-controlled-wallets
pip install circle-smart-contract-platform
pip install circle-user-controlled-wallets
```
## Development
Clone this repo and install development dependencies using
```sh
# For codegen tools and git hook checks
yarn install
```
Initialize the submodules:
```bash
git submodule init
```
Build the OpenAPI specifications:
```bash
cd w3s-openapi-internal
make build
cd ..
```
Run the codegen command to generate the source code for this SDK from
the `w3s-openapi-internal` OpenAPI specifications
```sh
# Executes .openapi-generator/gen-sdk.sh
yarn gen-sdk
```
## Usage
Initialize circle web3 API clients. To secure your entity secret and circle API key. Set the API key and entity secret as environment variables. Learn more about entity secret management [here](https://developers.circle.com/w3s/docs/entity-secret-management)
```shell
export CIRCLE_ENTITY_SECRET="Your entity secret"
export CIRCLE_WEB3_API_KEY="Your API KEY"
```
```python
from circle.web3 import utils
dcw_client = utils.init_developer_controlled_wallets_client(api_key="Your API KEY", entity_secret="Your entity secret")
scp_client = utils.init_smart_contract_platform_client(api_key="Your API KEY", entity_secret="Your entity secret")
ucw_client = utils.init_user_controlled_wallets_client(api_key="Your API KEY")
```
Using client to make a transaction.
```python
from circle.web3 import user_controlled_wallets
# Create a API instance
ucw_client = utils.init_user_controlled_wallets_client(api_key="<your-api-key>")
api_instance = user_controlled_wallets.PINAuthenticationApi(ucw_client)
try:
api_request = user_controlled_wallets.UserTokenRequest.from_dict({"userId": "test-user"})
api_response = api_instance.get_user_token(api_request)
print(api_response.data.user_token)
except user_controlled_wallets.ApiException as e:
print("Exception when calling PINAuthenticationApi->get_user_token: %s\n" % e)
```
## Contributions
Please follow the [Conventional Commits][convencomms] format for all commits when creating a contributing pull request for this repo.
[convencomms]: https://www.conventionalcommits.org/en/v1.0.0/
Raw data
{
"_id": null,
"home_page": "https://github.com/circlefin/circle-web3-python-sdk",
"name": "circle-web3-sdk-util",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.7",
"maintainer_email": null,
"keywords": "Circle, Web3, Python, Developer Controlled Wallets, User Controlled Wallets, Smart Contract Platform",
"author": "Circle Technology Inc",
"author_email": "bohan.li@circle.com",
"download_url": "https://files.pythonhosted.org/packages/28/11/27e009707ea532c488f2a74c8d1f0f468dce2611bf4c2e761d42366bb7c6/circle_web3_sdk_util-4.0.0.tar.gz",
"platform": null,
"description": "# Circle Web3 APIs Python SDK\n\nThe Circle Web3 Python SDK provides convenient access to the Circle Web3 APIs for\napplications written in Python. For the API reference, see the [Circle Web3 API Docs](https://developers.circle.com/w3s/reference/getping). \nAlso see this project's [PyPI Package Page [TODO]]().\n\n## Requirements\n\nPython 3.7+.\n\nJava 11 and Node 10+ (optional for contributing and development).\n\n## Installation\n\nThe recommended way of installation is using the Python Package Index (PyPI):\n```sh\npip install circle-developer-controlled-wallets\npip install circle-smart-contract-platform\npip install circle-user-controlled-wallets\n```\n\n## Development\nClone this repo and install development dependencies using\n\n```sh\n# For codegen tools and git hook checks\nyarn install\n```\n\nInitialize the submodules:\n```bash\ngit submodule init\n```\n\nBuild the OpenAPI specifications:\n```bash\ncd w3s-openapi-internal\nmake build\ncd ..\n```\n\nRun the codegen command to generate the source code for this SDK from \nthe `w3s-openapi-internal` OpenAPI specifications\n```sh\n# Executes .openapi-generator/gen-sdk.sh\nyarn gen-sdk\n```\n\n## Usage\n\nInitialize circle web3 API clients. To secure your entity secret and circle API key. Set the API key and entity secret as environment variables. Learn more about entity secret management [here](https://developers.circle.com/w3s/docs/entity-secret-management)\n\n```shell\nexport CIRCLE_ENTITY_SECRET=\"Your entity secret\"\nexport CIRCLE_WEB3_API_KEY=\"Your API KEY\"\n```\n\n```python\nfrom circle.web3 import utils\n\ndcw_client = utils.init_developer_controlled_wallets_client(api_key=\"Your API KEY\", entity_secret=\"Your entity secret\")\nscp_client = utils.init_smart_contract_platform_client(api_key=\"Your API KEY\", entity_secret=\"Your entity secret\")\nucw_client = utils.init_user_controlled_wallets_client(api_key=\"Your API KEY\")\n```\n\nUsing client to make a transaction.\n\n```python\nfrom circle.web3 import user_controlled_wallets\n\n# Create a API instance\nucw_client = utils.init_user_controlled_wallets_client(api_key=\"<your-api-key>\")\n\napi_instance = user_controlled_wallets.PINAuthenticationApi(ucw_client)\ntry:\n api_request = user_controlled_wallets.UserTokenRequest.from_dict({\"userId\": \"test-user\"})\n api_response = api_instance.get_user_token(api_request)\n print(api_response.data.user_token)\nexcept user_controlled_wallets.ApiException as e:\n print(\"Exception when calling PINAuthenticationApi->get_user_token: %s\\n\" % e)\n```\n\n## Contributions\n\nPlease follow the [Conventional Commits][convencomms] format for all commits when creating a contributing pull request for this repo.\n\n[convencomms]: https://www.conventionalcommits.org/en/v1.0.0/\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "The Python SDK Utility for Circle Web3 Services",
"version": "4.0.0",
"project_urls": {
"Developer Doc": "https://developers.circle.com/w3s/",
"Homepage": "https://github.com/circlefin/circle-web3-python-sdk",
"Source": "https://github.com/circlefin/circle-web3-python-sdk"
},
"split_keywords": [
"circle",
" web3",
" python",
" developer controlled wallets",
" user controlled wallets",
" smart contract platform"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a4accc342e6cae698814404db7e7cd48dccdc73ded60c584d24333e54b4cb600",
"md5": "3dc79a35898540fded8d64991047adb3",
"sha256": "704c14b1b637dd4c15fc580a7d4ed813307e2054d7df2a8347cbeed925d57665"
},
"downloads": -1,
"filename": "circle_web3_sdk_util-4.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3dc79a35898540fded8d64991047adb3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.7",
"size": 9483,
"upload_time": "2024-12-03T17:34:30",
"upload_time_iso_8601": "2024-12-03T17:34:30.196871Z",
"url": "https://files.pythonhosted.org/packages/a4/ac/cc342e6cae698814404db7e7cd48dccdc73ded60c584d24333e54b4cb600/circle_web3_sdk_util-4.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "281127e009707ea532c488f2a74c8d1f0f468dce2611bf4c2e761d42366bb7c6",
"md5": "13aaef2e167504e2d63f990ce6d02b0e",
"sha256": "381214231418a563d8d52588ce145eb2fcba7f941dcd02fadad9fed962caa430"
},
"downloads": -1,
"filename": "circle_web3_sdk_util-4.0.0.tar.gz",
"has_sig": false,
"md5_digest": "13aaef2e167504e2d63f990ce6d02b0e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.7",
"size": 8962,
"upload_time": "2024-12-03T17:34:31",
"upload_time_iso_8601": "2024-12-03T17:34:31.706002Z",
"url": "https://files.pythonhosted.org/packages/28/11/27e009707ea532c488f2a74c8d1f0f468dce2611bf4c2e761d42366bb7c6/circle_web3_sdk_util-4.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 17:34:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "circlefin",
"github_project": "circle-web3-python-sdk",
"github_not_found": true,
"lcname": "circle-web3-sdk-util"
}