ravendb-embedded


Nameravendb-embedded JSON
Version 5.2.6.post1 PyPI version JSON
download
home_pagehttps://github.com/ravendb/ravendb-python-embedded
SummaryRavenDB Embedded library to run RavenDB in an embedded way
upload_time2024-07-15 12:41:53
maintainerNone
docs_urlNone
authorRavenDB
requires_python>=3.7
licenseCustom EULA
keywords ravendb embedded database nosql doc db
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========
Overview
========

``ravendb-embedded`` is a RavenDB package for running RavenDB in embedded mode.

.. code-block:: python

    EmbeddedServer().start_server()
    with EmbeddedServer().get_document_store("Embedded") as store:
        with store.open_session() as session:
            session.store(User(name="Ilay", age=4))
            session.save_changes()

============
Installation
============

Install ``ravendb-embedded`` from `PyPi <https://pypi.python.org/pypi>`_ using:

.. code-block:: bash

    pip install ravendb-embedded

Installing ``ravendb-embedded`` from pip will also provide you with a copy of the RavenDB server binary files.

========
Usage
========

Start a server
--------------

To start the RavenDB server, call the ``start_server()`` method from an ``EmbeddedServer`` instance.

.. code-block:: python

    EmbeddedServer.start_server()

For more control over your server, you can pass ``server_options`` to the ``start_server()`` method.

ServerOptions
-------------

- ``framework_version``: The framework version to run the server with.
- ``data_directory``: Where to save the database data (if None, the files will be saved in the RavenDB folder in the base folder).
- ``server_url``: The URL the server will be opened on (if None, the server will open on localhost).
- ``dotnet_path``: The location of ``dotnet.exe`` (if .NET Core is not installed on your machine, you can download `dotnet binaries <https://www.microsoft.com/net/download/windows>`_ and provide the path).
- ``command_line_args``: A list of all `server command arguments <https://ravendb.net/docs/article-page/6.0/csharp/server/configuration/command-line-arguments>`_.

.. code-block:: python

    server_options = ServerOptions(data_directory="MYPATH/RavenDBDataDir")
    EmbeddedServer().start_server(server_options)

Security
--------

You can secure ``ravendb-embedded`` using the ``secured()`` method:

.. code-block:: python

    secured(server_pfx_certificate_path, client_pem_certificate_path, server_pfx_certificate_password=None, ca_certificate_path=None)

- Provide the path to ``.pfx`` and ``.pem`` files, and optionally a password and CA certificate file.
- Minimal setup requires both a ``.pfx`` server and a ``.pem`` client certificate.

Get Document Store
------------------

After initializing and starting the server, you can use the ``get_document_store`` method to obtain a ``DocumentStore`` and start working with RavenDB as usual.

``get_document_store`` method can take either just the ``database_name`` or ``DatabaseOptions``.

DatabaseOptions
---------------

- ``database_name``: The name of the database.
- ``skip_creating_database``: ``get_document_store`` will create a new database if it does not exist. If this option is set to True, the database won't be created (Default False).

Open RavenDB Studio in the Browser
-----------------------------------

