========
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": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "ravendb embedded database nosql doc db",
"author": "RavenDB",
"author_email": "support@ravendb.net",
"download_url": "https://files.pythonhosted.org/packages/30/6d/22b2c54197b92ab4289afd6212d7cf47d0843f579110e9d22b2e4304c2c3/ravendb-embedded-5.2.6.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",
"project_urls": {
"Homepage": "https://github.com/ravendb/ravendb-python-embedded"
},
"split_keywords": [
"ravendb",
"embedded",
"database",
"nosql",
"doc",
"db"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7ddd54ca807a797e5f28532d927656f1a2d770f366ccc8e44d98d3451ba63fde",
"md5": "3481e148213e175aae0fb1c0d09d30df",
"sha256": "f502af1feb174eac59abd15312f24acfb775b38709831e0ca8546d8209aa54e6"
},
"downloads": -1,
"filename": "ravendb_embedded-5.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3481e148213e175aae0fb1c0d09d30df",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 81796284,
"upload_time": "2024-03-07T14:34:10",
"upload_time_iso_8601": "2024-03-07T14:34:10.490127Z",
"url": "https://files.pythonhosted.org/packages/7d/dd/54ca807a797e5f28532d927656f1a2d770f366ccc8e44d98d3451ba63fde/ravendb_embedded-5.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "306d22b2c54197b92ab4289afd6212d7cf47d0843f579110e9d22b2e4304c2c3",
"md5": "089cc09278e55fade041b224f97c28c5",
"sha256": "053aef9c89923b11cdbf68b2f753b7cae7e2ab318b02bf83d767351ecc4ed782"
},
"downloads": -1,
"filename": "ravendb-embedded-5.2.6.tar.gz",
"has_sig": false,
"md5_digest": "089cc09278e55fade041b224f97c28c5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 81461587,
"upload_time": "2024-03-07T14:34:19",
"upload_time_iso_8601": "2024-03-07T14:34:19.411527Z",
"url": "https://files.pythonhosted.org/packages/30/6d/22b2c54197b92ab4289afd6212d7cf47d0843f579110e9d22b2e4304c2c3/ravendb-embedded-5.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-07 14:34:19",
"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"
}