Fatih Kansoy

Software · 24 October 2026

sicilahval: from Ottoman biographies to reusable data

I've developed a Python package for extracting Ottoman personnel records from archival biographies, with the goal of preserving all the original quotations from archival documents. In particular, it doesn't try to convert dates written in the native calendar. (But I should note that my implementation so far does not resolve any ambiguities in what it finds in the source text.) There's also a complementary tool for processing mentions of people's biographies. The result is an extraction with complete integrity from the original text, and which can be used to process Ottoman-era personnel records.

Posted
24 October 2026
Kind
Software
By
Fatih Kansoy
A register page with one record lifted into a table
Contents
  1. Install
  2. Use it in Codex or Claude Code
  3. Use it from Python
  4. A real example: a raise is not a salary
  5. What it saves—and what still needs judgement
  6. Code, methods and citation

I've been working on a Python program called sicilahval to help with this. If you're a historian or economist trying to turn biographical information from the Ottoman Empire into something you can analyze in a spreadsheet, one of the first things you have to do is figure out some way of identifying instances of what you're interested in (e.g. appointments to an office) or extracting data (e.g. dates). I've been working on a program that will let you connect directly from the original sources to the information extracted from them, and preserve all the material in the sources as well.

In practice, this means that you could write an AI-driven workflow in which your language-model assistant reads the text of the Ottoman biography and fills out the structured fields, while Python handles all the preparation of the source texts, validation against your schema, and export to a database. The skill described here can be run inside Codex or Claude Code with either the Turkish or English version of review summaries. And if you want to use local files instead of web sources, no additional model API key or web search is required.

  1. 1. SourceFile, text segments and locations
  2. 2. ReadingAssistant or researcher structures the account
  3. 3. ChecksQuotes, references and declared coverage
  4. 4. DataLinked CSV, JSON and SQLite

Install

Use Python 3.10 or later. This command installs version 0.1.7 from GitHub, including the optional text-PDF reader.

Terminal · installation
python -m pip install \
  "sicilahval[pdf] @ git+https://github.com/kansoy/ottoman-personnel-tools.git@v0.1.7"

Use it in Codex or Claude Code

Install the skill for your assistant, then reload or rescan skills if your client requires it. The host needs file access and Python execution.

Terminal · skill installation
sicilahval install-skill --target codex --scope user
# For Claude Code:
sicilahval install-skill --target claude --scope user

Codex

Codex · request
Use $sicilahval to extract every complete biography and addition
from this file. Preserve native dates, payment components, source
quotations and uncertainty. Return CSV and SQLite with an English
review summary.

Claude Code

Claude Code · request
/sicilahval Extract every complete biography and addition from
this file. Preserve native dates, payment components, source
quotations and uncertainty. Return CSV and SQLite with an English
review summary.

If you are a researcher and need the Turkish version, please ask for it. I am retaining the spelling of words in quotation marks as well as proper names so that researchers working on these books don't have to deal with an extra layer of quoting. When I export columns from tables, I give them fixed names so you can upload them into a standalone skill ZIP (or whatever is compatible with your favorite tools).

Use it from Python

First prepare a document. This writes tagged text, source metadata and a record template into a new directory.

Python · prepare the source
from sicilahval import prepare_source

prepare_source("records.docx", "work", language="en")

Reading step. As the research assistant reads through their text file (work/source.txt) following the documented schema, they fill out a new JSON file (work/records.json) based on the template. The Python preparation step does not run here. In fact, it doesn't even involve any interpretation of what's in the text.

Then validate and export the completed reading:

Python · validate and export
from sicilahval import validate_records, export_records

report = validate_records("work/records.json", "work/source.json")
if not report["valid"]:
    raise ValueError(report["errors"])

export_records("work/records.json", "work/source.json", "data")

If you pass language="tr" then the review notes will be in Turkish. In addition to these 11 linked tables represented as CSV files, the exporter also writes a full JSON representation of this data, and an SQLite database (sicilahval.sqlite) containing the same information about the personal and family background, education, languages, career events, native dates, pay components, legal notes, corrections and uncertainty.

A real example: a raise is not a salary

Manuk Filcancıyan Efendi

