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
Python PostgreSQL adapter to stream results of multi-statement queries without a server-side cursor

streampq Stream results of multi-statement PostgreSQL queries from Python without server-side cursors. Has benefits over some other Python PostgreSQL

Department for International Trade 6 Oct 31, 2022
Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc.

Simple DDL Parser Build with ply (lex & yacc in python). A lot of samples in 'tests/. Is it Stable? Yes, library already has about 5000+ usage per day

Iuliia Volkova 95 Jan 05, 2023
A Redis client library for Twisted Python

txRedis Asynchronous Redis client for Twisted Python. Install Install via pip. Usage examples can be found in the examples/ directory of this reposito

Dorian Raymer 127 Oct 23, 2022
MySQL Operator for Kubernetes

MySQL Operator for Kubernetes The MYSQL Operator for Kubernetes is an Operator for Kubernetes managing MySQL InnoDB Cluster setups inside a Kubernetes

MySQL 462 Dec 24, 2022
Some scripts for microsoft SQL server in old version.

MSSQL_Stuff Some scripts for microsoft SQL server which is in old version. Table of content Overview Usage References Overview These script works when

小离 5 Dec 29, 2022
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
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
Anomaly detection on SQL data warehouses and databases

With CueObserve, you can run anomaly detection on data in your SQL data warehouses and databases. Getting Started Install via Docker docker run -p 300

Cuebook 171 Dec 18, 2022
PyRemoteSQL is a python SQL client that allows you to connect to your remote server with phpMyAdmin installed.

PyRemoteSQL Python MySQL remote client Basically this is a python SQL client that allows you to connect to your remote server with phpMyAdmin installe

ProbablyX 3 Nov 04, 2022
High level Python client for Elasticsearch

Elasticsearch DSL Elasticsearch DSL is a high-level library whose aim is to help with writing and running queries against Elasticsearch. It is built o

elastic 3.6k Jan 03, 2023
SpyQL - SQL with Python in the middle

SpyQL SQL with Python in the middle Concept SpyQL is a query language that combines: the simplicity and structure of SQL with the power and readabilit

Daniel Moura 853 Dec 30, 2022
Pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).

AWS Data Wrangler Pandas on AWS Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretMana

Amazon Web Services - Labs 3.3k Dec 31, 2022
ClickHouse Python Driver with native interface support

ClickHouse Python Driver ClickHouse Python Driver with native (TCP) interface support. Asynchronous wrapper is available here: https://github.com/myma

Marilyn System 957 Dec 30, 2022
Python MYSQL CheatSheet.

Python MYSQL CheatSheet Python mysql cheatsheet. Install Required Windows(WAMP) Download and Install from HERE Linux(LAMP) install packages. sudo apt

Mohammad Dori 4 Jul 15, 2022
SAP HANA Connector in pure Python

SAP HANA Database Client for Python A pure Python client for the SAP HANA Database based on the SAP HANA Database SQL Command Network Protocol. pyhdb

SAP 299 Nov 20, 2022
Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.

dataset: databases for lazy people In short, dataset makes reading and writing data in databases as simple as reading and writing JSON files. Read the

Friedrich Lindenberg 4.2k Jan 02, 2023
MongoX is an async python ODM for MongoDB which is built on top Motor and Pydantic.

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 t

Amin Alaee 112 Dec 04, 2022
MongoDB data stream pipeline tools by YouGov (adopted from MongoDB)

mongo-connector The mongo-connector project originated as a MongoDB mongo-labs project and is now community-maintained under the custody of YouGov, Pl

YouGov 1.9k Jan 04, 2023
PubMed Mapper: A Python library that map PubMed XML to Python object

pubmed-mapper: A Python Library that map PubMed XML to Python object 中文文档 1. Philosophy view UML Programmatically access PubMed article is a common ta

灵魂工具人 33 Dec 08, 2022
Dinamopy is a python helper library for dynamodb

Dinamopy is a python helper library for dynamodb. You can define your access patterns in a json file and can use dynamic method names to make operations.

Rasim Andıran 2 Jul 18, 2022