# gozargah_node_bridge_py
Library to connect and use https://github.com/M03ED/gozargah-node
# Usage
```shell
pip install gozargah-node-bridge
```
Library is fully async for both `gRPC` and `REST API` connection.
# Example
```python
import GozargahNodeBridge as Bridge
# or
import GozargahNodeBridge as GNB
```
## Creating Node
```python
node = Bridge.create_node(
connection=Bridge.NodeType.GRPC, # GRPC or REST
address=address, # Node ip address or domain
port=port,
client_cert=client_cert_content, # client side ssl certificate as string
client_key=client_key_content, # client side ssl key as string
server_ca=server_ca_content, # server side ssl key as string
extra={}, # a dictionary to hold node data on production, optional, default: None
)
```
## Proto Structure
If you need to have access proto structure you can use:
```python
from GozargahNodeBridge.common import service_pb2 as service
```
## Create User
```python
user = Bridge.create_user(
email="jeff",
proxies=Bridge.create_proxy(
vmess_id="0d59268a-9847-4218-ae09-65308eb52e08", # UUID converted to str
vless_id="0d59268a-9847-4218-ae09-65308eb52e08", # UUID converted to str
vless_flow="", # Valid vless flow if is set for user (str)
trojan_password="", # Trojan password (str)
shadowsocks_password="", # Shadowsocks password (str)
shadowsocks_method="", # Valid shadowsocks method supported by backend
),
inbounds=[] # List of outbound tag, List[str]
)
```
## Methods
Before use any method you need to call start method and connect to node unless you will face `NodeAPIError` for every method
```python
await node.start(
config=config, # backend config as string
backend_type=0, # backend type , XRAY = 0
users=[], # list of users you want to add to this node, will be recheck in node with config
timeout=20,
)
```
### Get User Stats
```python
stats = await node.get_user_stats(
email="noreply@donate.gozargah.pro",
reset=True,
timeout=10,
)
```
### Health
Return a `Bridge.Health`
```python
health = await node.get_health()
```
### Logs
Return a `asyncio.Queue[str]`
```python
logs = await node.get_logs()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "gozargah-node-bridge",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "Gozargah, Gozargah-Node, Marzban, Marzban API, Marzban python",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d5/43/38292d0add3ae73b41ee2b941d736924d394b13509cc947ac6c9fa5aaecf/gozargah_node_bridge-0.0.43.tar.gz",
"platform": null,
"description": "# gozargah_node_bridge_py\nLibrary to connect and use https://github.com/M03ED/gozargah-node\n\n# Usage\n```shell\npip install gozargah-node-bridge\n```\nLibrary is fully async for both `gRPC` and `REST API` connection.\n\n# Example\n```python\nimport GozargahNodeBridge as Bridge\n# or\nimport GozargahNodeBridge as GNB\n```\n\n## Creating Node\n```python\nnode = Bridge.create_node(\n connection=Bridge.NodeType.GRPC, # GRPC or REST\n address=address, # Node ip address or domain\n port=port, \n client_cert=client_cert_content, # client side ssl certificate as string\n client_key=client_key_content, # client side ssl key as string\n server_ca=server_ca_content, # server side ssl key as string\n extra={}, # a dictionary to hold node data on production, optional, default: None\n )\n```\n\n## Proto Structure\nIf you need to have access proto structure you can use:\n```python\nfrom GozargahNodeBridge.common import service_pb2 as service\n```\n\n## Create User\n```python\nuser = Bridge.create_user(\n email=\"jeff\", \n proxies=Bridge.create_proxy(\n vmess_id=\"0d59268a-9847-4218-ae09-65308eb52e08\", # UUID converted to str\n vless_id=\"0d59268a-9847-4218-ae09-65308eb52e08\", # UUID converted to str\n vless_flow=\"\", # Valid vless flow if is set for user (str)\n trojan_password=\"\", # Trojan password (str)\n shadowsocks_password=\"\", # Shadowsocks password (str)\n shadowsocks_method=\"\", # Valid shadowsocks method supported by backend\n ), \n inbounds=[] # List of outbound tag, List[str]\n )\n```\n\n## Methods\nBefore use any method you need to call start method and connect to node unless you will face `NodeAPIError` for every method\n```python\nawait node.start(\n config=config, # backend config as string \n backend_type=0, # backend type , XRAY = 0\n users=[], # list of users you want to add to this node, will be recheck in node with config\n timeout=20,\n )\n```\n\n### Get User Stats\n```python\nstats = await node.get_user_stats(\n email=\"noreply@donate.gozargah.pro\",\n reset=True,\n timeout=10,\n )\n```\n\n### Health\nReturn a `Bridge.Health`\n```python\nhealth = await node.get_health()\n```\n\n### Logs\nReturn a `asyncio.Queue[str]` \n```python\nlogs = await node.get_logs()\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "python package to connect your project with gozargah node go",
"version": "0.0.43",
"project_urls": {
"Homepage": "https://github.com/m03ed/gozargah_node_bridge_py",
"Repository": "https://github.com/m03ed/gozargah_node_bridge_py.git"
},
"split_keywords": [
"gozargah",
" gozargah-node",
" marzban",
" marzban api",
" marzban python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2ff5eae705861026f48b47b4d747324d6d0d572036a08fc3db57dc57d7cd8527",
"md5": "039dd037ddec0d7da6f8593523ae5c5f",
"sha256": "1422a167e1bf7dce0778ebfd5381179412a6a35ec3cf3d9a817ff4ae821e9e99"
},
"downloads": -1,
"filename": "gozargah_node_bridge-0.0.43-py3-none-any.whl",
"has_sig": false,
"md5_digest": "039dd037ddec0d7da6f8593523ae5c5f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 29837,
"upload_time": "2025-07-30T22:33:28",
"upload_time_iso_8601": "2025-07-30T22:33:28.878112Z",
"url": "https://files.pythonhosted.org/packages/2f/f5/eae705861026f48b47b4d747324d6d0d572036a08fc3db57dc57d7cd8527/gozargah_node_bridge-0.0.43-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d54338292d0add3ae73b41ee2b941d736924d394b13509cc947ac6c9fa5aaecf",
"md5": "901e0d00dfa9ee21498e62c910169ec4",
"sha256": "3afa6722114c390a3bd35b054343d4d9c9f36b2d5b37b58db03c139365b9276a"
},
"downloads": -1,
"filename": "gozargah_node_bridge-0.0.43.tar.gz",
"has_sig": false,
"md5_digest": "901e0d00dfa9ee21498e62c910169ec4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 41942,
"upload_time": "2025-07-30T22:33:30",
"upload_time_iso_8601": "2025-07-30T22:33:30.066134Z",
"url": "https://files.pythonhosted.org/packages/d5/43/38292d0add3ae73b41ee2b941d736924d394b13509cc947ac6c9fa5aaecf/gozargah_node_bridge-0.0.43.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-30 22:33:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "m03ed",
"github_project": "gozargah_node_bridge_py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gozargah-node-bridge"
}