Skip to main content

Data mapper and query builder for SQL databases.

Project description

la black luna

Estoult

PyPI PyPI - License PyPI - Python Version Documentation Status

Estoult (pronounced es-too) is a Python toolkit for data mapping with an integrated query builder for SQL databases. It currently supports MySQL, PostgreSQL, and SQLite.

Features:

  • Not an ORM. Estoult doesn't attempt to apply relational algebra to objects.
  • Concise and composable (sub)queries.
  • Easy debugging by displaying any generated SQL in a readable format.
  • Fast. Estoult is NOT an ORM.

Estoult only works with Python 3.9+.

Installation

Install Estoult through pip:

pip install estoult

# or with a specific database driver (postgres or mysql)
pip install estoult[postgres]

Quick Example

from estoult import Schema, Field, Query, SQLiteDatabase

db = SQLiteDatabase("example.db")

class User(db.Schema):
    __tablename__ = "User"
    id = Field(int, primary_key=True)
    name = Field(str)
    age = Field(int)

# Insert a user
user = User.insert({"name": "Artoria", "age": 35})

# Query users
users = (
    Query(User)
    .select()
    .where(User.age > 21)
    .execute()
)

# Update user
User.update({"id": user["id"]}, {"age": 36})

Documentation

Check the documentation for help and getting started.

Contributing

If you have found a bug or would like to see a feature added to Estoult, please submit an issue or a pull request! Likewise if you found something in the documentation unclear or imprecise.

Tests

Tests are run with pytest. Install it using pip:

pip install pytest

Run tests from the shell:

pytest

License

Estoult is licensed under the MIT license (see LICENSE file).

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

estoult-0.8.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

estoult-0.8.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file estoult-0.8.0.tar.gz.

File metadata

  • Download URL: estoult-0.8.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for estoult-0.8.0.tar.gz
Algorithm Hash digest
SHA256 48865a8f4d65a768af70ebabab9ffe0a63e893b57d87fd23ebca12766e4c77d7
MD5 8f84d73347e0bbd8c8931140d923bdcf
BLAKE2b-256 1a671e2d07b779d43be7aea1e1d93fbfa86529f037858a3c5716ddfeeb6ddca1

See more details on using hashes here.

File details

Details for the file estoult-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: estoult-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for estoult-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5afcb8dfc8d08eb49affdcd46731b0479900318ece3d8d98834f03f4ce82013b
MD5 eb94f860a44dcedf38f578dc7ad87b04
BLAKE2b-256 04f0c0b027aa36dd8dbc6ce53bbf5c902290c0b4854139ba91346e9b91f4e05a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page