Metadata-Version: 2.5
Name: subjectdb
Version: 1.0.0
Summary: Desktop app to register study participants across research projects (SQLite + Qt).
Project-URL: Homepage, https://github.com/Fayed-Rsl/subjectdb
Project-URL: Documentation, https://github.com/Fayed-Rsl/subjectdb/blob/main/src/subjectdb/docs/tutorial.md
Project-URL: Issues, https://github.com/Fayed-Rsl/subjectdb/issues
Project-URL: Changelog, https://github.com/Fayed-Rsl/subjectdb/blob/main/CHANGELOG.md
Author: Fayed Rassoulou
License-Expression: MIT AND OFL-1.1 AND ISC
License-File: LICENSE
License-File: src/subjectdb/gui/assets/fonts/OFL.txt
License-File: src/subjectdb/gui/assets/icons/LICENSE
Keywords: bids,participants,pyside6,research,sqlite,subjects
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.10
Requires-Dist: openpyxl>=3.1
Requires-Dist: pyside6-essentials>=6.8
Description-Content-Type: text/markdown

# SubjectDB

**A small desktop app to register the people who take part in your studies, across all your
research projects.** Every person gets an ID per project (`rhm007`, which is also the BIDS folder
`sub-rhm007`); names and birthdates stay in one protected file, and a copy without names is kept
up to date for analyses.

![SubjectDB: the Subjects page](https://raw.githubusercontent.com/Fayed-Rsl/subjectdb/main/src/subjectdb/docs/images/hero.png)

## Features

- **Two modes.** Researchers add subjects (`subjectdb`) and never see stored personal data. The
  PI (`subjectdb-pi`) also finds, edits, deletes and imports subjects and manages projects.
- **IDs done for you.** The next free number is suggested; a number that is taken is refused, also
  when two people save at the same moment.
- **The same person in several projects** is recognised by name and birthdate (case and accents
  ignored, so `Müller` = `MUELLER`) and simply joins the new project.
- **Clean values everywhere.** `PD`, `parkinson's` and `Morbus Parkinson` are all stored as
  *Parkinson Disease*; sex, handedness and dates follow one set of rules in the form, the Excel
  import and the upgrade.
- **Find subjects fast**: an accent-insensitive, ID-aware search (`7`, `rhm7`, `sub-rhm007`),
  filters by project, disease and age group, and an export of the rows shown (IDs, birthdates and
  diagnoses, never names).
- **Excel import** from a template with dropdown lists, with a preview (*New / Add to project /
  Already in project / Error*) before anything is saved, and a safety copy before every import.
- **Projects** with their metadata: authors, funding, description, sessions, tasks and
  acquisitions, and their own list of diseases.
- **A shared copy without names** (birth and diagnosis years only), rebuilt after every save,
  for analyses with SQLite or pandas.
- **Works with the existing databases** of the old lab app: a one-time, reviewed upgrade in place,
  after an automatic backup.
- **Illustrated tutorial** built in: **Help → Tutorial**, also offline.

## Install

Python 3.10 or newer, no admin rights needed. SubjectDB gets its own environment (a plain
`pip install` is refused by many system Pythons):

```
python3 -m venv ~/subjectdb-env
~/subjectdb-env/bin/pip install subjectdb
~/subjectdb-env/bin/subjectdb --check --data-dir /path/to/database   # says what is missing and how to fix it
```

The environment holds the two commands, `~/subjectdb-env/bin/subjectdb` and
`~/subjectdb-env/bin/subjectdb-pi`. (`pipx install subjectdb` works too and puts both on the PATH.)

## Quick start

1. Start the PI app: `~/subjectdb-env/bin/subjectdb-pi`.
2. Choose an empty folder and click **Create new databases here** (or choose the folder that
   already holds `subject_database.db`).
3. **Projects → New project**: a name, an ID prefix and the diseases.
4. **Add subject**: choose the project, type the person, save. The BIDS label (`sub-…`) is shown
   with a Copy button.

Researchers start `subjectdb` and choose the same folder.

## Documentation

- [Tutorial](https://github.com/Fayed-Rsl/subjectdb/blob/main/src/subjectdb/docs/tutorial.md):
  every step with pictures, in simple words.
- [Databases](https://github.com/Fayed-Rsl/subjectdb/blob/main/src/subjectdb/docs/databases.md):
  the three files, the rules for values, the tables, the upgrade, backups, queries and the
  server installation.
- [Changelog](https://github.com/Fayed-Rsl/subjectdb/blob/main/CHANGELOG.md)

From a source checkout, `python run.py` starts researcher mode and `python run_pi.py` PI mode.

## License

MIT © Fayed Rassoulou. Bundled: the [Inter](https://rsms.me/inter/) typeface (SIL Open Font
License 1.1) and [Lucide](https://lucide.dev) icons (ISC License). The package licence expression
is `MIT AND OFL-1.1 AND ISC`.
