Commite605a3e1Recorded25 Mar 2026Repositorysigil-youtube

Rename (sigil youtube) namespace to (youtube)

Message

External service wrappers use their service name as the top-level namespace. Core (sigil ...) is reserved for Sigil infrastructure.

  • Move src/sigil/youtube.sgl → src/youtube.sgl
  • Move src/sigil/youtube/.sgl → src/youtube/.sgl
  • Update all define-library and import forms
  • Update tests and README
Changed
 .gitignore                            |  2 +-
 README.md                             | 20 ++++++++++----------
 src/{sigil => }/youtube.sgl           |  6 +++---
 src/{sigil => }/youtube/analytics.sgl |  6 +++---
 src/{sigil => }/youtube/live.sgl      |  6 +++---
 src/{sigil => }/youtube/playlist.sgl  |  6 +++---
 src/{sigil => }/youtube/upload.sgl    |  6 +++---
 test/analytics-test.sgl               |  6 +++---
 test/live-test.sgl                    |  6 +++---
 test/playlist-test.sgl                |  6 +++---
 test/upload-test.sgl                  |  6 +++---
 test/youtube-test.sgl                 |  4 ++--
 12 files changed, 40 insertions(+), 40 deletions(-)
Diff
.gitignoremodified
@@ -1 +1 @@
1
build/
+1
build/\nlib
README.mdmodified
@@ -20,11 +20,11 @@ analytics, livestreaming, and playlist APIs.
20
21
| Module | Description |
22
|--------|-------------|
23
| `(sigil youtube)` | Core client, records, HTTP helpers, video/channel/search APIs |
24
| `(sigil youtube upload)` | Resumable upload protocol with chunked transfer |
25
| `(sigil youtube analytics)` | YouTube Analytics API v2 queries |
26
| `(sigil youtube live)` | Live broadcast and stream management |
27
| `(sigil youtube playlist)` | Playlist and playlist item CRUD |
+23
| `(youtube)` | Core client, records, HTTP helpers, video/channel/search APIs |
+24
| `(youtube upload)` | Resumable upload protocol with chunked transfer |
+25
| `(youtube analytics)` | YouTube Analytics API v2 queries |
+26
| `(youtube live)` | Live broadcast and stream management |
+27
| `(youtube playlist)` | Playlist and playlist item CRUD |
28
29
## Dependencies
30
@@ -50,7 +50,7 @@ sigil test --redirects dev-redirects.sgl
50
### Create a client
51
52
```scheme
53
(import (sigil youtube))
+53
(import (youtube))
54
55
;; With OAuth2 access token (required for mutations)
56
(define client (youtube-client access-token: "ya29.your-token"))
@@ -91,7 +91,7 @@ sigil test --redirects dev-redirects.sgl
91
### Upload a video
92
93
```scheme
94
(import (sigil youtube upload))
+94
(import (youtube upload))
95
96
;; High-level upload (handles chunking automatically)
97
;; Quota cost: 1,600 units
@@ -108,7 +108,7 @@ sigil test --redirects dev-redirects.sgl
108
### Query analytics
109
110
```scheme
111
(import (sigil youtube analytics))
+111
(import (youtube analytics))
112
113
;; Daily views for a date range
114
(define report (youtube-views-by-day client "2026-01-01" "2026-03-25"))
@@ -126,7 +126,7 @@ sigil test --redirects dev-redirects.sgl
126
### Manage playlists
127
128
```scheme
129
(import (sigil youtube playlist))
+129
(import (youtube playlist))
130
131
;; List your playlists
132
(define plists (youtube-playlists client))
@@ -146,7 +146,7 @@ sigil test --redirects dev-redirects.sgl
146
### Livestreaming
147
148
```scheme
149
(import (sigil youtube live))
+149
(import (youtube live))
150
151
;; Create broadcast + stream, bind them
152
(define bc (youtube-create-broadcast client
src/sigil/youtube.sgl → src/youtube.sglrenamed
@@ -1,4 +1,4 @@
1
;;; (sigil youtube) - YouTube Data API v3 client library.
+1
;;; (youtube) - YouTube Data API v3 client library.
2
;;;
3
;;; Core module providing authentication, HTTP helpers, record types,
4
;;; and functions for video management, channel info, search, and thumbnails.
@@ -7,9 +7,9 @@
7
;;; - Read operations: 1 unit
8
;;; - Write operations: 50 units
9
;;; - Search: 100 units
10
;;; - Video upload: 1,600 units (see (sigil youtube upload))
+10
;;; - Video upload: 1,600 units (see (youtube upload))
11
12
(define-library (sigil youtube)
+12
(define-library (youtube)
13
(import (sigil core)
14
(sigil dict)
15
(sigil string)
src/sigil/youtube/analytics.sgl → src/youtube/analytics.sglrenamed
@@ -1,4 +1,4 @@
1
;;; (sigil youtube analytics) - YouTube Analytics API v2 client.
+1
;;; (youtube analytics) - YouTube Analytics API v2 client.
2
;;;
3
;;; Query YouTube Analytics for video performance metrics, audience data,
4
;;; and revenue information.
@@ -10,13 +10,13 @@
10
;;; yt-analytics.readonly — for views, watch time, engagement
11
;;; yt-analytics-monetary.readonly — for revenue, ad performance
12
13
(define-library (sigil youtube analytics)
+13
(define-library (youtube analytics)
14
(import (sigil core)
15
(sigil dict)
16
(sigil string)
17
(sigil json)
18
(sigil http client)
19
(sigil youtube))
+19
(youtube))
20
21
(export ;; Configuration
22
youtube-analytics-base-url
src/sigil/youtube/live.sgl → src/youtube/live.sglrenamed
@@ -1,4 +1,4 @@
1
;;; (sigil youtube live) - YouTube Live Streaming API.
+1
;;; (youtube live) - YouTube Live Streaming API.
2
;;;
3
;;; Manages the live broadcast lifecycle: create broadcasts and streams,
4
;;; bind them together, and transition through states
@@ -7,14 +7,14 @@
7
;;; Broadcast lifecycle:
8
;;; created -> ready -> testStarting -> testing -> liveStarting -> live -> complete
9
10
(define-library (sigil youtube live)
+10
(define-library (youtube live)
11
(import (sigil core)
12
(sigil dict)
13
(sigil string)
14
(sigil struct)
15
(sigil json)
16
(sigil http client)
17
(sigil youtube))
+17
(youtube))
18
19
(export ;; Records
20
youtube-broadcast
src/sigil/youtube/playlist.sgl → src/youtube/playlist.sglrenamed
@@ -1,4 +1,4 @@
1
;;; (sigil youtube playlist) - YouTube playlist management.
+1
;;; (youtube playlist) - YouTube playlist management.
2
;;;
3
;;; CRUD operations for playlists and playlist items.
4
;;; Write operations cost 50 quota units each; reads cost 1 unit.
@@ -7,14 +7,14 @@
7
;;; "UU" + channel_id (without the "UC" prefix).
8
;;; Using playlistItems.list on this is much cheaper than search.list.
9
10
(define-library (sigil youtube playlist)
+10
(define-library (youtube playlist)
11
(import (sigil core)
12
(sigil dict)
13
(sigil string)
14
(sigil struct)
15
(sigil json)
16
(sigil http client)
17
(sigil youtube))
+17
(youtube))
18
19
(export ;; Records
20
youtube-playlist
src/sigil/youtube/upload.sgl → src/youtube/upload.sglrenamed
@@ -1,4 +1,4 @@
1
;;; (sigil youtube upload) - YouTube resumable upload protocol.
+1
;;; (youtube upload) - YouTube resumable upload protocol.
2
;;;
3
;;; Implements the Google resumable upload protocol for uploading videos
4
;;; to YouTube. Supports single-request and chunked uploads with resume
@@ -7,14 +7,14 @@
7
;;; Upload quota cost: 1,600 units per video.
8
;;; Chunk size must be a multiple of 256 KB (262144 bytes), except final chunk.
9
10
(define-library (sigil youtube upload)
+10
(define-library (youtube upload)
11
(import (sigil core)
12
(sigil dict)
13
(sigil string)
14
(sigil struct)
15
(sigil json)
16
(sigil http client)
17
(sigil youtube))
+17
(youtube))
18
19
(export ;; Low-level upload operations
20
youtube-upload-init
test/analytics-test.sglmodified
@@ -1,4 +1,4 @@
1
;;; Tests for (sigil youtube analytics) — analytics module
+1
;;; Tests for (youtube analytics) — analytics module
2
;;;
3
;;; Tests the analytics base URL constant. Query function tests
4
;;; require HTTP mocking which is not available, so we test what we can.
@@ -6,8 +6,8 @@
6
(import (sigil core)
7
(sigil string)
8
(sigil test)
9
(sigil youtube)
10
(sigil youtube analytics))
+9
(youtube)
+10
(youtube analytics))
11
12
;; ---------------------------------------------------------------
13
;; Constants tests
test/live-test.sglmodified
@@ -1,4 +1,4 @@
1
;;; Tests for (sigil youtube live) — livestreaming module
+1
;;; Tests for (youtube live) — livestreaming module
2
;;;
3
;;; Tests record construction and JSON parsing with fixture data.
4
@@ -8,8 +8,8 @@
8
(sigil struct)
9
(sigil json)
10
(sigil test)
11
(sigil youtube)
12
(sigil youtube live))
+11
(youtube)
+12
(youtube live))
13
14
;; ---------------------------------------------------------------
15
;; Test fixtures
test/playlist-test.sglmodified
@@ -1,4 +1,4 @@
1
;;; Tests for (sigil youtube playlist) — playlist module
+1
;;; Tests for (youtube playlist) — playlist module
2
;;;
3
;;; Tests record construction and JSON parsing with fixture data.
4
@@ -8,8 +8,8 @@
8
(sigil struct)
9
(sigil json)
10
(sigil test)
11
(sigil youtube)
12
(sigil youtube playlist))
+11
(youtube)
+12
(youtube playlist))
13
14
;; ---------------------------------------------------------------
15
;; Test fixtures
test/upload-test.sglmodified
@@ -1,4 +1,4 @@
1
;;; Tests for (sigil youtube upload) — upload module
+1
;;; Tests for (youtube upload) — upload module
2
;;;
3
;;; Tests record construction, chunk size constants, and upload
4
;;; helper logic. Cannot test actual HTTP upload without mocking.
@@ -8,8 +8,8 @@
8
(sigil string)
9
(sigil struct)
10
(sigil test)
11
(sigil youtube)
12
(sigil youtube upload))
+11
(youtube)
+12
(youtube upload))
13
14
;; ---------------------------------------------------------------
15
;; Constants tests
test/youtube-test.sglmodified
@@ -1,4 +1,4 @@
1
;;; Tests for (sigil youtube) — core module
+1
;;; Tests for (youtube) — core module
2
;;;
3
;;; Tests record construction, JSON response parsing, URL building,
4
;;; and query string encoding using fixture data (no real API calls).
@@ -9,7 +9,7 @@
9
(sigil struct)
10
(sigil json)
11
(sigil test)
12
(sigil youtube))
+12
(youtube))
13
14
;; ---------------------------------------------------------------
15
;; Test fixtures — JSON response samples