mnema 1.0.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.
- mnema-1.0.0/.github/workflows/ci.yml +90 -0
- mnema-1.0.0/.gitignore +17 -0
- mnema-1.0.0/Cargo.lock +133 -0
- mnema-1.0.0/Cargo.toml +12 -0
- mnema-1.0.0/LICENSE +21 -0
- mnema-1.0.0/PKG-INFO +121 -0
- mnema-1.0.0/README.md +90 -0
- mnema-1.0.0/pyproject.toml +54 -0
- mnema-1.0.0/scripts/bake.py +373 -0
- mnema-1.0.0/src/lib.rs +48 -0
- mnema-1.0.0/src/mnema/__init__.py +135 -0
- mnema-1.0.0/src/mnema/_core.pyi +3 -0
- mnema-1.0.0/src/mnema/_corpus_registry.py +59 -0
- mnema-1.0.0/src/mnema/_data/.gitkeep +0 -0
- mnema-1.0.0/src/mnema/_query.py +276 -0
- mnema-1.0.0/tests/__init__.py +0 -0
- mnema-1.0.0/tests/conftest.py +160 -0
- mnema-1.0.0/tests/test_corpus_registry.py +62 -0
- mnema-1.0.0/tests/test_query.py +358 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ['v*']
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: '3.11'
|
|
21
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
- name: Build wheel
|
|
23
|
+
run: |
|
|
24
|
+
pip install maturin
|
|
25
|
+
maturin build --out dist
|
|
26
|
+
pip install --find-links dist mnema
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: pip install pytest && pytest tests/ -q
|
|
29
|
+
|
|
30
|
+
build-wheels:
|
|
31
|
+
needs: test
|
|
32
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
33
|
+
strategy:
|
|
34
|
+
matrix:
|
|
35
|
+
include:
|
|
36
|
+
- os: ubuntu-latest
|
|
37
|
+
target: x86_64
|
|
38
|
+
- os: windows-latest
|
|
39
|
+
target: x86_64
|
|
40
|
+
- os: macos-latest
|
|
41
|
+
target: x86_64
|
|
42
|
+
- os: macos-latest
|
|
43
|
+
target: aarch64
|
|
44
|
+
runs-on: ${{ matrix.os }}
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
- uses: PyO3/maturin-action@v1
|
|
48
|
+
with:
|
|
49
|
+
target: ${{ matrix.target }}
|
|
50
|
+
args: --release --out dist --find-interpreter
|
|
51
|
+
sccache: 'true'
|
|
52
|
+
manylinux: auto
|
|
53
|
+
- uses: actions/upload-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
56
|
+
path: dist/
|
|
57
|
+
|
|
58
|
+
sdist:
|
|
59
|
+
needs: test
|
|
60
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
- uses: PyO3/maturin-action@v1
|
|
65
|
+
with:
|
|
66
|
+
command: sdist
|
|
67
|
+
args: --out dist
|
|
68
|
+
- uses: actions/upload-artifact@v4
|
|
69
|
+
with:
|
|
70
|
+
name: sdist
|
|
71
|
+
path: dist/
|
|
72
|
+
|
|
73
|
+
publish:
|
|
74
|
+
needs: [build-wheels, sdist]
|
|
75
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
environment: pypi
|
|
78
|
+
permissions:
|
|
79
|
+
id-token: write
|
|
80
|
+
steps:
|
|
81
|
+
- uses: actions/download-artifact@v4
|
|
82
|
+
with:
|
|
83
|
+
pattern: wheels-*
|
|
84
|
+
merge-multiple: true
|
|
85
|
+
path: dist/
|
|
86
|
+
- uses: actions/download-artifact@v4
|
|
87
|
+
with:
|
|
88
|
+
name: sdist
|
|
89
|
+
path: dist/
|
|
90
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
mnema-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
target/
|
|
7
|
+
Cargo.lock
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
|
|
11
|
+
# Firebase credentials — NEVER commit these
|
|
12
|
+
*firebase-adminsdk*.json
|
|
13
|
+
*service-account*.json
|
|
14
|
+
*serviceAccount*.json
|
|
15
|
+
serviceAccountKey.json
|
|
16
|
+
credentials*.json
|
|
17
|
+
*-credentials.json
|
mnema-1.0.0/Cargo.lock
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "heck"
|
|
7
|
+
version = "0.5.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "libc"
|
|
13
|
+
version = "0.2.186"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "mnema-core"
|
|
19
|
+
version = "1.0.0"
|
|
20
|
+
dependencies = [
|
|
21
|
+
"pyo3",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[[package]]
|
|
25
|
+
name = "once_cell"
|
|
26
|
+
version = "1.21.4"
|
|
27
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
28
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
29
|
+
|
|
30
|
+
[[package]]
|
|
31
|
+
name = "portable-atomic"
|
|
32
|
+
version = "1.13.1"
|
|
33
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
+
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
35
|
+
|
|
36
|
+
[[package]]
|
|
37
|
+
name = "proc-macro2"
|
|
38
|
+
version = "1.0.106"
|
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
41
|
+
dependencies = [
|
|
42
|
+
"unicode-ident",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[[package]]
|
|
46
|
+
name = "pyo3"
|
|
47
|
+
version = "0.28.3"
|
|
48
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
49
|
+
checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
|
|
50
|
+
dependencies = [
|
|
51
|
+
"libc",
|
|
52
|
+
"once_cell",
|
|
53
|
+
"portable-atomic",
|
|
54
|
+
"pyo3-build-config",
|
|
55
|
+
"pyo3-ffi",
|
|
56
|
+
"pyo3-macros",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[[package]]
|
|
60
|
+
name = "pyo3-build-config"
|
|
61
|
+
version = "0.28.3"
|
|
62
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
|
+
checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
|
|
64
|
+
dependencies = [
|
|
65
|
+
"target-lexicon",
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[[package]]
|
|
69
|
+
name = "pyo3-ffi"
|
|
70
|
+
version = "0.28.3"
|
|
71
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
72
|
+
checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
|
|
73
|
+
dependencies = [
|
|
74
|
+
"libc",
|
|
75
|
+
"pyo3-build-config",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
[[package]]
|
|
79
|
+
name = "pyo3-macros"
|
|
80
|
+
version = "0.28.3"
|
|
81
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
82
|
+
checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
|
|
83
|
+
dependencies = [
|
|
84
|
+
"proc-macro2",
|
|
85
|
+
"pyo3-macros-backend",
|
|
86
|
+
"quote",
|
|
87
|
+
"syn",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[[package]]
|
|
91
|
+
name = "pyo3-macros-backend"
|
|
92
|
+
version = "0.28.3"
|
|
93
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
+
checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
|
|
95
|
+
dependencies = [
|
|
96
|
+
"heck",
|
|
97
|
+
"proc-macro2",
|
|
98
|
+
"pyo3-build-config",
|
|
99
|
+
"quote",
|
|
100
|
+
"syn",
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
[[package]]
|
|
104
|
+
name = "quote"
|
|
105
|
+
version = "1.0.45"
|
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
108
|
+
dependencies = [
|
|
109
|
+
"proc-macro2",
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
[[package]]
|
|
113
|
+
name = "syn"
|
|
114
|
+
version = "2.0.117"
|
|
115
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
116
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
117
|
+
dependencies = [
|
|
118
|
+
"proc-macro2",
|
|
119
|
+
"quote",
|
|
120
|
+
"unicode-ident",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[[package]]
|
|
124
|
+
name = "target-lexicon"
|
|
125
|
+
version = "0.13.5"
|
|
126
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
127
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
128
|
+
|
|
129
|
+
[[package]]
|
|
130
|
+
name = "unicode-ident"
|
|
131
|
+
version = "1.0.24"
|
|
132
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
133
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
mnema-1.0.0/Cargo.toml
ADDED
mnema-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrew Watts
|
|
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.
|
mnema-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mnema
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Database
|
|
14
|
+
Classifier: Topic :: Education
|
|
15
|
+
Requires-Dist: eyecore>=1.0.0
|
|
16
|
+
Requires-Dist: requests>=2.28 ; extra == 'bake'
|
|
17
|
+
Requires-Dist: pytest>=7.0 ; extra == 'test'
|
|
18
|
+
Requires-Dist: pytest-cov>=4.0 ; extra == 'test'
|
|
19
|
+
Provides-Extra: bake
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Summary: Historical events, figures, periods, and civilizations
|
|
23
|
+
Keywords: history,historical figures,civilizations,periods,encyclopedia
|
|
24
|
+
Author-email: Andrew Watts <andrewkwatts@gmail.com>
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
27
|
+
Project-URL: Homepage, https://github.com/andrewkwatts-maker/Mnema
|
|
28
|
+
Project-URL: Issues, https://github.com/andrewkwatts-maker/Mnema/issues
|
|
29
|
+
Project-URL: Repository, https://github.com/andrewkwatts-maker/Mnema
|
|
30
|
+
|
|
31
|
+
# mnema
|
|
32
|
+
|
|
33
|
+
Historical encyclopedia for Python — figures, events, periods, cultures, wars, and artifacts from across recorded history.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- Historical figures, events, periods, cultures, wars, and artifacts
|
|
38
|
+
- Full-text search with FTS5 fallback to LIKE
|
|
39
|
+
- Era-based browsing (ancient, medieval, modern, etc.)
|
|
40
|
+
- Fuzzy name matching and random sampling
|
|
41
|
+
- Topic graph for related entry discovery
|
|
42
|
+
- On-demand corpus checkout from Project Gutenberg (downloaded once, cached locally)
|
|
43
|
+
- Optional LLM integration for intelligent queries
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install mnema
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import mnema
|
|
55
|
+
|
|
56
|
+
# Look up by type
|
|
57
|
+
figure = mnema.GetFigure("Julius Caesar")
|
|
58
|
+
event = mnema.GetEvent("Battle of Thermopylae")
|
|
59
|
+
period = mnema.GetPeriod("Roman Republic")
|
|
60
|
+
culture = mnema.GetCulture("Byzantine")
|
|
61
|
+
war = mnema.GetWar("Peloponnesian War")
|
|
62
|
+
|
|
63
|
+
# Generic lookup and full-text search
|
|
64
|
+
entry = mnema.Get("Hannibal")
|
|
65
|
+
results = mnema.Search("Roman Empire")
|
|
66
|
+
|
|
67
|
+
# Browse by era or type
|
|
68
|
+
ancient = mnema.ByEra("ancient")
|
|
69
|
+
figures = mnema.ByType("figure", "medieval")
|
|
70
|
+
all_fig = mnema.AllFigures("roman")
|
|
71
|
+
events = mnema.AllEvents("ancient")
|
|
72
|
+
|
|
73
|
+
# Random, fuzzy, and statistics
|
|
74
|
+
random_ = mnema.GetRandom("figure")
|
|
75
|
+
matches = mnema.GetFuzzy("caesar")
|
|
76
|
+
popular = mnema.GetMost("mythology") # 'mythology' column = era
|
|
77
|
+
total = mnema.Count()
|
|
78
|
+
|
|
79
|
+
# Topic graph
|
|
80
|
+
related = mnema.GetRelated("Julius Caesar")
|
|
81
|
+
topics = mnema.GetTopics("roman")
|
|
82
|
+
tree = mnema.GetTopicTree("ancient-rome")
|
|
83
|
+
|
|
84
|
+
# Corpus — downloads from Project Gutenberg on first use
|
|
85
|
+
mnema.FetchCorpus("gutenberg-plutarch")
|
|
86
|
+
hits = mnema.SearchCorpus("assassination")
|
|
87
|
+
sources = mnema.ListCorpuses()
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Available corpuses
|
|
91
|
+
|
|
92
|
+
| Corpus ID | Text |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `gutenberg-herodotus` | Herodotus's Histories |
|
|
95
|
+
| `gutenberg-thucydides` | Thucydides's History of the Peloponnesian War |
|
|
96
|
+
| `gutenberg-plutarch` | Plutarch's Lives |
|
|
97
|
+
| `gutenberg-caesar` | Julius Caesar's Gallic Wars |
|
|
98
|
+
| `gutenberg-tacitus` | Tacitus's Annals |
|
|
99
|
+
| `gutenberg-livy` | Livy's History of Rome |
|
|
100
|
+
| `gutenberg-sun-tzu` | Sun Tzu's The Art of War |
|
|
101
|
+
| `gutenberg-machiavelli` | Machiavelli's The Prince |
|
|
102
|
+
| `gutenberg-gibbon` | Gibbon's Decline and Fall of the Roman Empire |
|
|
103
|
+
| `gutenberg-marco-polo` | Marco Polo's Travels |
|
|
104
|
+
| `gutenberg-federalist` | The Federalist Papers |
|
|
105
|
+
| `gutenberg-common-sense` | Thomas Paine's Common Sense |
|
|
106
|
+
| `gutenberg-darwin` | Darwin's On the Origin of Species |
|
|
107
|
+
| `gutenberg-wealth-of-nations` | Adam Smith's The Wealth of Nations |
|
|
108
|
+
|
|
109
|
+
## Part of the Eyes of Azrael suite
|
|
110
|
+
|
|
111
|
+
| Package | Description |
|
|
112
|
+
|---|---|
|
|
113
|
+
| [`eyecore`](https://github.com/EyesOfAzrael/eyecore) | Shared foundation (DB, graph, corpus, LLM) |
|
|
114
|
+
| [`azrael`](https://github.com/EyesOfAzrael/azrael) | Mythology encyclopedia |
|
|
115
|
+
| [`apocrypha`](https://github.com/EyesOfAzrael/apocrypha) | Conspiracy theories and hidden histories |
|
|
116
|
+
| [`augur`](https://github.com/EyesOfAzrael/augur) | News aggregation and topic analysis |
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
MIT — see [LICENSE](LICENSE)
|
|
121
|
+
|
mnema-1.0.0/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# mnema
|
|
2
|
+
|
|
3
|
+
Historical encyclopedia for Python — figures, events, periods, cultures, wars, and artifacts from across recorded history.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Historical figures, events, periods, cultures, wars, and artifacts
|
|
8
|
+
- Full-text search with FTS5 fallback to LIKE
|
|
9
|
+
- Era-based browsing (ancient, medieval, modern, etc.)
|
|
10
|
+
- Fuzzy name matching and random sampling
|
|
11
|
+
- Topic graph for related entry discovery
|
|
12
|
+
- On-demand corpus checkout from Project Gutenberg (downloaded once, cached locally)
|
|
13
|
+
- Optional LLM integration for intelligent queries
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install mnema
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import mnema
|
|
25
|
+
|
|
26
|
+
# Look up by type
|
|
27
|
+
figure = mnema.GetFigure("Julius Caesar")
|
|
28
|
+
event = mnema.GetEvent("Battle of Thermopylae")
|
|
29
|
+
period = mnema.GetPeriod("Roman Republic")
|
|
30
|
+
culture = mnema.GetCulture("Byzantine")
|
|
31
|
+
war = mnema.GetWar("Peloponnesian War")
|
|
32
|
+
|
|
33
|
+
# Generic lookup and full-text search
|
|
34
|
+
entry = mnema.Get("Hannibal")
|
|
35
|
+
results = mnema.Search("Roman Empire")
|
|
36
|
+
|
|
37
|
+
# Browse by era or type
|
|
38
|
+
ancient = mnema.ByEra("ancient")
|
|
39
|
+
figures = mnema.ByType("figure", "medieval")
|
|
40
|
+
all_fig = mnema.AllFigures("roman")
|
|
41
|
+
events = mnema.AllEvents("ancient")
|
|
42
|
+
|
|
43
|
+
# Random, fuzzy, and statistics
|
|
44
|
+
random_ = mnema.GetRandom("figure")
|
|
45
|
+
matches = mnema.GetFuzzy("caesar")
|
|
46
|
+
popular = mnema.GetMost("mythology") # 'mythology' column = era
|
|
47
|
+
total = mnema.Count()
|
|
48
|
+
|
|
49
|
+
# Topic graph
|
|
50
|
+
related = mnema.GetRelated("Julius Caesar")
|
|
51
|
+
topics = mnema.GetTopics("roman")
|
|
52
|
+
tree = mnema.GetTopicTree("ancient-rome")
|
|
53
|
+
|
|
54
|
+
# Corpus — downloads from Project Gutenberg on first use
|
|
55
|
+
mnema.FetchCorpus("gutenberg-plutarch")
|
|
56
|
+
hits = mnema.SearchCorpus("assassination")
|
|
57
|
+
sources = mnema.ListCorpuses()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Available corpuses
|
|
61
|
+
|
|
62
|
+
| Corpus ID | Text |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `gutenberg-herodotus` | Herodotus's Histories |
|
|
65
|
+
| `gutenberg-thucydides` | Thucydides's History of the Peloponnesian War |
|
|
66
|
+
| `gutenberg-plutarch` | Plutarch's Lives |
|
|
67
|
+
| `gutenberg-caesar` | Julius Caesar's Gallic Wars |
|
|
68
|
+
| `gutenberg-tacitus` | Tacitus's Annals |
|
|
69
|
+
| `gutenberg-livy` | Livy's History of Rome |
|
|
70
|
+
| `gutenberg-sun-tzu` | Sun Tzu's The Art of War |
|
|
71
|
+
| `gutenberg-machiavelli` | Machiavelli's The Prince |
|
|
72
|
+
| `gutenberg-gibbon` | Gibbon's Decline and Fall of the Roman Empire |
|
|
73
|
+
| `gutenberg-marco-polo` | Marco Polo's Travels |
|
|
74
|
+
| `gutenberg-federalist` | The Federalist Papers |
|
|
75
|
+
| `gutenberg-common-sense` | Thomas Paine's Common Sense |
|
|
76
|
+
| `gutenberg-darwin` | Darwin's On the Origin of Species |
|
|
77
|
+
| `gutenberg-wealth-of-nations` | Adam Smith's The Wealth of Nations |
|
|
78
|
+
|
|
79
|
+
## Part of the Eyes of Azrael suite
|
|
80
|
+
|
|
81
|
+
| Package | Description |
|
|
82
|
+
|---|---|
|
|
83
|
+
| [`eyecore`](https://github.com/EyesOfAzrael/eyecore) | Shared foundation (DB, graph, corpus, LLM) |
|
|
84
|
+
| [`azrael`](https://github.com/EyesOfAzrael/azrael) | Mythology encyclopedia |
|
|
85
|
+
| [`apocrypha`](https://github.com/EyesOfAzrael/apocrypha) | Conspiracy theories and hidden histories |
|
|
86
|
+
| [`augur`](https://github.com/EyesOfAzrael/augur) | News aggregation and topic analysis |
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT — see [LICENSE](LICENSE)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.4,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mnema"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Historical events, figures, periods, and civilizations"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Andrew Watts", email = "andrewkwatts@gmail.com"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["history", "historical figures", "civilizations", "periods", "encyclopedia"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Topic :: Database",
|
|
27
|
+
"Topic :: Education",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
dependencies = [
|
|
31
|
+
"eyecore>=1.0.0",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
bake = [
|
|
36
|
+
"requests>=2.28",
|
|
37
|
+
]
|
|
38
|
+
test = [
|
|
39
|
+
"pytest>=7.0",
|
|
40
|
+
"pytest-cov>=4.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/andrewkwatts-maker/Mnema"
|
|
45
|
+
Repository = "https://github.com/andrewkwatts-maker/Mnema"
|
|
46
|
+
Issues = "https://github.com/andrewkwatts-maker/Mnema/issues"
|
|
47
|
+
|
|
48
|
+
[tool.maturin]
|
|
49
|
+
python-source = "src"
|
|
50
|
+
module-name = "mnema._core"
|
|
51
|
+
features = ["pyo3/extension-module"]
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
testpaths = ["tests"]
|