MongoX is an async python ODM for MongoDB which is built on top Motor and Pydantic.

Overview

Build Status Publish Status Coverage Package version


MongoX

MongoX is an async python ODM (Object Document Mapper) for MongoDB which is built on top Motor and Pydantic.

The main features include:

  • Fully type annotated
  • Async support Python 3.7+ (since it's built on top of Motor)
  • Elegant editor support (since it's built on top of Pydantic)
  • Autocompletion everywhere, from object creation to query results
  • Custom query builder which is more intuitive and pythonic
  • 100% test coverage

MongoX models are at the same time Pydantic models and have the same functionalitties, so you can use them with your existing Pydantic models.


Documentation: https://aminalaee.github.io/mongox


Installation

$ pip install mongox

Quickstart

You can define mongox models the same way you define Pydantic models. The difference is they should inherit from mongox.Model now:

import asyncio

import mongox

client = mongox.Client(
    "mongodb://localhost:27017", get_event_loop=asyncio.get_running_loop
)
db = client.get_database("test_db")


class Movie(mongox.Model):
    name: str
    year: int

    class Meta:
        collection = db.get_collection("movies")

Now you can create some instances and insert them into the database:

movie = await Movie(name="Forrest Gump", year=1994).insert()

The returned result will be a Movie instance, and mypy will understand that this is a Movie instance. So you will have type hints and validations everywhere:

MongoX insert screenshot

Now you can fetch some data from the database.

You can use the same pattern as PyMongo/Motor:

movie = await Movie.query({"name": "Forrest Gump"}).get()

The returned result will be a Movie instance, and mypy will understand that this is a Movie instance.

This will have great IDE support, autocompletion and validation.

MongoX get screenshot

Or you can use Movie fields instead of dictionaries in the query (less room for bugs):

movie = await Movie.query({Movie.name: "Forrest Gump"}).get()

And finally you can use a more intuitive query (limited yet):

movie = await Movie.query(Movie.name == "Forrest Gump").get()

Notice how we omitted the dictionary and passed the Movie fields in comparison.


Please refer to the documentation here or the full examples here.


Comments
  • Possible error in the return of the update method

    Possible error in the return of the update method

    I have been creating the update_or_create method based on the get_or_create and update methods, doing some tests I found a possible bug in the update method.

    in the database I have the following data.

    [
      {
        "name": "Venom",
        "year": 2023
      },{
        "name": "Venom2",
        "year": 2021
      }
    ]
    

    and when executing the next query Movie.query({Movie.name: "Venom"}).update({Movie.year: 2021}), what I would expect is for the method to return

    [
      {
        "name": "Venom",
        "year": 2021
      }
    ]
    

    But what it returns is

    [
      {
        "name": "Venom",
        "year": 2021
      },{
        "name": "Venom2",
        "year": 2021
      }
    ]
    

    Is this a bug or is expected to happen?

    bug 
    opened by MAD-py 16
  • Querying inside lists

    Querying inside lists

    Need tests and probably fixes for querying inside a List field:

    import mongox
    
    
    class Movie(mongox.Model):
        name: str
        year: int
       tags: List[str]
    

    Need to be able to query inside the tags fields. Maybe like this:

    await Movie.query(Movie.tags == ["A", "B"])
    
    await Movie.query(Q.contains(Movie.tags, ["A", "B"]))
    

    Any feedback would be appreciated.

    enhancement 
    opened by aminalaee 15
  • Get or Create method

    Get or Create method

    add get_or_create:

    class Movie(mongox.Model):
        name: str
        year: int
    
        class Meta:
            collection = db.get_collection("movies")
    
    movie = await Movie.query({Movie.name: "Forrest Gump"}).get_or_create({Movie.year: 2003})
    assert movie.name == "Forrest Gump"
    assert movie.year == 2003
    
    • [x] docs
    • [x] test
    opened by MAD-py 14
  • Correction of the bug in the return of the update

    Correction of the bug in the return of the update

    Hey @aminalaee,

    This would be the solution to bug #27, I still have to update the documentation but first I would like to know what do you think about the solution?

    opened by MAD-py 8
  • Removing Meta class from Model definition

    Removing Meta class from Model definition

    As it was suggested in #4, I think it would be nice to remove the Meta class, at least from the documentation but it will still work if defined:

    class Movie(Model, db=db, collection="movies"):
        name: str
        year: int
    

    Instead of:

    class Movie(mongox.Model):
        name: str
        year: int
    
        class Meta:
            collection = db.get_collection("movies")
    

    We could also remove db and accept Collection instances, but I think this will be easier.

    Update: Ass suggested by @MAD-py we the db argument will be required and the collection will be <class_name>s if not provided.

    opened by aminalaee 7
  • maybe can provide Model.get() function for get obj by id?

    maybe can provide Model.get() function for get obj by id?

    Although we can use Model.query({"_id": id}).first() to get object by id,But maybe it's better to use a shotcut function like:

    Model.get("id")
    
    opened by ischaojie 4
  • Bump starlette from 0.20.1 to 0.21.0

    Bump starlette from 0.20.1 to 0.21.0

    Bumps starlette from 0.20.1 to 0.21.0.

    Release notes

    Sourced from starlette's releases.

    Version 0.21.0

    This release replaces the underlying HTTP client used on the TestClient (requests :arrow_right: httpx), and as those clients differ a bit on their API, your test suite will likely break. To make the migration smoother, you can use the bump-testclient tool.

    Changed

    • Replace requests with httpx in TestClient #1376.

    Added

    • Add WebSocketException and support for WebSocket exception handlers #1263.
    • Add middleware parameter to Mount class #1649.
    • Officially support Python 3.11 1863.
    • Implement __repr__ for route classes #1864.

    Fixed

    • Fix bug on which BackgroundTasks were cancelled when using BaseHTTPMiddleware and client disconnected #1715.

    Version 0.20.4

    Fixed

    • Remove converter from path when generating OpenAPI schema #1648.

    Version 0.20.3

    Fixed

    • Revert "Allow StaticFiles to follow symlinks" #1681.

    Version 0.20.2

    Fixed

    • Fix regression on route paths with colons #1675.
    • Allow StaticFiles to follow symlinks #1337.
    Changelog

    Sourced from starlette's changelog.

    0.21.0

    September 26, 2022

    This release replaces the underlying HTTP client used on the TestClient (requests :arrow_right: httpx), and as those clients differ a bit on their API, your test suite will likely break. To make the migration smoother, you can use the bump-testclient tool.

    Changed

    • Replace requests with httpx in TestClient #1376.

    Added

    • Add WebSocketException and support for WebSocket exception handlers #1263.
    • Add middleware parameter to Mount class #1649.
    • Officially support Python 3.11 1863.
    • Implement __repr__ for route classes #1864.

    Fixed

    • Fix bug on which BackgroundTasks were cancelled when using BaseHTTPMiddleware and client disconnected #1715.

    0.20.4

    June 28, 2022

    Fixed

    • Remove converter from path when generating OpenAPI schema #1648.

    0.20.3

    June 10, 2022

    Fixed

    • Revert "Allow StaticFiles to follow symlinks" #1681.

    0.20.2

    June 7, 2022

    Fixed

    • Fix regression on route paths with colons #1675.
    • Allow StaticFiles to follow symlinks #1337.
    Commits
    • 0b8a775 Version 0.21.0 (#1812)
    • 040d8c8 Replace task cancellation in BaseHTTPMiddleware with http.disconnect+`rec...
    • 70971ea Implement repr for route classes (#1864)
    • e89e131 Add official support for Python 3.11 (#1863)
    • ef34ece Add Mount(..., middleware=[...]) (#1649)
    • bc61505 Add Starlette-Admin to third party package section (#1853)
    • 6765502 Replace HTTP client on TestClient from requests to httpx (#1376)
    • 243d03e Remove reference to DatabaseMiddleware in the documentation (#1845)
    • d525431 Add WebSocketException and support for WS handlers (#1263)
    • 9386bcf Add missing Middleware import on BaseHTTPMiddleware section (#1844)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • Bump starlette from 0.19.0 to 0.19.1

    Bump starlette from 0.19.0 to 0.19.1

    Bumps starlette from 0.19.0 to 0.19.1.

    Release notes

    Sourced from starlette's releases.

    Version 0.19.1

    Fixed

    • Fix inference of Route.name when created from methods #1553.
    • Avoid TypeError on websocket.disconnect when code is None #1574.

    Deprecated

    • Deprecate WS_1004_NO_STATUS_RCVD and WS_1005_ABNORMAL_CLOSURE in favor of WS_1005_NO_STATUS_RCVD and WS_1006_ABNORMAL_CLOSURE, as the previous constants didn't match the WebSockets specs #1580.
    Changelog

    Sourced from starlette's changelog.

    0.19.1

    April 22, 2022

    Fixed

    • Fix inference of Route.name when created from methods #1553.
    • Avoid TypeError on websocket.disconnect when code is None #1574.

    Deprecated

    • Deprecate WS_1004_NO_STATUS_RCVD and WS_1005_ABNORMAL_CLOSURE in favor of WS_1005_NO_STATUS_RCVD and WS_1006_ABNORMAL_CLOSURE, as the previous constants didn't match the WebSockets specs #1580.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • Insert isn't working

    Insert isn't working

    My class class Minutedsx(mongox.Model, db=db, indexes=ohlcindx): tradingsymbol: str date: datetime open: float high: float low: float close: float

    class Meta:
        collection = db.get_collection("mindsx")
    

    I import it in another class and tried insert in loop. but nothing gets inserted. tried the basic.py in example folder that also didnt insert anything. DB was created though.

    opened by crealityeducation 3
  • Version 0.1.0

    Version 0.1.0

    What's Changed

    Added

    • get_or_create method by @MAD-py in https://github.com/aminalaee/mongox/pull/23
    • Avoid Meta class from Model definition by @aminalaee in https://github.com/aminalaee/mongox/pull/25
    • Fix bulk update return by @MAD-py in https://github.com/aminalaee/mongox/pull/29

    Internal

    • Fixed autouse fixtures by @kuutsav in https://github.com/aminalaee/mongox/pull/26

    New Contributors

    • @MAD-py made their first contribution in https://github.com/aminalaee/mongox/pull/21
    • @kuutsav made their first contribution in https://github.com/aminalaee/mongox/pull/26

    Full Changelog: https://github.com/aminalaee/mongox/compare/0.0.3...0.1.0

    opened by aminalaee 3
  • Fixed autouse fixtures

    Fixed autouse fixtures

    @aminalaee autouse fixutres were getting called at the beginning of each test rather than the end which was leading to test_db not being empty at the end

    Movie.query().all() returned this earlier

    [Movie(id=ObjectId('61ed0cd87f46c40b190810e6'), name='Forrest Gump', year=2003, uuid=None),
     Movie(id=ObjectId('61ed0cd87f46c40b190810e9'), name='Venom', year=2021, uuid=None),
     Movie(id=ObjectId('61ed0cd87f46c40b190810eb'), name='Eternals', year=2021, uuid=None)]
    
    opened by kuutsav 3
  • Bump pydantic from 1.9.1 to 1.10.4

    Bump pydantic from 1.9.1 to 1.10.4

    Bumps pydantic from 1.9.1 to 1.10.4.

    Release notes

    Sourced from pydantic's releases.

    v1.10.4 (2022-12-30)

    Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.3...v1.10.4

    v1.10.3 (2022-12-29)

    Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.2...v1.10.3

    v1.10.2 (2022-09-05)

    Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.1...v1.10.2

    v1.10.1 (2022-08-31)

    • Add __hash__ method to pydancic.color.Color class, #4454 by @​czaki

    Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.0...v1.10.1

    v1.10.0 (2022-08-30)

    See #4419 for feedback and discussion, docs are live at pydantic-docs.helpmanual.io.

    • Refactor the whole pydantic dataclass decorator to really act like its standard lib equivalent. It hence keeps __eq__, __hash__, ... and makes comparison with its non-validated version possible. It also fixes usage of frozen dataclasses in fields and usage of default_factory in nested dataclasses. The support of Config.extra has been added. Finally, config customization directly via a dict is now possible, #2557 by @​PrettyWood BREAKING CHANGES:
      • The compiled boolean (whether pydantic is compiled with cython) has been moved from main.py to version.py
      • Now that Config.extra is supported, dataclass ignores by default extra arguments (like BaseModel)

    ... (truncated)

    Changelog

    Sourced from pydantic's changelog.

    v1.10.4 (2022-12-30)

    v1.10.3 (2022-12-29)

    NOTE: v1.10.3 was "yanked" from PyPI due to #4885 which is fixed in v1.10.4

    v1.10.2 (2022-09-05)

    v1.10.1 (2022-08-31)

    • Add __hash__ method to pydancic.color.Color class, #4454 by @​czaki

    v1.10.0 (2022-08-30)

    • Refactor the whole pydantic dataclass decorator to really act like its standard lib equivalent. It hence keeps __eq__, __hash__, ... and makes comparison with its non-validated version possible. It also fixes usage of frozen dataclasses in fields and usage of default_factory in nested dataclasses. The support of Config.extra has been added. Finally, config customization directly via a dict is now possible, #2557 by @​PrettyWood BREAKING CHANGES:
      • The compiled boolean (whether pydantic is compiled with cython) has been moved from main.py to version.py
      • Now that Config.extra is supported, dataclass ignores by default extra arguments (like BaseModel)
    • Fix PEP487 __set_name__ protocol in BaseModel for PrivateAttrs, #4407 by @​tlambert03
    • Allow for custom parsing of environment variables via parse_env_var in Config, #4406 by @​acmiyaguchi

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump pytest-asyncio from 0.18.3 to 0.20.3

    Bump pytest-asyncio from 0.18.3 to 0.20.3

    Bumps pytest-asyncio from 0.18.3 to 0.20.3.

    Release notes

    Sourced from pytest-asyncio's releases.

    pytest-asyncio 0.20.3


    title: 'pytest-asyncio'

    image

    image

    image

    Supported Python versions

    image

    pytest-asyncio is a pytest plugin. It facilitates testing of code that uses the asyncio library.

    Specifically, pytest-asyncio provides support for coroutines as test functions. This allows users to await code inside their tests. For example, the following code is executed as a test item by pytest:

    @pytest.mark.asyncio
    async def test_some_asyncio_code():
        res = await library.do_something()
        assert b"expected result" == res
    

    Note that test classes subclassing the standard unittest library are not supported. Users are advised to use unittest.IsolatedAsyncioTestCase or an async framework such as asynctest.

    pytest-asyncio is available under the Apache License 2.0.

    Installation

    To install pytest-asyncio, simply:

    $ pip install pytest-asyncio
    

    ... (truncated)

    Changelog

    Sourced from pytest-asyncio's changelog.

    0.20.3 (22-12-08)

    • Prevent DeprecationWarning to bubble up on CPython 3.10.9 and 3.11.1. [#460](https://github.com/pytest-dev/pytest-asyncio/issues/460) <https://github.com/pytest-dev/pytest-asyncio/issues/460>_

    0.20.2 (22-11-11)

    • Fixes an issue with async fixtures that are defined as methods on a test class not being rebound to the actual test instance. [#197](https://github.com/pytest-dev/pytest-asyncio/issues/197) <https://github.com/pytest-dev/pytest-asyncio/issues/197>_
    • Replaced usage of deprecated @pytest.mark.tryfirst with @pytest.hookimpl(tryfirst=True) [#438](https://github.com/pytest-dev/pytest-asyncio/issues/438) <https://github.com/pytest-dev/pytest-asyncio/pull/438>_

    0.20.1 (22-10-21)

    • Fixes an issue that warned about using an old version of pytest, even though the most recent version was installed. [#430](https://github.com/pytest-dev/pytest-asyncio/issues/430) <https://github.com/pytest-dev/pytest-asyncio/issues/430>_

    0.20.0 (22-10-21)

    • BREAKING: Removed legacy mode. If you're upgrading from v0.19 and you haven't configured asyncio_mode = legacy, you can upgrade without taking any additional action. If you're upgrading from an earlier version or you have explicitly enabled legacy mode, you need to switch to auto or strict mode before upgrading to this version.
    • Deprecate use of pytest v6.
    • Fixed an issue which prevented fixture setup from being cached. [#404](https://github.com/pytest-dev/pytest-asyncio/issues/404) <https://github.com/pytest-dev/pytest-asyncio/pull/404>_

    0.19.0 (22-07-13)

    • BREAKING: The default asyncio_mode is now strict. [#293](https://github.com/pytest-dev/pytest-asyncio/issues/293) <https://github.com/pytest-dev/pytest-asyncio/issues/293>_
    • Removes setup.py since all relevant configuration is present setup.cfg. Users requiring an editable installation of pytest-asyncio need to use pip v21.1 or newer. [#283](https://github.com/pytest-dev/pytest-asyncio/issues/283) <https://github.com/pytest-dev/pytest-asyncio/issues/283>_
    • Declare support for Python 3.11.
    Commits
    • 007e8ec [fix] Prevent DeprecationWarning about existing event loops to bubble up into...
    • 44ca3da Build(deps): Bump zipp from 3.10.0 to 3.11.0 in /dependencies/default (#455)
    • c3c601c Build(deps): Bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#456)
    • a962e2b Build(deps): Bump importlib-metadata in /dependencies/default (#454)
    • 56a393a Simplify README, move most content to a separate user documentation. (#448)
    • 3c78732 Build(deps): Bump hypothesis in /dependencies/default (#453)
    • d6a9a72 Build(deps): Bump exceptiongroup in /dependencies/default (#451)
    • 42da7a0 Build(deps): Bump hypothesis in /dependencies/default (#450)
    • 0b281b1 Build(deps): Bump mypy from 0.990 to 0.991 in /dependencies/default (#446)
    • d39589c Update pre-commit hooks (#449)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump mypy from 0.971 to 0.991

    Bump mypy from 0.971 to 0.991

    Bumps mypy from 0.971 to 0.991.

    Commits
    • b7788fc Update version to remove "+dev" for releasing 0.991
    • 6077d19 manually CP typeshed #9130
    • ab0ea1e Fix crash with function redefinition (#14064)
    • 592a9ce Fix another crash with report generation on namespace packages (#14063)
    • 1650ae0 Update --no-warn-no-return docs for empty body changes (#14065)
    • b9daa31 Don't ignore errors in files passed on the command line (#14060)
    • 02fd8a5 Filter out wasm32 wheel in upload-pypi.py (#14035)
    • 131c8d7 Fix crash on inference with recursive alias to recursive instance (#14038)
    • 1368338 Change version to 0.991+dev in preparation for the point release
    • b71dc3d Remove +dev from version
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump mkautodoc from 0.1.0 to 0.2.0

    Bump mkautodoc from 0.1.0 to 0.2.0

    Bumps mkautodoc from 0.1.0 to 0.2.0.

    Commits
    • ad41abc Merge pull request #34 from Kludex/bump-mkautodoc
    • f5c69d7 Update setup.py
    • 7dcc6fb Version 0.2.0
    • 7807afb Merge pull request #18 from AnjoMan/readible-test-expectations
    • 1ae0daf Refactor tests for readible output
    • 01713b0 Merge pull request #11 from RealOrangeOne/patch-1
    • dd6d368 Correct repo URL
    • 748d424 Merge pull request #6 from florimondmanca/feat/async-marker
    • b9b5b60 Merge pull request #5 from florimondmanca/patch-1
    • 7073c1f Merge pull request #4 from florimondmanca/upgrade-pip
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump autoflake from 1.4 to 1.7.8

    Bump autoflake from 1.4 to 1.7.8

    Bumps autoflake from 1.4 to 1.7.8.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Error when working with multiple models

    Error when working with multiple models

    When working with 2 different models, it seems like mongox is ignoring the collection name and inserting into the first one's collection.

    Currently, I have 2 models defined in 2 different files:

    class UserAction(mongox.Model, db=db, collection="user_actions"):
        server_id: int
        name: str
        aliases: list[str]
        emoji: str
        self_text: str
        receivers_text: list[str]
    
    class ServerSetting(mongox.Model, db=db, collection="server_settings"):
        server_id: int
        ignored_channels: list[int]
    

    Firstly, I insert into server_settings, but when I try to insert into user_actions, the object gets created inside the server_settings collection instead.

    opened by macthetoaster 1
Releases(0.1.2)
  • 0.1.2(Nov 9, 2022)

    What's Changed

    • For each Modelclass a new Meta instance will be created by @lgln-kmi in https://github.com/aminalaee/mongox/pull/90
    • Fix QuickStart sample error in documentation by @A-kirami in https://github.com/aminalaee/mongox/pull/82

    New Contributors

    • @A-kirami made their first contribution in https://github.com/aminalaee/mongox/pull/82
    • @lgln-kmi made their first contribution in https://github.com/aminalaee/mongox/pull/90

    Full Changelog: https://github.com/aminalaee/mongox/compare/0.1.1...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Jul 28, 2022)

    Version 0.1.1

    Added

    • Add Pydantic validation to get_or_create method by @MAD-py in https://github.com/aminalaee/mongox/pull/34
    • Expose Async Generator in Queryset by @aminalaee in https://github.com/aminalaee/mongox/pull/38
    • add get_by_id method by @ischaojie in https://github.com/aminalaee/mongox/pull/37
    • Add Q method contains for lists and strings by @MAD-py in https://github.com/aminalaee/mongox/pull/39
    • Add Q method regex for matched strings by @MAD-py in https://github.com/aminalaee/mongox/pull/45
    • Add insert_many method by @ischaojie in https://github.com/aminalaee/mongox/pull/48

    Fixed

    • Fix spelling mistake and some by @ischaojie in https://github.com/aminalaee/mongox/pull/40

    Full Changelog: https://github.com/aminalaee/mongox/compare/0.1.0...0.1.1

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jan 30, 2022)

    What's Changed

    Added

    • get_or_create method by @MAD-py in https://github.com/aminalaee/mongox/pull/23
    • Avoid Meta class from Model definition by @aminalaee in https://github.com/aminalaee/mongox/pull/25
    • Fix bulk update return by @MAD-py in https://github.com/aminalaee/mongox/pull/29

    Internal

    • Fixed autouse fixtures by @kuutsav in https://github.com/aminalaee/mongox/pull/26

    New Contributors

    • @MAD-py made their first contribution in https://github.com/aminalaee/mongox/pull/21
    • @kuutsav made their first contribution in https://github.com/aminalaee/mongox/pull/26

    Full Changelog: https://github.com/aminalaee/mongox/compare/0.0.3...0.1.0

    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Dec 6, 2021)

    What's Changed

    • Add EmbeddedModel in https://github.com/aminalaee/mongox/pull/15
    • Set Client default event loop in https://github.com/aminalaee/mongox/pull/17
    • Starlette integration tests in https://github.com/aminalaee/mongox/pull/19

    Full Changelog: https://github.com/aminalaee/mongox/compare/0.0.2...0.0.3

    Source code(tar.gz)
    Source code(zip)
  • 0.0.2(Nov 22, 2021)

    What's Changed

    Added

    • Add create_indexfor single index in https://github.com/aminalaee/mongox/pull/12
    • Add drop_index and drop_indexes methods in https://github.com/aminalaee/mongox/pull/11
    • Introduce QueryExpression and SortExpression in https://github.com/aminalaee/mongox/pull/5
    • Refactor query expression by @yezz123 in https://github.com/aminalaee/mongox/pull/6
    • Add field-level customization docs in https://github.com/aminalaee/mongox/pull/7
    • Extended Q operator in https://github.com/aminalaee/mongox/pull/8
    • Add Index and Q docs in https://github.com/aminalaee/mongox/pull/9

    Fixed

    • remove repeated import in example by @ischaojie in https://github.com/aminalaee/mongox/pull/3

    New Contributors

    • @ischaojie made their first contribution in https://github.com/aminalaee/mongox/pull/3
    • @yezz123 made their first contribution in https://github.com/aminalaee/mongox/pull/6

    Full Changelog: https://github.com/aminalaee/mongox/compare/0.0.1...0.0.2

    Source code(tar.gz)
    Source code(zip)
Owner
Amin Alaee
Software engineer, Python enthusiast
Amin Alaee
Sample code to extract data directly from the NetApp AIQUM MySQL Database

This sample code shows how to connect to the AIQUM Database and pull user quota details from it. AIQUM Requirements: 1. AIQUM 9.7 or higher. 2. An

1 Nov 08, 2021
Records is a very simple, but powerful, library for making raw SQL queries to most relational databases.

Records: SQL for Humans™ Records is a very simple, but powerful, library for making raw SQL queries to most relational databases. Just write SQL. No b

Kenneth Reitz 6.9k Jan 03, 2023
Redis client for Python asyncio (PEP 3156)

Redis client for Python asyncio. Redis client for the PEP 3156 Python event loop. This Redis library is a completely asynchronous, non-blocking client

Jonathan Slenders 554 Dec 04, 2022
google-cloud-bigtable Apache-2google-cloud-bigtable (🥈31 · ⭐ 3.5K) - Google Cloud Bigtable API client library. Apache-2

Python Client for Google Cloud Bigtable Google Cloud Bigtable is Google's NoSQL Big Data database service. It's the same database that powers many cor

Google APIs 39 Dec 03, 2022
aiosql - Simple SQL in Python

aiosql - Simple SQL in Python SQL is code. Write it, version control it, comment it, and run it using files. Writing your SQL code in Python programs

Will Vaughn 1.1k Jan 08, 2023
New generation PostgreSQL database adapter for the Python programming language

Psycopg 3 -- PostgreSQL database adapter for Python Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python. Installation Quick versio

The Psycopg Team 880 Jan 08, 2023
Pure Python MySQL Client

PyMySQL Table of Contents Requirements Installation Documentation Example Resources License This package contains a pure-Python MySQL client library,

PyMySQL 7.2k Jan 09, 2023
Application which allows you to make PostgreSQL databases with Python

Automate PostgreSQL Databases with Python Application which allows you to make PostgreSQL databases with Python I used the psycopg2 library which is u

Marc-Alistair Coffi 0 Dec 31, 2021
Redis Python Client - The Python interface to the Redis key-value store.

redis-py The Python interface to the Redis key-value store. Installation | Contributing | Getting Started | Connecting To Redis Installation redis-py

Redis 11k Jan 08, 2023
Example Python codes that works with MySQL and Excel files (.xlsx)

Python x MySQL x Excel by Zinglecode Example Python codes that do the processes between MySQL database and Excel spreadsheet files. YouTube videos MyS

Potchara Puttawanchai 1 Feb 07, 2022
Async ODM (Object Document Mapper) for MongoDB based on python type hints

ODMantic Documentation: https://art049.github.io/odmantic/ Asynchronous ODM(Object Document Mapper) for MongoDB based on standard python type hints. I

Arthur Pastel 732 Dec 31, 2022
Create a database, insert data and easily select it with Sqlite

sqliteBasics create a database, insert data and easily select it with Sqlite Watch on YouTube a step by step tutorial explaining this code: https://yo

Mariya 27 Dec 27, 2022
Redis Python Client

redis-py The Python interface to the Redis key-value store. Python 2 Compatibility Note redis-py 3.5.x will be the last version of redis-py that suppo

Andy McCurdy 11k Dec 29, 2022
Python PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.

Python PG Extras Python port of Heroku PG Extras with several additions and improvements. The goal of this project is to provide powerful insights int

Paweł Urbanek 35 Nov 01, 2022
dask-sql is a distributed SQL query engine in python using Dask

dask-sql is a distributed SQL query engine in Python. It allows you to query and transform your data using a mixture of common SQL operations and Python code and also scale up the calculation easily

Nils Braun 271 Dec 30, 2022
DataStax Python Driver for Apache Cassandra

DataStax Driver for Apache Cassandra A modern, feature-rich and highly-tunable Python client library for Apache Cassandra (2.1+) and DataStax Enterpri

DataStax 1.3k Dec 25, 2022
Script em python para carregar os arquivos de cnpj dos dados públicos da Receita Federal em MYSQL.

cnpj-mysql Script em python para carregar os arquivos de cnpj dos dados públicos da Receita Federal em MYSQL. Dados públicos de cnpj no site da Receit

17 Dec 25, 2022
Dlsite-doujin-renamer - Dlsite doujin renamer tool with python

dlsite-doujin-renamer Features 支持深度查找带有 RJ 号的文件夹 支持手动选择文件夹或拖拽文件夹到软件窗口 支持在 config

111 Jan 02, 2023
An extension package of 🤗 Datasets that provides support for executing arbitrary SQL queries on HF datasets

datasets_sql A 🤗 Datasets extension package that provides support for executing arbitrary SQL queries on HF datasets. It uses DuckDB as a SQL engine

Mario Šaško 19 Dec 15, 2022
Pony Object Relational Mapper

Downloads Pony Object-Relational Mapper Pony is an advanced object-relational mapper. The most interesting feature of Pony is its ability to write que

3.1k Jan 04, 2023