Why a package
The problem with the text of a Sicill-i Ahvâl is that it all tends to run together. What you have is one continuous block of text describing an official's career, his family when he was born, what languages he was educated in, where he was posted and how much he got paid and so on and so forth. So if you want to ask questions about this stuff (what appointments did they hold, when, and what were they paid?) you need columns like "appointments" and "dates" and "salary." But I didn't want to lose the original flavor of the text, at least not more than was necessary. So I wrote a program called sicilahval that would let me express a common schema for this type of text, in such a way as to preserve its flavor but also allow me to audit it and share my readings.
The advantage of this schema is that it distinguishes unambiguously between these three categories. You can see whether a given statement is stated explicitly in the text, or whether you have to make any inferences as a reader, and if so what they are. And if there are conflicting interpretations of a sentence that came from the same original statement (when the source text can be read more than one way), these will be visible also.
How it works
The workflow is to split the work between a language model and a Python program. Use the language model (or other assistant) to read and extract structure from a biography, and use my Python program to do all the necessary text processing and table creation. For the reading part I'll use an existing assistant like OpenAI's Codex or Anthropic's Claude Code. My Python package doesn't call any language model, so you don't need an API key to use it.
Prepare
Python then reads the source file, splits it into numbered segments, and computes the SHA-256 cryptographic checksum of the original text. I give each segment a unique identifier.
Read
The language model represents each biography as an explicit representation of the set of interrelated facts about each official's life. Each fact would include not only historical events and their dates, but all information about payments (with exact citation to the source where each fact was found).
Validate
And finally I can write a program that checks the structure of the schema, makes sure all the checksums in the data match up with the schema, and so on. In other words, a program that validates the quotations, numbers, and all my decisions about what to cover (or not) for each segment of text, and that everything is properly formatted.
Export
You can export verified readings directly to linked CSV tables, a complete JSON file, or an SQLite database. of all cells will be exported in an identical manner and without any further processing. Multiple file formats are available.
python -m pip install "sicilahval @ git+https://github.com/kansoy/ottoman-personnel-tools.git@v0.1.7" sicilahval install-skill --target claude --scope user
sicilahval prepare records.docx --out work --language en # The language model reads the text and writes work/records.json. sicilahval validate work/records.json --source work/source.json sicilahval export work/records.json --source work/source.json --out data
What the checks catch
The validation routines are all pretty mechanical. The boundaries between whole numbers (and so on) are all handled very strictly. I can't even add "150 kuruş" to the line that says "1150 kuruş". Among other things, version 0.1.3 now includes a bunch of regression tests to make sure I handle decimal points and plus and minus signs and so on.
def _raw_attached(raw: str, quotes: list[str], *, monetary: bool = False) -> bool:
if not monetary:
return any(raw in quote for quote in quotes)
for quote in quotes:
# Check the source's complete digit tokens even when raw includes a
# currency: "150 kuruş" must not attach to "1150 kuruş". A comma or
# full stop extends a number only when another digit follows it.
numbers = list(re.finditer(
r"[+-]?\d{1,3}(?:[ ]\d{3})+(?!\d)(?:[.,]\d+)*|[+-]?\d+(?:[.,]\d+)*", quote))
for match in re.finditer(re.escape(raw), quote):
if not any(number.start() < match.end() and number.end() > match.start()
and (number.start() < match.start() or number.end() > match.end())
for number in numbers):
return True
return False
A real record
In this repository I include two full biographies of register entries (with references to the archival sources) including Manuk Filcancıyan who converted to Islam and changed his name to Mahmut Süreyya in 4 Rebiülevvel AH 1306. In this version, I interpret the name change as limited to 4 Rebiülevvel AH 1306 (not across all of AH 1306) so that one can regenerate all tables from this biography .
sicilahval demo --out example-output --language en
In the table of payment descriptions just described, you can see this for an example salary expressed in words. The transformation to the corresponding numeric value is shown together with an indication of the precise phrasing from which the figure was generated.
| Date in the record | Year | Event | Amount as written | Kuruş |
|---|---|---|---|---|
| 1 Muharrem 1286 | 1869/70 | Appointment to the Diyarbakır telegraph office | yedi yüz yirmi | 720 |
| 14 Rebiülahir 1287 | 1870/71 | Transfer to the Beyoğlu telegraph centre | dört yüz seksen | 480 |
| 26 Zilkade 1293 | 1876/77 | Rise on reorganisation | yedi yüz elli | 750 |
| 2 Rebiülahir 1297 | 1879/80 | Reduction | altı yüz | 600 |
| 4 Rebiülevvel 1306 | 1888/89 | Rise, the increment | yetmiş beş | 75 |
| 4 Rebiülevvel 1306 | 1888/89 | Rise, the new salary | altı yüz yetmiş beş | 675 |
In addition, in a second pass of this review process, the extraction of both biographies was refreshed and again found to correspond precisely to the archival text provided as input. All 28 segments of source text are explicitly marked for coverage decisions, and both exports now also pass not only the quotation, reference, and CSV-to-SQLite cell parsing tests described above but also the further 46 unit tests shipped with version 0.1.7.
| Record | Facts | Events | Dates | Payments |
|---|---|---|---|---|
| Manuk Filcancıyan, later Mahmut Süreyya | 33 | 14 | 14 | 6 |
| Zenop Tangaryan | 38 | 21 | 25 | 10 |
Limits
Automated validation can't guarantee historical accuracy and completeness on its own. So it is important that when the text of a difficult passage is ambiguous there is still a way for a human reader to compare against the source. The package doesn't do handwriting recognition, so the images or scans will need to be converted into some verified transcription (or an OCR'd version) before using this software. Linking between registers and coding places and jobs, and building person-year panels are separate empirical decisions left to the researcher.
The software, the skill and the documentation are released under the Apache-2.0 licence. Cite it as Kansoy, Fatih. 2026. sicilahval: Evidence-linked extraction of Ottoman personnel records. Version 0.1.7.