Skip to content

Installation

Installation

Installation is as simple as:

Python
1
pip install ormar

Dependencies

Ormar uses SQLAlchemy async with DatabaseConnection for connectivity, pydantic for validation and sqlalchemy-core for queries.

Both should install along the installation of ormar if not present at your system before.

  • pydantic
  • sqlalchemy

The required versions are pinned in the pyproject.toml file.

Optional dependencies

ormar has three optional dependencies based on database backend you use:

Database backend

Postgresql

Python
1
pip install ormar[postgresql]
Will install also asyncpg and psycopg2.

Mysql

Python
1
pip install ormar[mysql]

Will install also asyncmy, aiomysql and pymysql.

asyncmy is the recommended async driver (mysql+asyncmy://...): it parses results in C and is noticeably faster on reads than aiomysql. aiomysql (mysql+aiomysql://...) is still supported.

Sqlite

Python
1
pip install ormar[sqlite]

Will install also aiosqlite.

Crypto

Python
1
pip install ormar[crypto]

Will install also cryptography that is required to work with encrypted columns.

Manual installation of dependencies

Of course, you can also install these requirements manually with pip install asyncpg etc.