hermes-plt 0.1.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.
@@ -0,0 +1,7 @@
1
+ FRED_API=
2
+ SUPABASE_DB_URL=
3
+ ACLED_EMAIL=
4
+ ACLED_PASSWORD=
5
+ HOST=0.0.0.0
6
+ PORT=8000
7
+ ENV=dev
@@ -0,0 +1,4 @@
1
+ __pycache__
2
+ .env
3
+ .venv
4
+ test/
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,14 @@
1
+ {
2
+ "sqltools.connections": [
3
+ {
4
+ "ssh": "Disabled",
5
+ "previewLimit": 50,
6
+ "server": "localhost",
7
+ "port": 5432,
8
+ "driver": "PostgreSQL",
9
+ "name": "hermes",
10
+ "database": "hermes",
11
+ "username": "postgres"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,634 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-plt
3
+ Version: 0.1.0
4
+ Summary: Foundational intelligence data platform for acquiring, validating, normalizing, storing, and serving intelligence datasets
5
+ Author: Hermes Contributors
6
+ License: MIT
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Python: >=3.11
15
+ Requires-Dist: asyncpg>=0.31.0
16
+ Requires-Dist: dotenv>=0.9.9
17
+ Requires-Dist: fastapi>=0.139.0
18
+ Requires-Dist: httpx>=0.28.1
19
+ Requires-Dist: ipykernel>=7.3.0
20
+ Requires-Dist: pandas>=3.0.3
21
+ Requires-Dist: pydantic>=2.13.4
22
+ Requires-Dist: pyfiglet>=1.0.4
23
+ Requires-Dist: sqlalchemy>=2.0.51
24
+ Requires-Dist: supabase>=2.31.0
25
+ Requires-Dist: textual>=3.1.0
26
+ Requires-Dist: uvicorn>=0.50.0
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Hermes
30
+
31
+ > The foundational intelligence data platform.
32
+
33
+ Hermes is a production-grade data platform responsible for acquiring, validating, normalizing, storing, and serving intelligence datasets.
34
+
35
+ It serves as the single source of truth for all downstream intelligence systems by transforming heterogeneous external datasets into a unified, reliable, versioned, and queryable internal representation.
36
+
37
+ Hermes is the data foundation of the intelligence ecosystem.
38
+
39
+ ---
40
+
41
+ # Overview
42
+
43
+ Intelligence-relevant data is fragmented across numerous providers, formats, and delivery mechanisms.
44
+
45
+ Examples include:
46
+
47
+ * ACLED conflict and protest events
48
+ * GDELT global event streams
49
+ * World Bank economic indicators
50
+ * IMF macroeconomic indicators
51
+ * OFAC sanctions data
52
+ * FRED financial indicators
53
+ * SIPRI defense and military expenditure data
54
+ * UN Comtrade trade statistics
55
+
56
+ Each source introduces unique challenges:
57
+
58
+ * Different schemas
59
+ * Different identifiers
60
+ * Different update frequencies
61
+ * Different quality standards
62
+ * Different ingestion methods
63
+
64
+ Without a centralized platform, every downstream application must repeatedly implement:
65
+
66
+ * Data acquisition
67
+ * Data cleaning
68
+ * Data validation
69
+ * Schema normalization
70
+ * Data storage
71
+ * Source integration
72
+
73
+ Hermes centralizes these responsibilities and exposes a consistent internal data model.
74
+
75
+ ---
76
+
77
+ # Mission
78
+
79
+ Provide a unified, reliable, auditable, and scalable intelligence data platform.
80
+
81
+ ---
82
+
83
+ # Architectural Role
84
+
85
+ ```text
86
+ External Sources
87
+
88
+
89
+ Hermes
90
+
91
+
92
+ Aegis
93
+
94
+
95
+ Atlas
96
+
97
+
98
+ Applications
99
+ ```
100
+
101
+ Hermes is responsible only for data management.
102
+
103
+ It does not perform analytics, forecasting, machine learning, or risk assessment.
104
+
105
+ ---
106
+
107
+ # Core Responsibilities
108
+
109
+ ## 1. Data Acquisition
110
+
111
+ Hermes acquires datasets from external providers.
112
+
113
+ Supported ingestion methods include:
114
+
115
+ * REST APIs
116
+ * Bulk downloads
117
+ * CSV exports
118
+ * JSON feeds
119
+ * XML feeds
120
+
121
+ Acquisition capabilities include:
122
+
123
+ * Authentication
124
+ * Pagination
125
+ * Rate limiting
126
+ * Retry handling
127
+ * Download orchestration
128
+ * Incremental synchronization
129
+
130
+ ---
131
+
132
+ ## 2. Data Validation
133
+
134
+ All incoming data is validated before storage.
135
+
136
+ Validation examples:
137
+
138
+ * Required field verification
139
+ * Timestamp validation
140
+ * Country code validation
141
+ * Numeric range validation
142
+ * Duplicate detection
143
+ * Referential integrity checks
144
+
145
+ Invalid records may be:
146
+
147
+ * Rejected
148
+ * Quarantined
149
+ * Logged for investigation
150
+
151
+ ---
152
+
153
+ ## 3. Data Normalization
154
+
155
+ Hermes converts source-specific schemas into canonical internal schemas.
156
+
157
+ ### Example
158
+
159
+ Source schema:
160
+
161
+ ```json
162
+ {
163
+ "event_id_cnty": "123",
164
+ "event_date": "2026-01-01"
165
+ }
166
+ ```
167
+
168
+ Canonical Hermes schema:
169
+
170
+ ```json
171
+ {
172
+ "event_id": "123",
173
+ "occurred_at": "2026-01-01"
174
+ }
175
+ ```
176
+
177
+ Downstream systems interact only with canonical Hermes models.
178
+
179
+ ---
180
+
181
+ ## 4. Data Storage
182
+
183
+ Hermes persists normalized datasets in structured storage systems.
184
+
185
+ ### Current Storage
186
+
187
+ * PostgreSQL
188
+
189
+ ### Future Storage Targets
190
+
191
+ * Parquet datasets
192
+ * Object storage
193
+ * Data lake architectures
194
+
195
+ Storage requirements:
196
+
197
+ * Queryable
198
+ * Versioned
199
+ * Auditable
200
+ * Reliable
201
+ * Transactional
202
+
203
+ ---
204
+
205
+ ## 5. Metadata Management
206
+
207
+ Hermes tracks operational and lineage metadata for every ingestion process.
208
+
209
+ Examples include:
210
+
211
+ * Synchronization history
212
+ * Processing duration
213
+ * Dataset versions
214
+ * Failure rates
215
+ * Record counts
216
+ * Connector versions
217
+
218
+ Every ingestion operation must be traceable.
219
+
220
+ ---
221
+
222
+ ## 6. Data Serving
223
+
224
+ Hermes exposes normalized datasets through APIs.
225
+
226
+ Consumers never interact directly with external providers.
227
+
228
+ All access flows through Hermes.
229
+
230
+ Benefits include:
231
+
232
+ * Consistent schemas
233
+ * Stable interfaces
234
+ * Centralized governance
235
+ * Improved reliability
236
+
237
+ ---
238
+
239
+ # Non-Responsibilities
240
+
241
+ Hermes intentionally does **not** perform:
242
+
243
+ * Risk scoring
244
+ * Country ranking
245
+ * Forecast generation
246
+ * Machine learning training
247
+ * Machine learning inference
248
+ * LLM inference
249
+ * Knowledge graph analytics
250
+ * Dashboard rendering
251
+ * Strategic assessment
252
+
253
+ These responsibilities belong to downstream systems.
254
+
255
+ ---
256
+
257
+ # Data Domains
258
+
259
+ ## Events
260
+
261
+ Intelligence-relevant occurrences.
262
+
263
+ Examples:
264
+
265
+ * Protests
266
+ * Riots
267
+ * Armed conflict
268
+ * Political violence
269
+
270
+ Sources:
271
+
272
+ * ACLED
273
+ * GDELT
274
+
275
+ ---
276
+
277
+ ## Economics
278
+
279
+ Macroeconomic and financial indicators.
280
+
281
+ Examples:
282
+
283
+ * GDP
284
+ * Inflation
285
+ * Debt
286
+ * Unemployment
287
+
288
+ Sources:
289
+
290
+ * IMF
291
+ * World Bank
292
+ * FRED
293
+
294
+ ---
295
+
296
+ ## Trade
297
+
298
+ International trade activity.
299
+
300
+ Examples:
301
+
302
+ * Imports
303
+ * Exports
304
+ * Trade balances
305
+
306
+ Sources:
307
+
308
+ * UN Comtrade
309
+
310
+ ---
311
+
312
+ ## Sanctions
313
+
314
+ Sanctions and enforcement information.
315
+
316
+ Examples:
317
+
318
+ * Entity sanctions
319
+ * Country sanctions
320
+ * Enforcement actions
321
+
322
+ Sources:
323
+
324
+ * OFAC
325
+
326
+ ---
327
+
328
+ ## Defense
329
+
330
+ Defense and military indicators.
331
+
332
+ Examples:
333
+
334
+ * Military expenditure
335
+ * Arms transfers
336
+ * Defense budgets
337
+
338
+ Sources:
339
+
340
+ * SIPRI
341
+
342
+ ---
343
+
344
+ # Canonical Data Philosophy
345
+
346
+ Hermes standardizes all external data into canonical schemas.
347
+
348
+ A canonical schema is the internal representation used regardless of source origin.
349
+
350
+ ### Example
351
+
352
+ Source A:
353
+
354
+ ```json
355
+ {
356
+ "country": "Pakistan"
357
+ }
358
+ ```
359
+
360
+ Source B:
361
+
362
+ ```json
363
+ {
364
+ "nation": "Pakistan"
365
+ }
366
+ ```
367
+
368
+ Canonical representation:
369
+
370
+ ```json
371
+ {
372
+ "country_name": "Pakistan"
373
+ }
374
+ ```
375
+
376
+ This ensures downstream consumers operate on a consistent data model.
377
+
378
+ ---
379
+
380
+ # Connector Architecture
381
+
382
+ Every external source is isolated behind a dedicated connector.
383
+
384
+ ```text
385
+ connectors/
386
+
387
+ ├── acled/
388
+ ├── gdelt/
389
+ ├── world_bank/
390
+ ├── imf/
391
+ ├── ofac/
392
+ ├── fred/
393
+ ├── sipri/
394
+ └── un_comtrade/
395
+ ```
396
+
397
+ Each connector is responsible for:
398
+
399
+ * Fetching data
400
+ * Validating source payloads
401
+ * Mapping to canonical schemas
402
+ * Persisting normalized records
403
+
404
+ Connectors are independently developed and maintained.
405
+
406
+ ---
407
+
408
+ # Internal Architecture
409
+
410
+ ## Connector Layer
411
+
412
+ Handles communication with external systems.
413
+
414
+ Responsibilities:
415
+
416
+ * API interaction
417
+ * Authentication
418
+ * Download management
419
+ * Synchronization orchestration
420
+
421
+ ---
422
+
423
+ ## Validation Layer
424
+
425
+ Enforces data quality standards.
426
+
427
+ Responsibilities:
428
+
429
+ * Schema validation
430
+ * Constraint validation
431
+ * Duplicate detection
432
+ * Data integrity checks
433
+
434
+ ---
435
+
436
+ ## Mapping Layer
437
+
438
+ Normalizes source-specific structures.
439
+
440
+ Responsibilities:
441
+
442
+ * Schema conversion
443
+ * Field mapping
444
+ * Type conversion
445
+ * Canonical transformation
446
+
447
+ ---
448
+
449
+ ## Storage Layer
450
+
451
+ Persists normalized datasets.
452
+
453
+ Responsibilities:
454
+
455
+ * Database interaction
456
+ * Transactions
457
+ * Version management
458
+ * Persistence operations
459
+
460
+ ---
461
+
462
+ ## Metadata Layer
463
+
464
+ Tracks operational information and lineage.
465
+
466
+ Responsibilities:
467
+
468
+ * Run history
469
+ * Dataset lineage
470
+ * Audit records
471
+ * Data provenance
472
+
473
+ ---
474
+
475
+ ## API Layer
476
+
477
+ Provides access to stored datasets.
478
+
479
+ Responsibilities:
480
+
481
+ * Query interfaces
482
+ * Filtering
483
+ * Pagination
484
+ * Data retrieval
485
+
486
+ ---
487
+
488
+ # Core Entities
489
+
490
+ ## Country
491
+
492
+ Represents sovereign entities.
493
+
494
+ Examples:
495
+
496
+ * Pakistan
497
+ * India
498
+ * China
499
+
500
+ ---
501
+
502
+ ## Event
503
+
504
+ Represents intelligence-relevant occurrences.
505
+
506
+ Examples:
507
+
508
+ * Protest
509
+ * Conflict
510
+ * Riot
511
+
512
+ ---
513
+
514
+ ## Indicator
515
+
516
+ Represents measurable metrics.
517
+
518
+ Examples:
519
+
520
+ * GDP
521
+ * Inflation
522
+ * Debt
523
+
524
+ ---
525
+
526
+ ## TradeRecord
527
+
528
+ Represents trade activity.
529
+
530
+ Examples:
531
+
532
+ * Imports
533
+ * Exports
534
+
535
+ ---
536
+
537
+ ## SanctionRecord
538
+
539
+ Represents sanctions-related information.
540
+
541
+ Examples:
542
+
543
+ * Entity sanctions
544
+ * Country sanctions
545
+
546
+ ---
547
+
548
+ # Dataset Lineage
549
+
550
+ Hermes maintains full lineage tracking.
551
+
552
+ Each record should retain:
553
+
554
+ * Source system
555
+ * Source identifier
556
+ * Connector version
557
+ * Ingestion timestamp
558
+ * Processing run identifier
559
+ * Dataset version
560
+ * Record origin metadata
561
+
562
+ Every stored record must be traceable back to its source.
563
+
564
+ ---
565
+
566
+ # Observability
567
+
568
+ Hermes continuously monitors platform health.
569
+
570
+ Metrics include:
571
+
572
+ * Connector failures
573
+ * Synchronization duration
574
+ * Records processed
575
+ * Records rejected
576
+ * Data freshness
577
+ * API performance
578
+ * Storage utilization
579
+
580
+ Observability enables reliable operations and rapid issue detection.
581
+
582
+ ---
583
+
584
+ # Reliability Requirements
585
+
586
+ Hermes is designed for resilient data operations.
587
+
588
+ Requirements include:
589
+
590
+ * Retry mechanisms
591
+ * Idempotent ingestion
592
+ * Duplicate protection
593
+ * Transactional writes
594
+ * Failure recovery
595
+ * Fault isolation
596
+ * Auditability
597
+
598
+ ---
599
+
600
+ # Scalability Requirements
601
+
602
+ Hermes must scale without architectural redesign.
603
+
604
+ The platform should support:
605
+
606
+ * Additional connectors
607
+ * Additional datasets
608
+ * Increased ingestion volume
609
+ * Increased storage volume
610
+ * Multiple downstream consumers
611
+ * Future storage backends
612
+
613
+ ---
614
+
615
+ # Long-Term Vision
616
+
617
+ Hermes serves as the intelligence data backbone for the broader ecosystem.
618
+
619
+ Future platforms should consume data exclusively through Hermes, including:
620
+
621
+ * Aegis
622
+ * Atlas
623
+ * Aion
624
+ * Internal analytics systems
625
+ * Research platforms
626
+ * Decision-support tools
627
+
628
+ By centralizing acquisition, validation, normalization, storage, and serving, Hermes ensures that data infrastructure is implemented once and reused everywhere.
629
+
630
+ ---
631
+
632
+ # Guiding Principle
633
+
634
+ > Acquire once. Normalize once. Validate once. Serve everywhere.