{"id":20779563,"url":"https://github.com/convex-dev/convex-api-py","last_synced_at":"2026-04-18T04:02:14.784Z","repository":{"id":54553037,"uuid":"290457088","full_name":"Convex-Dev/convex-api-py","owner":"Convex-Dev","description":"Convex API Python","archived":false,"fork":false,"pushed_at":"2026-01-02T16:12:37.000Z","size":6700,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-01-06T17:54:48.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Convex-Dev.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-08-26T09:45:03.000Z","updated_at":"2026-01-02T09:56:52.000Z","dependencies_parsed_at":"2025-01-18T08:41:21.736Z","dependency_job_id":"90543100-6181-45d7-bb80-2e1888d918f7","html_url":"https://github.com/Convex-Dev/convex-api-py","commit_stats":{"total_commits":230,"total_committers":1,"mean_commits":230.0,"dds":0.0,"last_synced_commit":"817ea6aa2675b009cb0c1f421e75b4e357d81805"},"previous_names":["dex-company/convex-api-py"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/Convex-Dev/convex-api-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fconvex-api-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fconvex-api-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fconvex-api-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fconvex-api-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Convex-Dev","download_url":"https://codeload.github.com/Convex-Dev/convex-api-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fconvex-api-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31955919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-17T13:28:30.630Z","updated_at":"2026-04-18T04:02:14.778Z","avatar_url":"https://github.com/Convex-Dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convex API\n\n![](https://github.com/Convex-Dev/convex-api-py/workflows/testing/badge.svg)\n[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)\n\n[Documentation](https://convex-dev.github.io/convex-api-py)\n\n### Development Setup\n\nTo set up the project for development, follow these steps:\n\n**Prerequisites:**\n- Python 3.10 or higher\n- pip (Python package installer)\n\n**Setup Steps:**\n\n1. **Create a virtual environment:**\n   ```bash\n   python -m venv .venv\n   ```\n   \n   This creates a virtual environment in a `.venv` directory. \n\n2. **Activate the virtual environment:**\n   \n   - **On Windows (PowerShell or Command Prompt):**\n     ```bash\n     .venv\\Scripts\\activate\n     ```\n   \n   - **On Windows (Git Bash):**\n     ```bash\n     source .venv/Scripts/activate\n     ```\n   \n   - **On Linux/Mac:**\n     ```bash\n     source .venv/bin/activate\n     ```\n   \n   When activated, you should see `(venv)` at the beginning of your command prompt.\n\n3. **Upgrade pip (recommended):**\n   ```bash\n   python -m pip install --upgrade pip\n   ```\n\n4. **Install the package in development mode with all dependencies:**\n   \n   Option 1 - Using setup.py extras (recommended):\n   ```bash\n   pip install -e \".[dev,test,docs]\"\n   ```\n   \n   Option 2 - Using requirements files:\n   ```bash\n   pip install -r requirements-dev.txt\n   pip install -e .\n   ```\n\n5. **Verify the installation:**\n   ```bash\n   pytest tests\n   ```\n\n**Deactivating the virtual environment:**\nWhen you're done working, you can deactivate the virtual environment by running:\n```bash\ndeactivate\n```\n\n**Note:** Always activate your virtual environment before working on the project. The virtual environment ensures that dependencies are isolated from your system Python installation.\n\n### Quick Start\n\nFirst you need to download the Convex-API-py package from the python package index PyPi.\n\n    pip install convex-api\n\nYou can now access the convex network, and get a balance from an existing account on the network by doing the following:\n\n    \u003e\u003e\u003e from convex_api import API\n    \u003e\u003e\u003e convex = API('https://peer.convex.live')\n    \u003e\u003e\u003e convex.get_balance(9)\n    99396961137042\n\nYou can create a new emtpy account, with now balance:\n\n    \u003e\u003e\u003e key_pair = KeyPair.create()\n    \u003e\u003e\u003e account = convex.create_account(key_pair)\n    \u003e\u003e\u003e account.address\n    809\n\nYou can request some funds to the new account and then get the account information:\n\n    \u003e\u003e\u003e convex_api.request_funds(1000000, account)\n    1000000\n    \u003e\u003e\u003e convex.get_account_info(account)\n    {'environment': {}, 'address': 809, 'is_library': False, 'is_actor': False, 'memory_size': 42, 'balance': 1000000, 'allowance': 0, 'sequence': 0, 'type': 'user'}\n\n\nYou can export the accounts private key encoded as PKCS8 encrypt the key with a password:\n\n    \u003e\u003e\u003e account.key_pair.export_to_text('secret')\n    '-----BEGIN ENCRYPTED PRIVATE KEY-----\\nMIGbMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAiMY42UY4PXHAICCAAw\\nDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEJpwDMicGbGj2iSJesktIVYEQBsp\\nKMTAHzvUyw8jZRr8WSrmxH7938sjma8XWI6lgd9jwTZzcGamog7p3zatw0Wp+jFK\\nKruWAZmIqhBZ/2ezDv8=\\n-----END ENCRYPTED PRIVATE KEY-----\\n'\n\n    \u003e\u003e\u003e account.address\n    809\n\nTo re-use your account again you need to import the encrypted private key and set the correct account address\n\n    \u003e\u003e\u003e from api import Account, KeyPair\n    \u003e\u003e\u003e key_pair = KeyPair.import_from_file('my_key.dat', 'secret')\n    \u003e\u003e\u003e account = Account.create(key_pair, 809)\n\nTo create a new address with the same account keys in your new or imported account object, you can do:\n\n    \u003e\u003e\u003e new_account = convex.create_account(key_pair)\n    \u003e\u003e\u003e account.address\n    809\n    \u003e\u003e\u003e new_account.address\n    934\n\nTo use account names, where an account name is resolved to a fixed address. You can create or load\nan account based on it's name by doing the following:\n\n    \u003e\u003e\u003e account = convex.setup_account('my-account-name', key_pair)\n    \u003e\u003e\u003e account.address\n    934\n\n    \u003e\u003e\u003e convex.resolve_account_name('my-account-name')\n    934\n\n    \u003e\u003e\u003e same_account = convex.setup_account('my-account-name', key_pair)\n    \u003e\u003e\u003e same_account.address\n    934\n\nTo submit a transaction, use ConvexAPI.send(). This will cost a small about of juice, and reduce your balance\n\n    \u003e\u003e\u003e convex.request_funds(1000000, account)\n    1000000\n    \u003e\u003e\u003e convex.send('(map inc [1 2 3 4])', account)\n    {'value': [2, 3, 4, 5]}\n    \u003e\u003e\u003e convex.get_balance(account)\n    996360\n\nTo send a query a transaction, this is free and can be performed by any valid account address.\nSo for example to query a balance of an account:\n\n    \u003e\u003e\u003e convex.query(f'(balance {account.address})', account)\n    {'value': 996360}\n\n    # this is the same as above\n    \u003e\u003e\u003e convex.query(f'(balance {account.address})', account.address)\n    {'value': 996360}\n\n    # get the balance using one of the standard account addresses (#1)\n    \u003e\u003e\u003e convex.query(f'(balance {account.address})', 1)\n    {'value': 996360}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvex-dev%2Fconvex-api-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconvex-dev%2Fconvex-api-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvex-dev%2Fconvex-api-py/lists"}