Exact supplied archival reference: DH_SAİD_8_86; 167

Mumaileyh Manuk Filcancıyan Efendi'nin maaşı bin üç yüz altı senesi Rebiülevvelinin dördünde yetmiş beş kuruş zammıyla altı yüz yetmiş beş kuruşa iblağ edilmiştir.

Two payment components from the same sentence
ComponentAmountNative date
Increase75 kuruş4 Rebiülevvel AH 1306
Resulting salary675 kuruş4 Rebiülevvel AH 1306
As well as the amounts, it is useful to know what roles they play. The following transcription (with the real example and exported tables) will be part of the tables exported from the transcription. Please note this is not a new inspection and analysis of the archival image, but rather an exportation process that does not change in any way or perform any additional analysis on the original data.

The record notes that he converted to Islam and changed his name to Mahmut Süreyya 4 Rebiülevvel AH 1306. The original expression has been preserved in the native dates. It is not assumed here what his earlier religion had been, nor that he had already changed his name for the whole of the period AH 1306.

Değişiklik 4 Rebiülevvel 1306 (Hicrî) gününe bağlıdır; sonraki din ve ad, önceki dönemlere veya Hicrî 1306 yılının tamamına atanmaz.

Zenop Tangaryan's record has conflicting statements of birth year and I am not resolving them. See below for examples (you'll need to run these locally). I don't try to resolve such inconsistencies, so you'll have to run the examples locally.

Terminal · real examples
sicilahval demo --out manuk-demo --language en
sicilahval demo --out zenop-demo --language tr

Demo exports all of the readings that you have reviewed. The demo doesn't make a new model call, so the list of readings exported includes only those you've already reviewed.

What it saves—and what still needs judgement

It is also good to have this project-level structure because it allows you to do things that are hard to do without it. For example, if you develop a consistent protocol for what to do when you encounter a certain kind of document (and in fact I've found that helpful), you can unambiguously reference quotes and their location in the document. You can clearly separate dates from pay (or components of pay) and so on. If there is any uncertainty about anything, you have an explicit place to record it. And if you need to do any kind of data export, you know how to make it reproducible. Collaboration will be easier too, because the other person can see exactly what you've done, and in turn it will be much easier for you (or anyone else) to reuse the results of one's work on a new study. Finally there is the potential for a kind of Web search connector that allows searches across multiple topics. But this is not a replacement for having these more structured steps.

This works fine for TXT, Markdown, DOCX, text PDF, HTML, common RTF and ODT. Transcriptions or OCR of scanned documents or images must still be checked separately. In particular, note that the tool does not assume zero if a payment is unknown, conviction if an allegation is made, etc. You'll need to be very careful in parsing your input if you want the output to be accurate. There's no automatic identification here for anything that could even conceivably be ambiguous.

The 46 tests documented in the notes on validation all pass with version 0.1.7 of the software. This includes recognition of date formats such as "yirmi beşine" (25) or ablative case forms like "on sekizinden" (18). Also, while this parser should work fine for fields in a CSV file larger than the default limit for text fields, I don't guarantee that it will extract the text correctly. It may well be that some of the text in a field matches a regular expression identifying the type of text I want, but is actually wrong. So you'll still need to use your historical knowledge and judgment and look over the output. Figuring out what to do with place or job codes and merging identity fields are separate decisions from calendar conversion. And turning individual years into person-year panels requires further work.

Sürüm 0.1.7, “on sekizinden” (18) gibi ayrılma ekli günleri ve varsayılan okuyucu sınırını aşan tam CSV alanlarını da doğrular; 46 yazılım testi geçti.

Code, methods and citation

The software is released as open source, under the Apache-2.0 license. If you want to get started using it, you can look at the repository or a three-page description of the methods note.

Kansoy, Fatih (2026). sicilahval: Evidence-linked extraction of Ottoman personnel records. Version 0.1.7. Citation metadata. Cite the historical source separately.

Reference: Sarıyıldız, Gülden (2009). “Sicill-i Ahvâl Defterleri.” TDV İslâm Ansiklopedisi, 37, 134–136.

Contact: kansoy@gmail.com · fatih.ai

Share cards: English PNG · Türkçe PNG

More news

All news