marzban 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- marzban/__init__.py +4 -0
- marzban/clients.py +257 -0
- marzban/models.py +197 -0
- marzban-0.1.2.dist-info/LICENSE +21 -0
- marzban-0.1.2.dist-info/METADATA +30 -0
- marzban-0.1.2.dist-info/RECORD +8 -0
- marzban-0.1.2.dist-info/WHEEL +5 -0
- marzban-0.1.2.dist-info/top_level.txt +1 -0
marzban/__init__.py
ADDED
marzban/clients.py
ADDED
@@ -0,0 +1,257 @@
|
|
1
|
+
import httpx
|
2
|
+
from typing import Any, Dict, Optional, List
|
3
|
+
from .models import *
|
4
|
+
|
5
|
+
class MarzbanAPI:
|
6
|
+
def __init__(self, base_url: str):
|
7
|
+
self.base_url = base_url
|
8
|
+
self.client = httpx.AsyncClient(base_url=base_url)
|
9
|
+
|
10
|
+
def _get_headers(self, token: str) -> Dict[str, str]:
|
11
|
+
return {"Authorization": f"Bearer {token}"}
|
12
|
+
|
13
|
+
async def get_token(self, username: str, password: str) -> Token:
|
14
|
+
url = "/api/admin/token"
|
15
|
+
payload = {
|
16
|
+
"grant_type": "password",
|
17
|
+
"username": username,
|
18
|
+
"password": password,
|
19
|
+
"scope": "",
|
20
|
+
"client_id": "",
|
21
|
+
"client_secret": ""
|
22
|
+
}
|
23
|
+
response = await self.client.post(url, data=payload)
|
24
|
+
response.raise_for_status()
|
25
|
+
return Token(**response.json())
|
26
|
+
|
27
|
+
async def get_current_admin(self, token: str) -> Admin:
|
28
|
+
url = "/api/admin"
|
29
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
30
|
+
response.raise_for_status()
|
31
|
+
return Admin(**response.json())
|
32
|
+
|
33
|
+
async def create_admin(self, admin: AdminCreate, token: str) -> Admin:
|
34
|
+
url = "/api/admin"
|
35
|
+
response = await self.client.post(url, json=admin.dict(), headers=self._get_headers(token))
|
36
|
+
response.raise_for_status()
|
37
|
+
return Admin(**response.json())
|
38
|
+
|
39
|
+
async def modify_admin(self, username: str, admin: AdminModify, token: str) -> Admin:
|
40
|
+
url = f"/api/admin/{username}"
|
41
|
+
response = await self.client.put(url, json=admin.dict(), headers=self._get_headers(token))
|
42
|
+
response.raise_for_status()
|
43
|
+
return Admin(**response.json())
|
44
|
+
|
45
|
+
async def remove_admin(self, username: str, token: str) -> None:
|
46
|
+
url = f"/api/admin/{username}"
|
47
|
+
response = await self.client.delete(url, headers=self._get_headers(token))
|
48
|
+
response.raise_for_status()
|
49
|
+
|
50
|
+
async def get_admins(self, token: str, offset: Optional[int] = None, limit: Optional[int] = None, username: Optional[str] = None) -> List[Admin]:
|
51
|
+
url = "/api/admins"
|
52
|
+
params = {"offset": offset, "limit": limit, "username": username}
|
53
|
+
response = await self.client.get(url, headers=self._get_headers(token), params=params)
|
54
|
+
response.raise_for_status()
|
55
|
+
return [Admin(**admin) for admin in response.json()]
|
56
|
+
|
57
|
+
async def get_system_stats(self, token: str) -> SystemStats:
|
58
|
+
url = "/api/system"
|
59
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
60
|
+
response.raise_for_status()
|
61
|
+
return SystemStats(**response.json())
|
62
|
+
|
63
|
+
async def get_inbounds(self, token: str) -> Dict[str, List[ProxyInbound]]:
|
64
|
+
url = "/api/inbounds"
|
65
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
66
|
+
response.raise_for_status()
|
67
|
+
return response.json()
|
68
|
+
|
69
|
+
async def get_hosts(self, token: str) -> Dict [str, List[ProxyHost]]:
|
70
|
+
url = "/api/hosts"
|
71
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
72
|
+
response.raise_for_status()
|
73
|
+
return response.json()
|
74
|
+
|
75
|
+
async def modify_hosts(self, hosts: Dict[str, List[ProxyHost]], token: str) -> Dict[str, List[ProxyHost]]:
|
76
|
+
url = "/api/hosts"
|
77
|
+
response = await self.client.put(url, json=hosts, headers=self._get_headers(token))
|
78
|
+
response.raise_for_status()
|
79
|
+
return response.json()
|
80
|
+
|
81
|
+
async def get_core_stats(self, token: str) -> CoreStats:
|
82
|
+
url = "/api/core"
|
83
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
84
|
+
response.raise_for_status()
|
85
|
+
return CoreStats(**response.json())
|
86
|
+
|
87
|
+
async def restart_core(self, token: str) -> None:
|
88
|
+
url = "/api/core/restart"
|
89
|
+
response = await self.client.post(url, headers=self._get_headers(token))
|
90
|
+
response.raise_for_status()
|
91
|
+
|
92
|
+
async def get_core_config(self, token: str) -> Dict[str, Any]:
|
93
|
+
url = "/api/core/config"
|
94
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
95
|
+
response.raise_for_status()
|
96
|
+
return response.json()
|
97
|
+
|
98
|
+
async def modify_core_config(self, config: Dict[str, Any], token: str) -> Dict[str, Any]:
|
99
|
+
url = "/api/core/config"
|
100
|
+
response = await self.client.put(url, json=config, headers=self._get_headers(token))
|
101
|
+
response.raise_for_status()
|
102
|
+
return response.json()
|
103
|
+
|
104
|
+
async def add_user(self, user: UserCreate, token: str) -> UserResponse:
|
105
|
+
url = "/api/user"
|
106
|
+
response = await self.client.post(url, json=user.dict(), headers=self._get_headers(token))
|
107
|
+
response.raise_for_status()
|
108
|
+
return UserResponse(**response.json())
|
109
|
+
|
110
|
+
async def get_user(self, username: str, token: str) -> UserResponse:
|
111
|
+
url = f"/api/user/{username}"
|
112
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
113
|
+
response.raise_for_status()
|
114
|
+
return UserResponse(**response.json())
|
115
|
+
|
116
|
+
async def modify_user(self, username: str, user: UserModify, token: str) -> UserResponse:
|
117
|
+
url = f"/api/user/{username}"
|
118
|
+
response = await self.client.put(url, json=user.dict(), headers=self._get_headers(token))
|
119
|
+
response.raise_for_status()
|
120
|
+
return UserResponse(**response.json())
|
121
|
+
|
122
|
+
async def remove_user(self, username: str, token: str) -> None:
|
123
|
+
url = f"/api/user/{username}"
|
124
|
+
response = await self.client.delete(url, headers=self._get_headers(token))
|
125
|
+
response.raise_for_status()
|
126
|
+
|
127
|
+
async def reset_user_data_usage(self, username: str, token: str) -> UserResponse:
|
128
|
+
url = f"/api/user/{username}/reset"
|
129
|
+
response = await self.client.post(url, headers=self._get_headers(token))
|
130
|
+
response.raise_for_status()
|
131
|
+
return UserResponse(**response.json())
|
132
|
+
|
133
|
+
async def revoke_user_subscription(self, username: str, token: str) -> UserResponse:
|
134
|
+
url = f"/api/user/{username}/revoke_sub"
|
135
|
+
response = await self.client.post(url, headers=self._get_headers(token))
|
136
|
+
response.raise_for_status()
|
137
|
+
return UserResponse(**response.json())
|
138
|
+
|
139
|
+
async def get_users(self, token: str, offset: Optional[int] = None, limit: Optional[int] = None, username: Optional[List[str]] = None, status: Optional[str] = None, sort: Optional[str] = None) -> UsersResponse:
|
140
|
+
url = "/api/users"
|
141
|
+
params = {"offset": offset, "limit": limit, "username": username, "status": status, "sort": sort}
|
142
|
+
response = await self.client.get(url, headers=self._get_headers(token), params=params)
|
143
|
+
response.raise_for_status()
|
144
|
+
return UsersResponse(**response.json())
|
145
|
+
|
146
|
+
async def reset_users_data_usage(self, token: str) -> None:
|
147
|
+
url = "/api/users/reset"
|
148
|
+
response = await self.client.post(url, headers=self._get_headers(token))
|
149
|
+
response.raise_for_status()
|
150
|
+
|
151
|
+
async def get_user_usage(self, username: str, token: str, start: Optional[str] = None, end: Optional[str] = None) -> UserUsagesResponse:
|
152
|
+
url = f"/api/user/{username}/usage"
|
153
|
+
params = {"start": start, "end": end}
|
154
|
+
response = await self.client.get(url, headers=self._get_headers(token), params=params)
|
155
|
+
response.raise_for_status()
|
156
|
+
return UserUsagesResponse(**response.json())
|
157
|
+
|
158
|
+
async def set_owner(self, username: str, admin_username: str, token: str) -> UserResponse:
|
159
|
+
url = f"/api/user/{username}/set-owner"
|
160
|
+
params = {"admin_username": admin_username}
|
161
|
+
response = await self.client.put(url, headers=self._get_headers(token), params=params)
|
162
|
+
response.raise_for_status()
|
163
|
+
return UserResponse(**response.json())
|
164
|
+
|
165
|
+
async def get_expired_users(self, token: str, expired_before: Optional[str] = None, expired_after: Optional[str] = None) -> List[str]:
|
166
|
+
url = "/api/users/expired"
|
167
|
+
params = {"expired_before": expired_before, "expired_after": expired_after}
|
168
|
+
response = await self.client.get(url, headers=self._get_headers(token), params=params)
|
169
|
+
response.raise_for_status()
|
170
|
+
return response.json()
|
171
|
+
|
172
|
+
async def delete_expired_users(self, token: str, expired_before: Optional[str] = None, expired_after: Optional[str] = None) -> List[str]:
|
173
|
+
url = "/api/users/expired"
|
174
|
+
params = {"expired_before": expired_before, "expired_after": expired_after}
|
175
|
+
response = await self.client.delete(url, headers=self._get_headers(token), params=params)
|
176
|
+
response.raise_for_status()
|
177
|
+
return response.json()
|
178
|
+
|
179
|
+
async def get_user_templates(self, token: str, offset: Optional[int] = None, limit: Optional[int] = None) -> List[UserTemplateResponse]:
|
180
|
+
url = "/api/user_template"
|
181
|
+
params = {"offset": offset, "limit": limit}
|
182
|
+
response = await self.client.get(url, headers=self._get_headers(token), params=params)
|
183
|
+
response.raise_for_status()
|
184
|
+
return [UserTemplateResponse(**template) for template in response.json()]
|
185
|
+
|
186
|
+
async def add_user_template(self, template: UserTemplateCreate, token: str) -> UserTemplateResponse:
|
187
|
+
url = "/api/user_template"
|
188
|
+
response = await self.client.post(url, json=template.dict(), headers=self._get_headers(token))
|
189
|
+
response.raise_for_status()
|
190
|
+
return UserTemplateResponse(**response.json())
|
191
|
+
|
192
|
+
async def get_user_template(self, template_id: int, token: str) -> UserTemplateResponse:
|
193
|
+
url = f"/api/user_template/{template_id}"
|
194
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
195
|
+
response.raise_for_status()
|
196
|
+
return UserTemplateResponse(**response.json())
|
197
|
+
|
198
|
+
async def modify_user_template(self, template_id: int, template: UserTemplateModify, token: str) -> UserTemplateResponse:
|
199
|
+
url = f"/api/user_template/{template_id}"
|
200
|
+
response = await self.client.put(url, json=template.dict(), headers=self._get_headers(token))
|
201
|
+
response.raise_for_status()
|
202
|
+
return UserTemplateResponse(**response.json())
|
203
|
+
|
204
|
+
async def remove_user_template(self, template_id: int, token: str) -> None:
|
205
|
+
url = f"/api/user_template/{template_id}"
|
206
|
+
response = await self.client.delete(url, headers=self._get_headers(token))
|
207
|
+
response.raise_for_status()
|
208
|
+
|
209
|
+
async def get_node_settings(self, token: str) -> Dict[str, Any]:
|
210
|
+
url = "/api/node/settings"
|
211
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
212
|
+
response.raise_for_status()
|
213
|
+
return response.json()
|
214
|
+
|
215
|
+
async def add_node(self, node: NodeCreate, token: str) -> NodeResponse:
|
216
|
+
url = "/api/node"
|
217
|
+
response = await self.client.post(url, json=node.dict(), headers=self._get_headers(token))
|
218
|
+
response.raise_for_status()
|
219
|
+
return NodeResponse(**response.json())
|
220
|
+
|
221
|
+
async def get_node(self, node_id: int, token: str) -> NodeResponse:
|
222
|
+
url = f"/api/node/{node_id}"
|
223
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
224
|
+
response.raise_for_status()
|
225
|
+
return NodeResponse(**response.json())
|
226
|
+
|
227
|
+
async def modify_node(self, node_id: int, node: NodeModify, token: str) -> NodeResponse:
|
228
|
+
url = f"/api/node/{node_id}"
|
229
|
+
response = await self.client.put(url, json=node.dict(), headers=self._get_headers(token))
|
230
|
+
response.raise_for_status()
|
231
|
+
return NodeResponse(**response.json())
|
232
|
+
|
233
|
+
async def remove_node(self, node_id: int, token: str) -> None:
|
234
|
+
url = f"/api/node/{node_id}"
|
235
|
+
response = await self.client.delete(url, headers=self._get_headers(token))
|
236
|
+
response.raise_for_status()
|
237
|
+
|
238
|
+
async def reconnect_node(self, node_id: int, token: str) -> None:
|
239
|
+
url = f"/api/node/{node_id}/reconnect"
|
240
|
+
response = await self.client.post(url, headers=self._get_headers(token))
|
241
|
+
response.raise_for_status()
|
242
|
+
|
243
|
+
async def get_nodes(self, token: str) -> List[NodeResponse]:
|
244
|
+
url = "/api/nodes"
|
245
|
+
response = await self.client.get(url, headers=self._get_headers(token))
|
246
|
+
response.raise_for_status()
|
247
|
+
return [NodeResponse(**node) for node in response.json()]
|
248
|
+
|
249
|
+
async def get_usage(self, token: str, start: Optional[str] = None, end: Optional[str] = None) -> NodesUsageResponse:
|
250
|
+
url = "/api/nodes/usage"
|
251
|
+
params = {"start": start, "end": end}
|
252
|
+
response = await self.client.get(url, headers=self._get_headers(token), params=params)
|
253
|
+
response.raise_for_status()
|
254
|
+
return NodesUsageResponse(**response.json())
|
255
|
+
|
256
|
+
async def close(self):
|
257
|
+
await self.client.aclose()
|
marzban/models.py
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
from typing import Optional, List, Dict, Any
|
3
|
+
|
4
|
+
class Token(BaseModel):
|
5
|
+
access_token: str
|
6
|
+
token_type: str = "bearer"
|
7
|
+
|
8
|
+
class Admin(BaseModel):
|
9
|
+
username: str
|
10
|
+
is_sudo: bool
|
11
|
+
telegram_id: Optional[int]
|
12
|
+
discord_webhook: Optional[str]
|
13
|
+
|
14
|
+
class AdminCreate(Admin):
|
15
|
+
password: str
|
16
|
+
|
17
|
+
class AdminModify(BaseModel):
|
18
|
+
is_sudo: bool
|
19
|
+
password: Optional[str]
|
20
|
+
telegram_id: Optional[int]
|
21
|
+
discord_webhook: Optional[str]
|
22
|
+
|
23
|
+
class HTTPValidationError(BaseModel):
|
24
|
+
detail: Optional[List[Dict[str, Any]]]
|
25
|
+
|
26
|
+
class SystemStats(BaseModel):
|
27
|
+
version: str
|
28
|
+
mem_total: int
|
29
|
+
mem_used: int
|
30
|
+
cpu_cores: int
|
31
|
+
cpu_usage: float
|
32
|
+
total_user: int
|
33
|
+
users_active: int
|
34
|
+
incoming_bandwidth: int
|
35
|
+
outgoing_bandwidth: int
|
36
|
+
incoming_bandwidth_speed: int
|
37
|
+
outgoing_bandwidth_speed: int
|
38
|
+
|
39
|
+
class ProxySettings(BaseModel):
|
40
|
+
pass
|
41
|
+
|
42
|
+
class UserCreate(BaseModel):
|
43
|
+
username: str
|
44
|
+
proxies: Optional[Dict[str, ProxySettings]] = {}
|
45
|
+
expire: Optional[int] = None
|
46
|
+
data_limit: Optional[int] = 0
|
47
|
+
data_limit_reset_strategy: Optional[str] = "no_reset"
|
48
|
+
inbounds: Optional[Dict[str, List[str]]] = {}
|
49
|
+
note: Optional[str] = None
|
50
|
+
sub_updated_at: Optional[str] = None
|
51
|
+
sub_last_user_agent: Optional[str] = None
|
52
|
+
online_at: Optional[str] = None
|
53
|
+
on_hold_expire_duration: Optional[int] = 0
|
54
|
+
on_hold_timeout: Optional[str] = None
|
55
|
+
status: Optional[str] = "active"
|
56
|
+
|
57
|
+
class UserResponse(BaseModel):
|
58
|
+
username: str
|
59
|
+
proxies: Dict[str, ProxySettings]
|
60
|
+
expire: Optional[int]
|
61
|
+
data_limit: int
|
62
|
+
data_limit_reset_strategy: str
|
63
|
+
inbounds: Dict[str, List[str]]
|
64
|
+
note: Optional[str]
|
65
|
+
sub_updated_at: Optional[str]
|
66
|
+
sub_last_user_agent: Optional[str]
|
67
|
+
online_at: Optional[str]
|
68
|
+
on_hold_expire_duration: Optional[int]
|
69
|
+
on_hold_timeout: Optional[str]
|
70
|
+
status: str
|
71
|
+
used_traffic: int
|
72
|
+
lifetime_used_traffic: int
|
73
|
+
created_at: str
|
74
|
+
links: List[str]
|
75
|
+
subscription_url: str
|
76
|
+
excluded_inbounds: Dict[str, List[str]]
|
77
|
+
|
78
|
+
class NodeCreate(BaseModel):
|
79
|
+
name: str
|
80
|
+
address: str
|
81
|
+
port: int = 62050
|
82
|
+
api_port: int = 62051
|
83
|
+
usage_coefficient: float = 1.0
|
84
|
+
add_as_new_host: bool = True
|
85
|
+
|
86
|
+
class NodeModify(BaseModel):
|
87
|
+
name: Optional[str]
|
88
|
+
address: Optional[str]
|
89
|
+
port: Optional[int]
|
90
|
+
api_port: Optional[int]
|
91
|
+
usage_coefficient: Optional[float]
|
92
|
+
status: Optional[str]
|
93
|
+
|
94
|
+
class NodeResponse(BaseModel):
|
95
|
+
name: str
|
96
|
+
address: str
|
97
|
+
port: int
|
98
|
+
api_port: int
|
99
|
+
usage_coefficient: float
|
100
|
+
id: int
|
101
|
+
xray_version: Optional[str]
|
102
|
+
status: str
|
103
|
+
message: Optional[str]
|
104
|
+
|
105
|
+
class NodeUsageResponse(BaseModel):
|
106
|
+
node_id: int
|
107
|
+
node_name: str
|
108
|
+
uplink: int
|
109
|
+
downlink: int
|
110
|
+
|
111
|
+
class NodesUsageResponse(BaseModel):
|
112
|
+
usages: List[NodeUsageResponse]
|
113
|
+
|
114
|
+
class ProxyHost(BaseModel):
|
115
|
+
remark: str
|
116
|
+
address: str
|
117
|
+
port: Optional[int]
|
118
|
+
sni: Optional[str]
|
119
|
+
host: Optional[str]
|
120
|
+
path: Optional[str]
|
121
|
+
security: str = "inbound_default"
|
122
|
+
alpn: str = ""
|
123
|
+
fingerprint: str = ""
|
124
|
+
allowinsecure: bool
|
125
|
+
is_disabled: bool
|
126
|
+
|
127
|
+
class ProxyInbound(BaseModel):
|
128
|
+
tag: str
|
129
|
+
protocol: str
|
130
|
+
network: str
|
131
|
+
tls: str
|
132
|
+
port: Any
|
133
|
+
|
134
|
+
class CoreStats(BaseModel):
|
135
|
+
version: str
|
136
|
+
started: bool
|
137
|
+
logs_websocket: str
|
138
|
+
|
139
|
+
class UserModify(BaseModel):
|
140
|
+
proxies: Optional[Dict[str, ProxySettings]] = {}
|
141
|
+
expire: Optional[int]
|
142
|
+
data_limit: Optional[int] = 0
|
143
|
+
data_limit_reset_strategy: Optional[str] = "no_reset"
|
144
|
+
inbounds: Optional[Dict[str, List[str]]] = {}
|
145
|
+
note: Optional[str] = None
|
146
|
+
sub_updated_at: Optional[str] = None
|
147
|
+
sub_last_user_agent: Optional[str] = None
|
148
|
+
online_at: Optional[str] = None
|
149
|
+
on_hold_expire_duration: Optional[int] = 0
|
150
|
+
on_hold_timeout: Optional[str] = None
|
151
|
+
status: Optional[str] = "active"
|
152
|
+
|
153
|
+
class UserTemplateCreate(BaseModel):
|
154
|
+
name: Optional[str]
|
155
|
+
data_limit: int = 0
|
156
|
+
expire_duration: int = 0
|
157
|
+
username_prefix: Optional[str]
|
158
|
+
username_suffix: Optional[str]
|
159
|
+
inbounds: Optional[Dict[str, List[str]]] = {}
|
160
|
+
|
161
|
+
class UserTemplateResponse(BaseModel):
|
162
|
+
id: int
|
163
|
+
name: Optional[str]
|
164
|
+
data_limit: int
|
165
|
+
expire_duration: int
|
166
|
+
username_prefix: Optional[str]
|
167
|
+
username_suffix: Optional[str]
|
168
|
+
inbounds: Dict[str, List[str]]
|
169
|
+
|
170
|
+
class UserTemplateModify(BaseModel):
|
171
|
+
name: Optional[str]
|
172
|
+
data_limit: Optional[int]
|
173
|
+
expire_duration: Optional[int]
|
174
|
+
username_prefix: Optional[str]
|
175
|
+
username_suffix: Optional[str]
|
176
|
+
inbounds: Optional[Dict[str, List[str]]]
|
177
|
+
|
178
|
+
class UserUsageResponse(BaseModel):
|
179
|
+
node_id: int
|
180
|
+
node_name: str
|
181
|
+
used_traffic: int
|
182
|
+
|
183
|
+
class UserUsagesResponse(BaseModel):
|
184
|
+
username: str
|
185
|
+
usages: List[UserUsageResponse]
|
186
|
+
|
187
|
+
class UsersResponse(BaseModel):
|
188
|
+
users: List[UserResponse]
|
189
|
+
total: int
|
190
|
+
|
191
|
+
class UserStatus(BaseModel):
|
192
|
+
enum = ["active", "disabled", "limited", "expired", "on_hold"]
|
193
|
+
|
194
|
+
class ValidationError(BaseModel):
|
195
|
+
loc: List[Any]
|
196
|
+
msg: str
|
197
|
+
type: str
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Artem
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: marzban
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: Асинхронная библиотека Python для взаимодействия с MarzbanAPI
|
5
|
+
Home-page: https://github.com/sm1ky/marzban_api
|
6
|
+
Author: Artem
|
7
|
+
Author-email: contant@sm1ky.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Requires-Python: >=3.9
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
License-File: LICENSE
|
14
|
+
Requires-Dist: httpx >=0.23.0
|
15
|
+
Requires-Dist: pydantic >=1.10.0
|
16
|
+
|
17
|
+
# MarzbanAPI Client
|
18
|
+
|
19
|
+
Это асинхронная библиотека Python для взаимодействия с MarzbanAPI, предоставляющая методы для управления администраторами, пользователями, узлами и системной статистикой.
|
20
|
+
|
21
|
+
## Установка
|
22
|
+
|
23
|
+
```bash
|
24
|
+
pip install marzban
|
25
|
+
```
|
26
|
+
|
27
|
+
Project in Pypi - https://pypi.org/project/marzban/
|
28
|
+
|
29
|
+
If you notice an error, please create a PR and attach logs
|
30
|
+
You can contact me by mail contant@sm1ky.com or in Telegram @sm1ky
|
@@ -0,0 +1,8 @@
|
|
1
|
+
marzban/__init__.py,sha256=exQkmVPbMtVfWsL-pqPiwsAHdAXM-XONyVdVSE6DrFg,81
|
2
|
+
marzban/clients.py,sha256=kcA60qyG7d1l3lXl5K3MI590DLfLcCi8z42DndwnyDU,12457
|
3
|
+
marzban/models.py,sha256=7616sr43dn6tODzaT_NBN6WNPap8WXg70TFsgaJNEHs,4952
|
4
|
+
marzban-0.1.2.dist-info/LICENSE,sha256=e7OchdHfXoz2OZRHj8iltLIKYwdri9J4_9PMEnov418,1061
|
5
|
+
marzban-0.1.2.dist-info/METADATA,sha256=PkXIOqqKqUCLSL89GMsKdjT6IRxKjQi0aCE7li3WgrY,1111
|
6
|
+
marzban-0.1.2.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
7
|
+
marzban-0.1.2.dist-info/top_level.txt,sha256=KUmBWzTarBlzw2GZOuk-d-jM2GU4zPWo1iwvW_mXS-c,8
|
8
|
+
marzban-0.1.2.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
marzban
|