One ORM Wrapper to Rule Them All
Project description
Xin
A pydantic powered universal ORM wrapper for databases.
This is a python package I created to reuse some functionalities I have had to implement in multiple jobs. For some reason, there aren't any ORM wrappers we can just plug and play. This should help in that area to some extent. I am trying to make it as generalized as possible but data storage services that require paid access may never be part of this package.
Features
- Execute queries on a database.
- Read a database table as a dataframe.
- Write a dataframe to a database table (still under development).
- Flatten and normalize a dataframe with nested structure.
- Serialize a dataframe as a list of pydantic models.
- Deserialize a list of pydantic models as a dataframe.
The primary backend for parsing dataframes is polars due to it's superior performance. Xin supports pandas dataframes as well, however, they are internally converted to polars dataframes first to not compromise performance.
The backend for interacting with SQL databases is sqlalchemy because it supports async features and is the de-facto standard for communicating with SQL databases.
Databases Supported
- MySQL
- PostgreSQL
- SQL Server
- Mongodb
Async Drivers Supported
Xin is async first. It means that if an async driver is available for a database dialect, it will leverage the async driver for better performance when applicable. SQL Server driver PyMSSQL does not have an async variation yet.
- PyMongo for Mongodb. Currently async support is in beta but since PyMongo is natively supporting async features, it's safer to use it rather than a third party package like Motor.
- Asyncpg for PostgreSQL.
- AioMySQL for MySQL.
Plan for Future Database Support
Test Locally
Have docker compose, tox and uv installed. Then run docker compose up -d. Create the environment
uv venv
uv sync --dev --extra formatting --extra docs
uv lock
Then run tox -p
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file univorm-0.3.1.tar.gz.
File metadata
- Download URL: univorm-0.3.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68796cd68ef1c81fd207322ea12e9c9be5d6ac4865bdb3f7e842d3f81740242e
|
|
| MD5 |
69dc3fde764d61da6e4695aba0dc49e6
|
|
| BLAKE2b-256 |
14d04560c973e14476c3cfe688cd6a6cac261303c3d4755b4f0287f44d32350b
|
File details
Details for the file univorm-0.3.1-py3-none-any.whl.
File metadata
- Download URL: univorm-0.3.1-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfeeeb5b4bc42a3b5f134b9c047411fc4397ece4f34400fac05890c228de2b32
|
|
| MD5 |
3c970995511cbdd9c79b901676b81e21
|
|
| BLAKE2b-256 |
2da052584197f71380a466fb62339cee59e43ecba41808930fb716d8a3544761
|