Migrating to v7
New in version 7.0.
Version 7.0 is a major release of the SDK. The headline changes are:
- The database client (
emtellipro-db-client) is now multi-threaded and can submit, process, and save documents in parallel. - The database schema is now configurable. The schema the SDK has always used is still the default (now called the
legacyschema), and additional schemas can be installed as plugins. - The
--store-*and--job-idcommand-line options have been replaced by per-schema save options, set withprocess --save-opt. - The JSON input format has been redesigned and is now fully documented. The old format still works, but is deprecated.
This page summarizes what you need to change when upgrading. Most workflows need only small adjustments to command-line options; the database tables themselves are unchanged.
Database client changes
Parallel processing
The client now processes documents using multiple worker jobs. Use the new -j/--jobs option to control how many run in parallel:
The default is 1, which behaves like previous versions. See Multithreaded database client for full details.
Configurable schemas
How results are laid out in the database is now controlled by a schema, selected with the new --schema option. The schema used by all previous versions of the SDK is now named legacy and remains the default, so if you don’t pass --schema nothing changes: you get the same tables and columns as before, and existing databases can still be migrated with the migrate command.
It is also possible to write your own schema and install it as a plugin; see Pluggable database schemas.
Save options replace the --store-* flags
Because each schema defines its own storage options, the fixed set of --store-* flags (and --job-id) has been replaced by the generic -S/--save-opt option, which can be passed multiple times:
Use this table to translate your existing commands (these are the save options for the default legacy schema; see SaveOptions for the full list):
In the configuration file, save options move from the [process] section into a section keyed by schema name:
Not all options are relevant to set; for example task_id, engine_version, and sql_query will be set by the client based on the processing jobs it sends to the NLP API and the --sql-query option, respectively.
Other renamed and removed options
Remember to update configuration files as well as scripts, since the config keys match the option names.
New options
process --sql-count-queryandprocess --sql-limitgive finer control when reading input documents from a database.debug --ganttwrites a Gantt chart of per-batch stage timings to an image file (requires installing thecli-extrasextra:pip install emtellipro[cli-extras]).
State files
State files created by older versions are not compatible with v7. Finish any in-progress runs with your current version before upgrading, and start v7 runs with a fresh state file.
The new state file no longer contains a copy of every input document; it instead stores unique identifiers for every input document, and records how long each document spent in each processing stage, which the run summary and the debug command can report. This keeps the file size smaller while still supporting restarting processing where it left off (in case of errors or early exits).
New JSON input format
The JSON/JSONL input format has been redesigned to be more structured, and is now thoroughly documented in Input File Formats Supported By The SDK, including a downloadable JSON Schema you can validate your files against.
The main changes to the JSON object keys:
For example, this old-format document:
becomes:
The old format is still accepted, so existing files keep working, but it is deprecated.
Python API changes
If you only use the command-line client you can skip this section.
Database and save options
Database now accepts a schema argument (a schema name or schema object); the default is the legacy schema, which behaves the same as previous versions:
db.save() method still accepts save options as keyword arguments (job_id, store_json, and so on), and now also accepts an options argument taking a schema’s save-options instance directly, e.g. SaveOptions.
The schema’s save options class is also available as an attribute, so you can write somewhat generic code against a schema (the accepted parameters will differ, though).
Moved modules
The database ORM models moved to the legacy schema package.
The table and column definitions themselves are unchanged. The row types module moved likewise, from emtellipro.db.rowtypes to emtellipro.db.schemas.legacy.rowtypes.
The models can be accessed through the schema object, though, so the module doesn’t have to be imported:
All schema objects are guaranteed to have a models attribute, so one can write generic code against that instead of finding the right module to import.
HTTP library
The SDK no longer uses requests for HTTP; it now uses httpx2 (with tenacity handling retries). This is transparent for normal use of the Emtellipro client, and the exceptions raised by the SDK are unchanged.
As the HTTP library has changed, any exceptions that might have been previously caught from requests must be changed to the equivalent httpx2 exception (where relevant).
If you used the emtellipro.auth.EmtelliproAuth class to sign your own requests sessions, it has been removed. Its replacement is sign_request, which signs an httpx2.Request.