To open RavenDB Studio from ``ravendb-embedded``, use the ``open_studio_in_browser`` method, and the studio will open automatically in your default browser.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ravendb/ravendb-python-embedded",
    "name": "ravendb-embedded",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "ravendb embedded database nosql doc db",
    "author": "RavenDB",
    "author_email": "support@ravendb.net",
    "download_url": "https://files.pythonhosted.org/packages/41/24/643ff296b4cf44bb010da1c88bcdd8cedfeb677f8c0342f9e7c11c913c71/ravendb_embedded-5.2.6.post1.tar.gz",
    "platform": null,
    "description": "========\r\nOverview\r\n========\r\n\r\n``ravendb-embedded`` is a RavenDB package for running RavenDB in embedded mode.\r\n\r\n.. code-block:: python\r\n\r\n    EmbeddedServer().start_server()\r\n    with EmbeddedServer().get_document_store(\"Embedded\") as store:\r\n        with store.open_session() as session:\r\n            session.store(User(name=\"Ilay\", age=4))\r\n            session.save_changes()\r\n\r\n============\r\nInstallation\r\n============\r\n\r\nInstall ``ravendb-embedded`` from `PyPi <https://pypi.python.org/pypi>`_ using:\r\n\r\n.. code-block:: bash\r\n\r\n    pip install ravendb-embedded\r\n\r\nInstalling ``ravendb-embedded`` from pip will also provide you with a copy of the RavenDB server binary files.\r\n\r\n========\r\nUsage\r\n========\r\n\r\nStart a server\r\n--------------\r\n\r\nTo start the RavenDB server, call the ``start_server()`` method from an ``EmbeddedServer`` instance.\r\n\r\n.. code-block:: python\r\n\r\n    EmbeddedServer.start_server()\r\n\r\nFor more control over your server, you can pass ``server_options`` to the ``start_server()`` method.\r\n\r\nServerOptions\r\n-------------\r\n\r\n- ``framework_version``: The framework version to run the server with.\r\n- ``data_directory``: Where to save the database data (if None, the files will be saved in the RavenDB folder in the base folder).\r\n- ``server_url``: The URL the server will be opened on (if None, the server will open on localhost).\r\n- ``dotnet_path``: The location of ``dotnet.exe`` (if .NET Core is not installed on your machine, you can download `dotnet binaries <https://www.microsoft.com/net/download/windows>`_ and provide the path).\r\n- ``command_line_args``: A list of all `server command arguments <https://ravendb.net/docs/article-page/6.0/csharp/server/configuration/command-line-arguments>`_.\r\n\r\n.. code-block:: python\r\n\r\n    server_options = ServerOptions(data_directory=\"MYPATH/RavenDBDataDir\")\r\n    EmbeddedServer().start_server(server_options)\r\n\r\nSecurity\r\n--------\r\n\r\nYou can secure ``ravendb-embedded`` using the ``secured()`` method:\r\n\r\n.. code-block:: python\r\n\r\n    secured(server_pfx_certificate_path, client_pem_certificate_path, server_pfx_certificate_password=None, ca_certificate_path=None)\r\n\r\n- Provide the path to ``.pfx`` and ``.pem`` files, and optionally a password and CA certificate file.\r\n- Minimal setup requires both a ``.pfx`` server and a ``.pem`` client certificate.\r\n\r\nGet Document Store\r\n------------------\r\n\r\nAfter initializing and starting the server, you can use the ``get_document_store`` method to obtain a ``DocumentStore`` and start working with RavenDB as usual.\r\n\r\n``get_document_store`` method can take either just the ``database_name`` or ``DatabaseOptions``.\r\n\r\nDatabaseOptions\r\n---------------\r\n\r\n- ``database_name``: The name of the database.\r\n- ``skip_creating_database``: ``get_document_store`` will create a new database if it does not exist. If this option is set to True, the database won't be created (Default False).\r\n\r\nOpen RavenDB Studio in the Browser\r\n-----------------------------------\r\n\r\nTo open RavenDB Studio from ``ravendb-embedded``, use the ``open_studio_in_browser`` method, and the studio will open automatically in your default browser.\r\n",
    "bugtrack_url": null,
    "license": "Custom EULA",
    "summary": "RavenDB Embedded library to run RavenDB in an embedded way",
    "version": "5.2.6.post1",
    "project_urls": {
        "Homepage": "https://github.com/ravendb/ravendb-python-embedded"
    },
    "split_keywords": [
        "ravendb",
        "embedded",
        "database",
        "nosql",
        "doc",
        "db"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13056fcb459a53378c3b93725e1cff02af6ffa5579dbfb164735fc76953739d4",
                "md5": "66181f1aacc209151386bdcacf3b7880",
                "sha256": "1ed17091bfa6a4b6b0b5ed9dbfeda209a4b847bd6e588caae6407767b469c330"
            },
            "downloads": -1,
            "filename": "ravendb_embedded-5.2.6.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66181f1aacc209151386bdcacf3b7880",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 81565513,
            "upload_time": "2024-07-15T12:41:44",
            "upload_time_iso_8601": "2024-07-15T12:41:44.975436Z",
            "url": "https://files.pythonhosted.org/packages/13/05/6fcb459a53378c3b93725e1cff02af6ffa5579dbfb164735fc76953739d4/ravendb_embedded-5.2.6.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4124643ff296b4cf44bb010da1c88bcdd8cedfeb677f8c0342f9e7c11c913c71",
                "md5": "41ce6c368e538ec49ca5618f03976fe3",
                "sha256": "a06f3d0f9c604c152dce0b4f1a5a43cdd3a38586141ca0753e8cc6a3d3dc5fe0"
            },
            "downloads": -1,
            "filename": "ravendb_embedded-5.2.6.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "41ce6c368e538ec49ca5618f03976fe3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 81237445,
            "upload_time": "2024-07-15T12:41:53",
            "upload_time_iso_8601": "2024-07-15T12:41:53.013932Z",
            "url": "https://files.pythonhosted.org/packages/41/24/643ff296b4cf44bb010da1c88bcdd8cedfeb677f8c0342f9e7c11c913c71/ravendb_embedded-5.2.6.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-15 12:41:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ravendb",
    "github_project": "ravendb-python-embedded",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ravendb-embedded"
}
        
Elapsed time: 0.27099s