squarecloud-api 3.3.1__tar.gz → 3.4.0__tar.gz
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.
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/PKG-INFO +28 -14
- squarecloud_api-3.4.0/README.md +60 -0
- squarecloud_api-3.4.0/pyproject.toml +78 -0
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/__init__.py +2 -3
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/app.py +636 -634
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/cli/app.py +4 -4
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/cli/main.py +12 -51
- squarecloud_api-3.4.0/squarecloud/client.py +727 -0
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/data.py +22 -49
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/errors.py +26 -15
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/http/endpoints.py +298 -322
- squarecloud_api-3.4.0/squarecloud/http/http_client.py +658 -0
- squarecloud_api-3.4.0/squarecloud/listeners/__init__.py +185 -0
- squarecloud_api-3.4.0/squarecloud/listeners/capture_listener.py +154 -0
- squarecloud_api-3.4.0/squarecloud/listeners/request_listener.py +106 -0
- squarecloud_api-3.4.0/squarecloud/logging.py +58 -0
- squarecloud_api-3.4.0/squarecloud/utils.py +72 -0
- squarecloud_api-3.3.1/README.md +0 -47
- squarecloud_api-3.3.1/pyproject.toml +0 -68
- squarecloud_api-3.3.1/squarecloud/client.py +0 -634
- squarecloud_api-3.3.1/squarecloud/http/http_client.py +0 -479
- squarecloud_api-3.3.1/squarecloud/listeners.py +0 -173
- squarecloud_api-3.3.1/squarecloud/logs.py +0 -60
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/LICENSE +0 -0
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/cli/__init__.py +0 -0
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/cli/files.py +0 -0
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/file.py +0 -0
- {squarecloud_api-3.3.1 → squarecloud_api-3.4.0}/squarecloud/http/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: squarecloud-api
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.0
|
|
4
4
|
Summary: SquareCloud API wrapper
|
|
5
5
|
Home-page: https://github.com/squarecloudofc/wrapper-api-py
|
|
6
6
|
License: MIT
|
|
@@ -13,9 +13,10 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Requires-Dist: aiohttp (==3.
|
|
16
|
+
Requires-Dist: aiohttp (==3.9.3)
|
|
17
17
|
Requires-Dist: click (>=8.1.6,<9.0.0)
|
|
18
18
|
Requires-Dist: pydantic (>=2.5.2,<3.0.0)
|
|
19
|
+
Requires-Dist: pypi (>=2.1,<3.0)
|
|
19
20
|
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
|
20
21
|
Requires-Dist: rich (>=13.5.2,<14.0.0)
|
|
21
22
|
Project-URL: Documentation, https://docs.squarecloud.app/sdks/py
|
|
@@ -26,19 +27,28 @@ Description-Content-Type: text/markdown
|
|
|
26
27
|
|
|
27
28
|
[Square Cloud API]: https://docs.squarecloud.app/api-reference/
|
|
28
29
|
|
|
29
|
-
[@
|
|
30
|
+
[@allma]: https://github.com/Robert-Nogueira
|
|
30
31
|
|
|
31
|
-
# squarecloud-api
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
<div align="center">
|
|
34
|
+
<img alt="Square Cloud Banner" src="https://cdn.squarecloud.app/png/github-readme.png">
|
|
35
|
+
</div>
|
|
34
36
|
|
|
37
|
+
<h1 align="center">squarecloud-api</h1>
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
<p align="center">A Python SDK for consuming the <a href="https://squarecloud.app" target="_blank">Square Cloud</a> API.</p>
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
````shell
|
|
39
44
|
pip install squarecloud-api
|
|
40
45
|
````
|
|
41
46
|
|
|
47
|
+
If you intend to use this SDK for command-line interface (CLI) operations, consider
|
|
48
|
+
installing it with pipx:
|
|
49
|
+
````shell
|
|
50
|
+
pipx install squarecloud-api
|
|
51
|
+
````
|
|
42
52
|
|
|
43
53
|
## Getting api key
|
|
44
54
|
|
|
@@ -46,16 +56,16 @@ to get your api key/token just go to the [Square Cloud] website and
|
|
|
46
56
|
register/login, after that go
|
|
47
57
|
to `dashboard` > `my account` > `Regenerate API/CLI KEY` and copy the key.
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
## Documentation
|
|
60
|
+
Visit our [official documentation](https://docs.squarecloud.app/sdks/py) for more information about how to use this library.
|
|
61
|
+
|
|
62
|
+
## Getting started
|
|
51
63
|
|
|
52
|
-
## Basic usage
|
|
53
64
|
```python
|
|
54
65
|
import asyncio
|
|
55
|
-
|
|
56
66
|
import squarecloud as square
|
|
57
67
|
|
|
58
|
-
client = square.Client('API_KEY'
|
|
68
|
+
client = square.Client('API_KEY')
|
|
59
69
|
|
|
60
70
|
async def main():
|
|
61
71
|
status = await client.app_status(app_id='application_id')
|
|
@@ -66,7 +76,11 @@ async def main():
|
|
|
66
76
|
asyncio.run(main())
|
|
67
77
|
```
|
|
68
78
|
|
|
69
|
-
##
|
|
79
|
+
## Contributing
|
|
80
|
+
|
|
81
|
+
Feel free to contribute with suggestions or bug reports at our [GitHub repository](https://github.com/squarecloudofc/wrapper-api-py).
|
|
82
|
+
|
|
83
|
+
## Authors
|
|
70
84
|
|
|
71
|
-
|
|
85
|
+
- [@allma]
|
|
72
86
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[Square Cloud]: https://squarecloud.app
|
|
2
|
+
|
|
3
|
+
[Square Cloud API]: https://docs.squarecloud.app/api-reference/
|
|
4
|
+
|
|
5
|
+
[@allma]: https://github.com/Robert-Nogueira
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
9
|
+
<img alt="Square Cloud Banner" src="https://cdn.squarecloud.app/png/github-readme.png">
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<h1 align="center">squarecloud-api</h1>
|
|
13
|
+
|
|
14
|
+
<p align="center">A Python SDK for consuming the <a href="https://squarecloud.app" target="_blank">Square Cloud</a> API.</p>
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
````shell
|
|
19
|
+
pip install squarecloud-api
|
|
20
|
+
````
|
|
21
|
+
|
|
22
|
+
If you intend to use this SDK for command-line interface (CLI) operations, consider
|
|
23
|
+
installing it with pipx:
|
|
24
|
+
````shell
|
|
25
|
+
pipx install squarecloud-api
|
|
26
|
+
````
|
|
27
|
+
|
|
28
|
+
## Getting api key
|
|
29
|
+
|
|
30
|
+
to get your api key/token just go to the [Square Cloud] website and
|
|
31
|
+
register/login, after that go
|
|
32
|
+
to `dashboard` > `my account` > `Regenerate API/CLI KEY` and copy the key.
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
Visit our [official documentation](https://docs.squarecloud.app/sdks/py) for more information about how to use this library.
|
|
36
|
+
|
|
37
|
+
## Getting started
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
import asyncio
|
|
41
|
+
import squarecloud as square
|
|
42
|
+
|
|
43
|
+
client = square.Client('API_KEY')
|
|
44
|
+
|
|
45
|
+
async def main():
|
|
46
|
+
status = await client.app_status(app_id='application_id')
|
|
47
|
+
print(status)
|
|
48
|
+
print(status.ram)
|
|
49
|
+
print(status.cpu)
|
|
50
|
+
|
|
51
|
+
asyncio.run(main())
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Contributing
|
|
55
|
+
|
|
56
|
+
Feel free to contribute with suggestions or bug reports at our [GitHub repository](https://github.com/squarecloudofc/wrapper-api-py).
|
|
57
|
+
|
|
58
|
+
## Authors
|
|
59
|
+
|
|
60
|
+
- [@allma]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = 'squarecloud-api'
|
|
3
|
+
version = '3.4.0'
|
|
4
|
+
description = 'SquareCloud API wrapper'
|
|
5
|
+
authors = ['Robert Nogueira <robertlucasnogueira@gmail.com>']
|
|
6
|
+
repository = 'https://github.com/squarecloudofc/wrapper-api-py'
|
|
7
|
+
documentation = 'https://docs.squarecloud.app/sdks/py'
|
|
8
|
+
license = 'MIT License'
|
|
9
|
+
readme = 'README.md'
|
|
10
|
+
packages = [{ include = 'squarecloud' }]
|
|
11
|
+
|
|
12
|
+
[tool.poetry.dependencies]
|
|
13
|
+
python = '^3.9'
|
|
14
|
+
aiohttp = '3.9.3'
|
|
15
|
+
click = '^8.1.6'
|
|
16
|
+
rich = '^13.5.2'
|
|
17
|
+
pydantic = '^2.5.2'
|
|
18
|
+
python-dotenv = '^1.0.0'
|
|
19
|
+
pypi = "^2.1"
|
|
20
|
+
|
|
21
|
+
[tool.poetry.group.dev.dependencies]
|
|
22
|
+
pytest = '^7.4.3'
|
|
23
|
+
pytest-cov = '^4.1.0'
|
|
24
|
+
blue = '^0.9.1'
|
|
25
|
+
isort = '^5.12.0'
|
|
26
|
+
taskipy = '^1.12.0'
|
|
27
|
+
pytest-asyncio = '^0.21.1'
|
|
28
|
+
pre-commit = '^3.3.3'
|
|
29
|
+
ruff = '^0.0.289'
|
|
30
|
+
memory-profiler = '^0.61.0'
|
|
31
|
+
requests = '^2.31.0'
|
|
32
|
+
pytest-rerunfailures = "^13.0"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
[[tool.poetry.source]]
|
|
36
|
+
name = 'pypi-test'
|
|
37
|
+
url = 'https://test.pypi.org/simple/'
|
|
38
|
+
priority = 'primary'
|
|
39
|
+
|
|
40
|
+
[build-system]
|
|
41
|
+
requires = ['poetry-core']
|
|
42
|
+
build-backend = 'poetry.core.masonry.api'
|
|
43
|
+
|
|
44
|
+
[tool.pytest.ini_options]
|
|
45
|
+
asyncio_mode = 'auto'
|
|
46
|
+
markers = [
|
|
47
|
+
'app',
|
|
48
|
+
'app_data',
|
|
49
|
+
'listeners',
|
|
50
|
+
'capture_listener',
|
|
51
|
+
'request_listener',
|
|
52
|
+
'files',
|
|
53
|
+
'upload',
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[tool.isort]
|
|
57
|
+
profile = 'black'
|
|
58
|
+
line_length = 79
|
|
59
|
+
|
|
60
|
+
[tool.taskipy.tasks]
|
|
61
|
+
lint = 'isort . && blue . && ruff .'
|
|
62
|
+
pre_test = 'task lint'
|
|
63
|
+
test = 'pytest -vv -s --reruns 5 --only-rerun TooManyRequests --reruns-delay 60 -x --cov=tests tests'
|
|
64
|
+
post_test = 'coverage html'
|
|
65
|
+
cli = 'python -m squarecloud.cli.main'
|
|
66
|
+
publish-test = 'poetry publish -r pypi-test --build'
|
|
67
|
+
install-test = 'pip install -i https://test.pypi.org/pypi/ --extra-index-url https://pypi.org/simple --upgrade squarecloud-api'
|
|
68
|
+
docs = 'mkdocs serve'
|
|
69
|
+
|
|
70
|
+
[tool.poetry.scripts]
|
|
71
|
+
clear-test-apps = 'scripts.clear_test_apps:delete_test_apps'
|
|
72
|
+
|
|
73
|
+
[tool.ruff]
|
|
74
|
+
line-length = 79
|
|
75
|
+
exclude = ['env']
|
|
76
|
+
|
|
77
|
+
[tool.ruff.per-file-ignores]
|
|
78
|
+
'__init__.py' = ['F401']
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from . import errors, utils
|
|
3
4
|
from .client import Client, create_config_file
|
|
4
5
|
from .data import (
|
|
5
6
|
AppData,
|
|
@@ -7,13 +8,11 @@ from .data import (
|
|
|
7
8
|
FileInfo,
|
|
8
9
|
LogsData,
|
|
9
10
|
PlanData,
|
|
10
|
-
StatisticsData,
|
|
11
11
|
StatusData,
|
|
12
12
|
UploadData,
|
|
13
13
|
UserData,
|
|
14
14
|
)
|
|
15
15
|
from .file import File
|
|
16
16
|
from .http.endpoints import Endpoint
|
|
17
|
-
from . import errors
|
|
18
17
|
|
|
19
|
-
__version__ = '3.
|
|
18
|
+
__version__ = '3.4.0'
|