gancio-py 0.1.0b1__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.
- gancio_py-0.1.0b1/.github/workflows/publish.yml +23 -0
- gancio_py-0.1.0b1/.github/workflows/test.yml +37 -0
- gancio_py-0.1.0b1/.gitignore +14 -0
- gancio_py-0.1.0b1/.pre-commit-config.yaml +6 -0
- gancio_py-0.1.0b1/LICENSE +21 -0
- gancio_py-0.1.0b1/PKG-INFO +121 -0
- gancio_py-0.1.0b1/README.md +91 -0
- gancio_py-0.1.0b1/docker-compose.yml +8 -0
- gancio_py-0.1.0b1/gancio_py/__init__.py +2 -0
- gancio_py-0.1.0b1/gancio_py/client.py +376 -0
- gancio_py-0.1.0b1/gancio_py/exceptions.py +12 -0
- gancio_py-0.1.0b1/gancio_py/py.typed +0 -0
- gancio_py-0.1.0b1/pyproject.toml +62 -0
- gancio_py-0.1.0b1/tests/conftest.py +80 -0
- gancio_py-0.1.0b1/tests/test_client.py +140 -0
- gancio_py-0.1.0b1/uv.lock +730 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Install uv
|
|
17
|
+
uses: astral-sh/setup-uv@v4
|
|
18
|
+
|
|
19
|
+
- name: Build package
|
|
20
|
+
run: uv build
|
|
21
|
+
|
|
22
|
+
- name: Publish to PyPI
|
|
23
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on: push
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
lint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v4
|
|
10
|
+
- name: Install uv
|
|
11
|
+
uses: astral-sh/setup-uv@v4
|
|
12
|
+
- name: Lint
|
|
13
|
+
run: uvx ruff check
|
|
14
|
+
|
|
15
|
+
integration:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Start Gancio
|
|
22
|
+
run: >-
|
|
23
|
+
docker run -d
|
|
24
|
+
--name gancio
|
|
25
|
+
--restart unless-stopped
|
|
26
|
+
-e NODE_ENV=development
|
|
27
|
+
-p 13120:13120
|
|
28
|
+
cisti/gancio
|
|
29
|
+
|
|
30
|
+
- name: Install uv
|
|
31
|
+
uses: astral-sh/setup-uv@v4
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: uv sync --extra test
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: uv run pytest -m integration -v --cov --cov-report=term-missing
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tboye
|
|
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,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gancio-py
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: Python client for the Gancio event platform API
|
|
5
|
+
Project-URL: Homepage, https://github.com/tboye/gancio-py
|
|
6
|
+
Project-URL: Repository, https://github.com/tboye/gancio-py
|
|
7
|
+
Project-URL: Issues, https://github.com/tboye/gancio-py/issues
|
|
8
|
+
Author-email: tboye <me@tboye.dev>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api-client,events,gancio
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: requests
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
23
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
24
|
+
Provides-Extra: test
|
|
25
|
+
Requires-Dist: pillow; extra == 'test'
|
|
26
|
+
Requires-Dist: pytest; extra == 'test'
|
|
27
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
28
|
+
Requires-Dist: pytest-sugar>=1.1.1; extra == 'test'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# gancio-py
|
|
32
|
+
|
|
33
|
+
[](https://github.com/tboye/gancio-py/actions/workflows/test.yml)
|
|
34
|
+
[](https://pypi.org/project/gancio-py/)
|
|
35
|
+
[](https://pypi.org/project/gancio-py/)
|
|
36
|
+
|
|
37
|
+
Python client for the [Gancio](https://gancio.org) event platform API.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install gancio-py
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from gancio_py import Gancio
|
|
49
|
+
|
|
50
|
+
# Connect and log in
|
|
51
|
+
gancio = Gancio("https://your-gancio-instance.org")
|
|
52
|
+
gancio.login("user@example.com", "password")
|
|
53
|
+
|
|
54
|
+
# Or use a pre-existing token
|
|
55
|
+
gancio = Gancio("https://your-gancio-instance.org", access_token="your-token")
|
|
56
|
+
|
|
57
|
+
# Create an event
|
|
58
|
+
event = gancio.create_event(title="My Event",
|
|
59
|
+
start_datetime=1700000000,
|
|
60
|
+
place_name="The Venue",
|
|
61
|
+
place_address="123 Main St",
|
|
62
|
+
tags=["music", "live"])
|
|
63
|
+
|
|
64
|
+
# List events
|
|
65
|
+
events = gancio.get_events(tags=["music"])
|
|
66
|
+
|
|
67
|
+
# Get a specific event
|
|
68
|
+
event = gancio.get_event("my-event")
|
|
69
|
+
|
|
70
|
+
# Update an event
|
|
71
|
+
gancio.update_event(event_id=1, title="Updated Title")
|
|
72
|
+
|
|
73
|
+
# Delete an event
|
|
74
|
+
gancio.delete_event(event_id=1)
|
|
75
|
+
|
|
76
|
+
# Search places
|
|
77
|
+
places = gancio.search_place("Venue")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Error handling
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from gancio_py import Gancio, GancioError
|
|
84
|
+
|
|
85
|
+
gancio = Gancio("https://your-gancio-instance.org")
|
|
86
|
+
|
|
87
|
+
try:
|
|
88
|
+
event = gancio.get_event("nonexistent-slug")
|
|
89
|
+
except GancioError as e:
|
|
90
|
+
print(e.status_code) # 404
|
|
91
|
+
print(e.response_body) # error details from the server
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
Run integration tests locally with Docker:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv sync --extra test
|
|
100
|
+
|
|
101
|
+
# Fresh container (runs first-time setup automatically):
|
|
102
|
+
docker compose down -v && docker compose up -d
|
|
103
|
+
uv run pytest -m integration -v --cov
|
|
104
|
+
|
|
105
|
+
# Or against an existing instance with known credentials:
|
|
106
|
+
GANCIO_URL=http://localhost:13120 \
|
|
107
|
+
GANCIO_ADMIN_EMAIL=admin \
|
|
108
|
+
GANCIO_ADMIN_PASSWORD=yourpassword \
|
|
109
|
+
uv run pytest -m integration -v --cov
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Linting
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
uvx ruff check
|
|
116
|
+
uvx ruff check --fix # auto-fix
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# gancio-py
|
|
2
|
+
|
|
3
|
+
[](https://github.com/tboye/gancio-py/actions/workflows/test.yml)
|
|
4
|
+
[](https://pypi.org/project/gancio-py/)
|
|
5
|
+
[](https://pypi.org/project/gancio-py/)
|
|
6
|
+
|
|
7
|
+
Python client for the [Gancio](https://gancio.org) event platform API.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install gancio-py
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from gancio_py import Gancio
|
|
19
|
+
|
|
20
|
+
# Connect and log in
|
|
21
|
+
gancio = Gancio("https://your-gancio-instance.org")
|
|
22
|
+
gancio.login("user@example.com", "password")
|
|
23
|
+
|
|
24
|
+
# Or use a pre-existing token
|
|
25
|
+
gancio = Gancio("https://your-gancio-instance.org", access_token="your-token")
|
|
26
|
+
|
|
27
|
+
# Create an event
|
|
28
|
+
event = gancio.create_event(title="My Event",
|
|
29
|
+
start_datetime=1700000000,
|
|
30
|
+
place_name="The Venue",
|
|
31
|
+
place_address="123 Main St",
|
|
32
|
+
tags=["music", "live"])
|
|
33
|
+
|
|
34
|
+
# List events
|
|
35
|
+
events = gancio.get_events(tags=["music"])
|
|
36
|
+
|
|
37
|
+
# Get a specific event
|
|
38
|
+
event = gancio.get_event("my-event")
|
|
39
|
+
|
|
40
|
+
# Update an event
|
|
41
|
+
gancio.update_event(event_id=1, title="Updated Title")
|
|
42
|
+
|
|
43
|
+
# Delete an event
|
|
44
|
+
gancio.delete_event(event_id=1)
|
|
45
|
+
|
|
46
|
+
# Search places
|
|
47
|
+
places = gancio.search_place("Venue")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Error handling
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from gancio_py import Gancio, GancioError
|
|
54
|
+
|
|
55
|
+
gancio = Gancio("https://your-gancio-instance.org")
|
|
56
|
+
|
|
57
|
+
try:
|
|
58
|
+
event = gancio.get_event("nonexistent-slug")
|
|
59
|
+
except GancioError as e:
|
|
60
|
+
print(e.status_code) # 404
|
|
61
|
+
print(e.response_body) # error details from the server
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Development
|
|
65
|
+
|
|
66
|
+
Run integration tests locally with Docker:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uv sync --extra test
|
|
70
|
+
|
|
71
|
+
# Fresh container (runs first-time setup automatically):
|
|
72
|
+
docker compose down -v && docker compose up -d
|
|
73
|
+
uv run pytest -m integration -v --cov
|
|
74
|
+
|
|
75
|
+
# Or against an existing instance with known credentials:
|
|
76
|
+
GANCIO_URL=http://localhost:13120 \
|
|
77
|
+
GANCIO_ADMIN_EMAIL=admin \
|
|
78
|
+
GANCIO_ADMIN_PASSWORD=yourpassword \
|
|
79
|
+
uv run pytest -m integration -v --cov
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Linting
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
uvx ruff check
|
|
86
|
+
uvx ruff check --fix # auto-fix
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
[MIT](LICENSE)
|