Name | odoo-xmlrpc-wrapper JSON |
Version |
1.1.1
JSON |
| download |
home_page | https://github.com/cagatayuresin/odoo-xmlrpc-wrapper |
Summary | A simple Python library to make CRUD process easier |
upload_time | 2023-05-15 06:47:41 |
maintainer | |
docs_url | None |
author | Cagatay URESIN |
requires_python | >=3.7 |
license | MIT License Copyright 2023 Cagatay URESIN Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
odoo
external
api
xmlrpc
rpc
wrapper
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<a href="https://www.buymeacoffee.com/cagatayuresin" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
# Odoo XMLRPC Wrapper
***
A small wrapper for oversimplifying CRUD operations and connecting to the Odoo External API
with the Python xmlrpc module.
***
## Index
* [Getting Started](#getting-started)
* [Installing via pip](#installing-via-pip)
* [A Simple Connection](#a-simple-connection)
* [CRUD Operations](#crud-operations)
* [Create](#create)
* [Read](#read)
* [Update](#update)
* [Delete](#delete)
* [Miscellaneous](#miscellaneous)
* [Search](#search)
* [Search and Read](#search-and-read)
* [Count](#count)
* [Get Fields](#get-fields)
* [A Little Detail](#a-little-detail)
* [Bot Instance](#bot-instance)
* [Active Model](#active-model)
* [Contribution](#contribution)
* [License](#license)
***
## Getting Started
### Installing via pip
```bash
pip install odoo-xmlrpc-wrapper
```
### A Simple Connection
```python
from odoo_xmlrpc_wrapper import odoo_xmlrpc_wrapper as oxw
HOST = "odoo.myhost.com"
DB = "my_test_db"
USERLOGIN = "mymailtologin@odoo.com"
PASSWORD = "mypass"
bot = oxw.Bot(HOST, DB, USERLOGIN, PASSWORD)
```
Prints:
```commandline
Successfully Logged
Name: Mitchell Admin
DB: my_test_db
HOST: https://odoo.myhost.com
VERSION: saas~16.1
```
### CRUD Operations
Once the model to be processed in the CRUD functions is entered, the following other
You do not need to specify the model again as long as the model does not change to
the operation functions.
#### Create
```python
bot.create("res.partner", {"name": "John Doe"})
```
#### Read
```python
bot.read(ids=[84], fields=["name"])
```
Returns: `[{"id": 84, "name": "John Doe"}]`
#### Update
```python
bot.update(the_id=84, the_obj={"name": "Jane Doe"})
```
#### Delete
```python
bot.delete(ids=[84])
```
### Miscellaneous
#### Search
```python
bot.search(constraints=[("name", "=", "Mitchell Admin")])
```
Returns:
`[2]`
#### Search and Read
```python
bot.search_read(constraints=[("name", "=", "Mitchell Admin")])
```
Returns: `[{'id': 2, 'name': 'Mitchell Admin'}]`
#### Count
```python
bot.count()
```
Returns: `78`
#### Get Fields
```python
bot.get_fields("res.partner.title", attributes=["type"])
```
Output:
```commandline
{
"name": {"type": "char"},
"shortcut": {"type": "char"},
"id": {"type": "integer"},
"display_name": {"type": "char"},
"create_uid": {"type": "many2one"},
"create_date": {"type": "datetime"},
"write_uid": {"type": "many2one"},
"write_date": {"type": "datetime"},
}
```
## A Little Detail
### Bot Instance
```python
bot = oxw.Bot(HOST, DB, USERLOGIN, PASSWORD) # Simple Connection
bot = oxw.Bot(HOST, DB, USERLOGIN, PASSWORD, secured=False) # For http:// (no-ssl) (localhost)
bot = oxw.Bot(test=True) # For XMLRPC Tests from Odoo saas
```
If you are going to connect to a host with an unencrypted http protocol such as localhost,
`secured=False` must be specified.
`test=True` allows you to connect to one of Odoo's own xmlrpc test servers. Odoo assigns
you a random host, database, user and password from the demo servers. You don't need other
attributes when test option is selected.
### Active Model
The default model when a bot instance is initialized is `"res.users"`. So when you command
`bot.count()` it returns active users total as an integer.
You can assign the active model at any time with `bot.model = "model.name"` or when calling
any next method, such as `bot.count("res.partner")`
## Contribution
Feel free to contribute. This project needs a fine exception handling.
## License
[MIT License](https://en.wikipedia.org/wiki/MIT_License)
Copyright 2023 Cagatay URESIN
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the “Software”), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Raw data
{
"_id": null,
"home_page": "https://github.com/cagatayuresin/odoo-xmlrpc-wrapper",
"name": "odoo-xmlrpc-wrapper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "Cagatay URESIN <cagatayuresin@gmail.com>",
"keywords": "odoo,external,api,xmlrpc,rpc,wrapper",
"author": "Cagatay URESIN",
"author_email": "Cagatay URESIN <cagatayuresin@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c5/00/f581e27b97eb9b47793e561009502f20872411429a9493a01f90832c39b8/odoo_xmlrpc_wrapper-1.1.1.tar.gz",
"platform": null,
"description": "<a href=\"https://www.buymeacoffee.com/cagatayuresin\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"></a>\r\n# Odoo XMLRPC Wrapper\r\n***\r\nA small wrapper for oversimplifying CRUD operations and connecting to the Odoo External API \r\nwith the Python xmlrpc module.\r\n***\r\n## Index\r\n* [Getting Started](#getting-started)\r\n * [Installing via pip](#installing-via-pip)\r\n * [A Simple Connection](#a-simple-connection)\r\n* [CRUD Operations](#crud-operations)\r\n * [Create](#create)\r\n * [Read](#read)\r\n * [Update](#update)\r\n * [Delete](#delete)\r\n* [Miscellaneous](#miscellaneous)\r\n * [Search](#search)\r\n * [Search and Read](#search-and-read)\r\n * [Count](#count)\r\n * [Get Fields](#get-fields)\r\n* [A Little Detail](#a-little-detail)\r\n * [Bot Instance](#bot-instance)\r\n * [Active Model](#active-model)\r\n* [Contribution](#contribution)\r\n* [License](#license)\r\n***\r\n## Getting Started\r\n### Installing via pip\r\n```bash\r\npip install odoo-xmlrpc-wrapper\r\n```\r\n### A Simple Connection\r\n```python\r\nfrom odoo_xmlrpc_wrapper import odoo_xmlrpc_wrapper as oxw\r\n\r\n\r\nHOST = \"odoo.myhost.com\"\r\nDB = \"my_test_db\"\r\nUSERLOGIN = \"mymailtologin@odoo.com\"\r\nPASSWORD = \"mypass\"\r\n\r\nbot = oxw.Bot(HOST, DB, USERLOGIN, PASSWORD)\r\n```\r\nPrints:\r\n```commandline\r\nSuccessfully Logged\r\nName: Mitchell Admin\r\nDB: my_test_db\r\nHOST: https://odoo.myhost.com\r\nVERSION: saas~16.1\r\n```\r\n### CRUD Operations\r\nOnce the model to be processed in the CRUD functions is entered, the following other\r\nYou do not need to specify the model again as long as the model does not change to \r\nthe operation functions.\r\n#### Create\r\n```python\r\nbot.create(\"res.partner\", {\"name\": \"John Doe\"})\r\n```\r\n#### Read\r\n```python\r\nbot.read(ids=[84], fields=[\"name\"])\r\n```\r\nReturns: `[{\"id\": 84, \"name\": \"John Doe\"}]`\r\n#### Update\r\n```python\r\nbot.update(the_id=84, the_obj={\"name\": \"Jane Doe\"})\r\n```\r\n#### Delete\r\n```python\r\nbot.delete(ids=[84])\r\n```\r\n### Miscellaneous\r\n#### Search\r\n```python\r\nbot.search(constraints=[(\"name\", \"=\", \"Mitchell Admin\")])\r\n```\r\nReturns:\r\n`[2]`\r\n#### Search and Read\r\n```python\r\nbot.search_read(constraints=[(\"name\", \"=\", \"Mitchell Admin\")])\r\n```\r\nReturns: `[{'id': 2, 'name': 'Mitchell Admin'}]`\r\n#### Count\r\n```python\r\nbot.count()\r\n```\r\nReturns: `78`\r\n#### Get Fields\r\n```python\r\nbot.get_fields(\"res.partner.title\", attributes=[\"type\"])\r\n```\r\nOutput:\r\n```commandline\r\n{\r\n \"name\": {\"type\": \"char\"},\r\n \"shortcut\": {\"type\": \"char\"},\r\n \"id\": {\"type\": \"integer\"},\r\n \"display_name\": {\"type\": \"char\"},\r\n \"create_uid\": {\"type\": \"many2one\"},\r\n \"create_date\": {\"type\": \"datetime\"},\r\n \"write_uid\": {\"type\": \"many2one\"},\r\n \"write_date\": {\"type\": \"datetime\"},\r\n}\r\n```\r\n## A Little Detail\r\n### Bot Instance\r\n```python\r\nbot = oxw.Bot(HOST, DB, USERLOGIN, PASSWORD) # Simple Connection\r\nbot = oxw.Bot(HOST, DB, USERLOGIN, PASSWORD, secured=False) # For http:// (no-ssl) (localhost)\r\nbot = oxw.Bot(test=True) # For XMLRPC Tests from Odoo saas\r\n```\r\nIf you are going to connect to a host with an unencrypted http protocol such as localhost,\r\n`secured=False` must be specified.\r\n\r\n`test=True` allows you to connect to one of Odoo's own xmlrpc test servers. Odoo assigns \r\nyou a random host, database, user and password from the demo servers. You don't need other \r\nattributes when test option is selected.\r\n### Active Model\r\nThe default model when a bot instance is initialized is `\"res.users\"`. So when you command\r\n`bot.count()` it returns active users total as an integer.\r\n\r\nYou can assign the active model at any time with `bot.model = \"model.name\"` or when calling \r\nany next method, such as `bot.count(\"res.partner\")`\r\n\r\n## Contribution\r\nFeel free to contribute. This project needs a fine exception handling.\r\n## License\r\n[MIT License](https://en.wikipedia.org/wiki/MIT_License)\r\n\r\nCopyright 2023 Cagatay URESIN\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of this \r\nsoftware and associated documentation files (the \u201cSoftware\u201d), to deal in the Software \r\nwithout restriction, including without limitation the rights to use, copy, modify, merge, \r\npublish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r\nto whom the Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all copies or \r\nsubstantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, \r\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR \r\nPURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \r\nFOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR \r\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \r\nDEALINGS IN THE SOFTWARE.\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright 2023 Cagatay URESIN Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A simple Python library to make CRUD process easier",
"version": "1.1.1",
"project_urls": {
"Bug Reports": "https://github.com/cagatayuresin/odoo-xmlrpc-wrapper/issues",
"Buy Me A Coffee": "https://www.buymeacoffee.com/cagatayuresin",
"Homepage": "https://github.com/cagatayuresin/odoo-xmlrpc-wrapper",
"Source": "https://github.com/cagatayuresin/odoo-xmlrpc-wrapper"
},
"split_keywords": [
"odoo",
"external",
"api",
"xmlrpc",
"rpc",
"wrapper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c7197a3652053f19e33d1e7918010d775504f584b9901950527d631ef7c631c",
"md5": "65c270625c0a3bc7960b436975efa3f3",
"sha256": "21b9fe0c58ba115b439e547db652e982f9c8415cc4cd09a2bb096ff7a6704685"
},
"downloads": -1,
"filename": "odoo_xmlrpc_wrapper-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "65c270625c0a3bc7960b436975efa3f3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7008,
"upload_time": "2023-05-15T06:47:39",
"upload_time_iso_8601": "2023-05-15T06:47:39.055390Z",
"url": "https://files.pythonhosted.org/packages/5c/71/97a3652053f19e33d1e7918010d775504f584b9901950527d631ef7c631c/odoo_xmlrpc_wrapper-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c500f581e27b97eb9b47793e561009502f20872411429a9493a01f90832c39b8",
"md5": "f40ef37fff817d9de7981785718de08e",
"sha256": "98eab285eff942351d50811686226c383a1718c98015b53569b5013a0bdbadcc"
},
"downloads": -1,
"filename": "odoo_xmlrpc_wrapper-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f40ef37fff817d9de7981785718de08e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6841,
"upload_time": "2023-05-15T06:47:41",
"upload_time_iso_8601": "2023-05-15T06:47:41.511460Z",
"url": "https://files.pythonhosted.org/packages/c5/00/f581e27b97eb9b47793e561009502f20872411429a9493a01f90832c39b8/odoo_xmlrpc_wrapper-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-15 06:47:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cagatayuresin",
"github_project": "odoo-xmlrpc-wrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "odoo-xmlrpc-wrapper"
}