Metadata-Version: 2.5
Name: djrm
Version: 0.1.0
Summary: Django ORM, migrations, and database backends as a standalone library.
Project-URL: Homepage, https://github.com/viseshrp/djrm
Project-URL: Repository, https://github.com/viseshrp/djrm
Project-URL: Documentation, https://github.com/viseshrp/djrm/blob/main/README.md
Project-URL: Changelog, https://github.com/viseshrp/djrm/blob/main/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/viseshrp/djrm/issues
Project-URL: CI, https://github.com/viseshrp/djrm/actions
Project-URL: Django upstream, https://github.com/django/django
Author: Django Software Foundation and contributors, djrm contributors
Maintainer-email: Visesh Prasad <viseshrprasad@gmail.com>
License-Expression: BSD-3-Clause
License-File: AUTHORS
License-File: LICENSE
License-File: LICENSE.python
Keywords: database,django,migrations,orm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <4.0,>=3.10
Requires-Dist: asgiref>=3.8.1
Requires-Dist: sqlparse>=0.3.1
Requires-Dist: tzdata; sys_platform == 'win32'
Provides-Extra: images
Requires-Dist: pillow>=9.1.0; extra == 'images'
Provides-Extra: mysql
Requires-Dist: mysqlclient>=2.1.1; extra == 'mysql'
Provides-Extra: oracle
Requires-Dist: oracledb>=1.3.2; extra == 'oracle'
Provides-Extra: postgresql
Requires-Dist: psycopg>=3.1.8; extra == 'postgresql'
Provides-Extra: postgresql-legacy
Requires-Dist: psycopg2>=2.9.9; extra == 'postgresql-legacy'
Provides-Extra: yaml
Requires-Dist: pyyaml>=5.1; extra == 'yaml'
Description-Content-Type: text/markdown

# djrm

[![CI](https://github.com/viseshrp/djrm/actions/workflows/main.yml/badge.svg)](https://github.com/viseshrp/djrm/actions/workflows/main.yml)
[![Python versions](https://img.shields.io/pypi/pyversions/djrm.svg?logo=python&logoColor=white)](https://pypi.org/project/djrm/)
[![Coverage](https://codecov.io/gh/viseshrp/djrm/branch/main/graph/badge.svg)](https://codecov.io/gh/viseshrp/djrm)
[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE)

`djrm` packages Django's ORM, migration framework, and database backends as a
standalone library. It keeps the retained Django APIs under the `djrm` import
namespace and omits the web framework.

This is an independent fork. It is not an official Django Software Foundation
project.

## Installation

The distribution, Python import namespace, and command are all named `djrm`.

```console
python -m pip install djrm
```

Release builds are published to PyPI. See
[Maintenance and releases](#maintenance-and-releases) for the release policy.

## Included

- Models, fields, querysets, managers, expressions, and aggregations
- Schema migrations and data migrations
- SQLite, PostgreSQL, MySQL, and Oracle backends
- `djrm.contrib.contenttypes` and `djrm.contrib.postgres`
- Database-focused commands including `makemigrations`, `migrate`,
  `showmigrations`, `dumpdata`, and `loaddata`

HTTP handling, URL routing, views, middleware, templates, forms, auth, admin,
sessions, static files, and other web-facing components are not included. The
package does not provide a compatibility `django` namespace.

## Minimal setup

```python
import djrm
from djrm.conf import settings

settings.configure(
    DATABASES={
        "default": {
            "ENGINE": "djrm.db.backends.sqlite3",
            "NAME": ":memory:",
        }
    },
    DEFAULT_AUTO_FIELD="djrm.db.models.BigAutoField",
    INSTALLED_APPS=[],
)
djrm.setup()
```

Commands use the same settings conventions as Django:

```console
export DJANGO_SETTINGS_MODULE=myproject.settings
djrm migrate
python -m djrm showmigrations
```

`DJANGO_SETTINGS_MODULE` keeps its upstream name. Only Python import paths move
from `django.*` to `djrm.*`.

## Development

Install [uv](https://docs.astral.sh/uv/), then run:

```console
make install
make check
make test
make build
make check-dist
```

`make test` runs the package smoke tests and the retained SQLite ORM suite.

## Maintenance and releases

`main` carries the currently supported Django LTS line. Production builds start
from an exact official Django release tag and use SemVer:

```text
Django 5.2.17 -> djrm 0.1.0
Django 6.2    -> djrm 1.0.0
```

djrm `0.x` corresponds to Django 5.2 LTS, `1.x` corresponds to Django 6.2 LTS,
and each later LTS gets the next major. Within an LTS line, a newer Django patch
tag increments the djrm minor; a djrm-only fix from the same tag increments
the patch. The exact Django tag is recorded as release provenance. The update
tool creates a separate worktree, performs the namespace conversion, applies
the reviewed fork tree delta with a three-way merge, and stops for human review
when upstream changed retained code incompatibly.

```console
uv run python scripts/apply_django_lts.py \
  --django-ref 5.2.17 \
  --output ../djrm-5.2.17
```

See [MAINTENANCE.md](MAINTENANCE.md) for the branch model, release gate, conflict
workflow, and PyPI setup. [SPEC.md](SPEC.md) defines the retained API.

## License and attribution

The retained Django code remains under Django's BSD 3-Clause license. See
[LICENSE](LICENSE), [LICENSE.python](LICENSE.python), and [AUTHORS](AUTHORS).
Django is a registered trademark of the Django Software Foundation.
