![Timbr logo description](https://timbr.ai/wp-content/uploads/2023/06/timbr-ai-l-5-226x60-1.png)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http.svg?type=shield&issueType=license)](https://app.fossa.com/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http?ref=badge_shield&issueType=license)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http.svg?type=shield&issueType=security)](https://app.fossa.com/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http?ref=badge_shield&issueType=security)
[![Python 3.7.13](https://img.shields.io/badge/python-3.7.13+-blue.svg)](https://www.python.org/downloads/release/python-3713/)
[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-3820/)
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-3921/)
[![PypiVersion](https://img.shields.io/pypi/v/pytimbr-api.svg)](https://badge.fury.io/py/pytimbr-api)
# timbr REST API connector using Python
This project is a pure python connector to timbr (no dependencies required).
## Dependencies
- Python 3.7.13+ or 3.8.x or 3.9.x
## Installation
- Install as clone repository:
- Install Python: https://www.python.org/downloads/release/python-3713/
- Install using pip and git:
- `pip install git+https://github.com/WPSemantix/timbr_python_http`
- Install using pip:
- `pip install pytimbr-api`
## Sample usage
- For an example of how to use the REST API connector for Timbr, follow this [Example file](examples/example.py)
## Connection parameters examples
### Generic example and explanation for each parameter
```python
pytimbr_api.run_query(
url = "<TIMBR_URL>",
ontology = "<ONTOLOGY_NAME>",
token = "<USER_TOKEN>",
query = "<TIMBR_QUERY>",
datasource = "<DATASOURCE_NAME>",
nested = "<true/false>",
verify_ssl = <True/False>,
enable_IPv6 = <True/False>,
)
# url - Required - String - The IP / Hostname of the Timbr platform.
# ontology - Required - String - The ontology / knowledge graph to connect to.
# token - Required - String - Timbr token value.
# query - Required - String - The query that you want to execute.
# datasource - Optional - String - Add the specific datasource name that you want to query from, the default value is the current active datasource of your ontology.
# nested - Optional - String - Change to 'true' if nested flag needs to be enabled. make sure this flag contains string value not bool value.
# verify_ssl - Optional - Boolean - Verifying the target server's SSL Certificate, use False to disable this process.
# enable_IPv6 - Optional - Boolean - Change to 'true' if you are using IPv6 connection.
```
### HTTP example
```python
pytimbr_api.run_query(
url = "http://mytimbrenv.com:11000",
ontology = "my_ontology",
token = "tk_mytimbrtoken",
query = "SELECT * FROM timbr.sys_concepts",
datasource = "my_datasource",
nested = "false",
verify_ssl = False,
enable_IPv6 = False,
)
```
### HTTPS example
```python
pytimbr_api.run_query(
url = "https://mytimbrenv.com:443",
ontology = "my_ontology",
token = "tk_mytimbrtoken",
query = "SELECT * FROM timbr.sys_concepts",
datasource = "my_datasource",
nested = "false",
verify_ssl = True,
enable_IPv6 = False,
)
```
## Execute query examples
### HTTP connection
```python
response = pytimbr_api.run_query(
url = "http://mytimbrenv.com:11000",
ontology = "my_ontology",
token = "tk_mytimbrtoken",
query = "SELECT * FROM timbr.sys_concepts",
datasource = "my_datasource",
nested = "false",
verify_ssl = False,
enable_IPv6 = False,
)
print(response)
```
### HTTPS connection
```python
response = pytimbr_api.run_query(
url = "https://mytimbrenv.com:443",
ontology = "my_ontology",
token = "tk_mytimbrtoken",
query = "SELECT * FROM timbr.sys_concepts",
datasource = "my_datasource",
nested = "false",
verify_ssl = True,
enable_IPv6 = False,
)
print(response)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/WPSemantix/timbr_python_http",
"name": "pytimbr-api",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "timbr, timbr-http, timbr-https, timbr-rest, timbr-api, timbr-rest-api, timbr-connector, PyTimbrRestAPI, PyTimbr, pytimbrapi, PyTimbrAPI, pytimbr_api, PyTimbr_API",
"author": "timbr",
"author_email": "contact@timbr.ai",
"download_url": "https://files.pythonhosted.org/packages/cc/80/c903fd62730e7c1a9198fd0137c3beeaed4a407ffd83d818a20f46f86f9c/pytimbr_api-1.0.5.tar.gz",
"platform": null,
"description": "![Timbr logo description](https://timbr.ai/wp-content/uploads/2023/06/timbr-ai-l-5-226x60-1.png)\r\n\r\n[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http.svg?type=shield&issueType=license)](https://app.fossa.com/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http?ref=badge_shield&issueType=license)\r\n[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http.svg?type=shield&issueType=security)](https://app.fossa.com/projects/custom%2B50508%2Fgithub.com%2FWPSemantix%2Ftimbr_python_http?ref=badge_shield&issueType=security)\r\n\r\n[![Python 3.7.13](https://img.shields.io/badge/python-3.7.13+-blue.svg)](https://www.python.org/downloads/release/python-3713/)\r\n[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-3820/)\r\n[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-3921/)\r\n\r\n[![PypiVersion](https://img.shields.io/pypi/v/pytimbr-api.svg)](https://badge.fury.io/py/pytimbr-api)\r\n\r\n# timbr REST API connector using Python\r\nThis project is a pure python connector to timbr (no dependencies required).\r\n\r\n## Dependencies\r\n- Python 3.7.13+ or 3.8.x or 3.9.x\r\n\r\n## Installation\r\n- Install as clone repository:\r\n - Install Python: https://www.python.org/downloads/release/python-3713/\r\n\r\n- Install using pip and git:\r\n - `pip install git+https://github.com/WPSemantix/timbr_python_http`\r\n\r\n- Install using pip:\r\n - `pip install pytimbr-api`\r\n\r\n## Sample usage\r\n- For an example of how to use the REST API connector for Timbr, follow this [Example file](examples/example.py)\r\n\r\n## Connection parameters examples\r\n\r\n### Generic example and explanation for each parameter\r\n```python\r\n pytimbr_api.run_query(\r\n url = \"<TIMBR_URL>\",\r\n ontology = \"<ONTOLOGY_NAME>\",\r\n token = \"<USER_TOKEN>\",\r\n query = \"<TIMBR_QUERY>\",\r\n datasource = \"<DATASOURCE_NAME>\",\r\n nested = \"<true/false>\",\r\n verify_ssl = <True/False>,\r\n enable_IPv6 = <True/False>,\r\n )\r\n\r\n # url - Required - String - The IP / Hostname of the Timbr platform.\r\n # ontology - Required - String - The ontology / knowledge graph to connect to.\r\n # token - Required - String - Timbr token value.\r\n # query - Required - String - The query that you want to execute.\r\n # datasource - Optional - String - Add the specific datasource name that you want to query from, the default value is the current active datasource of your ontology.\r\n # nested - Optional - String - Change to 'true' if nested flag needs to be enabled. make sure this flag contains string value not bool value.\r\n # verify_ssl - Optional - Boolean - Verifying the target server's SSL Certificate, use False to disable this process.\r\n # enable_IPv6 - Optional - Boolean - Change to 'true' if you are using IPv6 connection.\r\n```\r\n\r\n### HTTP example\r\n```python\r\n pytimbr_api.run_query(\r\n url = \"http://mytimbrenv.com:11000\",\r\n ontology = \"my_ontology\",\r\n token = \"tk_mytimbrtoken\",\r\n query = \"SELECT * FROM timbr.sys_concepts\",\r\n datasource = \"my_datasource\",\r\n nested = \"false\",\r\n verify_ssl = False,\r\n enable_IPv6 = False,\r\n )\r\n```\r\n\r\n### HTTPS example\r\n```python\r\n pytimbr_api.run_query(\r\n url = \"https://mytimbrenv.com:443\",\r\n ontology = \"my_ontology\",\r\n token = \"tk_mytimbrtoken\",\r\n query = \"SELECT * FROM timbr.sys_concepts\",\r\n datasource = \"my_datasource\",\r\n nested = \"false\",\r\n verify_ssl = True,\r\n enable_IPv6 = False,\r\n )\r\n```\r\n\r\n## Execute query examples\r\n### HTTP connection\r\n```python\r\n response = pytimbr_api.run_query(\r\n url = \"http://mytimbrenv.com:11000\",\r\n ontology = \"my_ontology\",\r\n token = \"tk_mytimbrtoken\",\r\n query = \"SELECT * FROM timbr.sys_concepts\",\r\n datasource = \"my_datasource\",\r\n nested = \"false\",\r\n verify_ssl = False,\r\n enable_IPv6 = False,\r\n )\r\n print(response)\r\n```\r\n\r\n### HTTPS connection\r\n```python\r\n response = pytimbr_api.run_query(\r\n url = \"https://mytimbrenv.com:443\",\r\n ontology = \"my_ontology\",\r\n token = \"tk_mytimbrtoken\",\r\n query = \"SELECT * FROM timbr.sys_concepts\",\r\n datasource = \"my_datasource\",\r\n nested = \"false\",\r\n verify_ssl = True,\r\n enable_IPv6 = False,\r\n )\r\n print(response)\r\n```\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Timbr REST API connector",
"version": "1.0.5",
"project_urls": {
"Bug Tracker": "https://github.com/WPSemantix/timbr_python_http/issues",
"Download": "https://github.com/WPSemantix/timbr_python_http/archive/refs/tags/v1.0.5.tar.gz",
"Homepage": "https://github.com/WPSemantix/timbr_python_http"
},
"split_keywords": [
"timbr",
" timbr-http",
" timbr-https",
" timbr-rest",
" timbr-api",
" timbr-rest-api",
" timbr-connector",
" pytimbrrestapi",
" pytimbr",
" pytimbrapi",
" pytimbrapi",
" pytimbr_api",
" pytimbr_api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cc80c903fd62730e7c1a9198fd0137c3beeaed4a407ffd83d818a20f46f86f9c",
"md5": "4c8cc87810902937650a23214b07be4d",
"sha256": "3a07c8119eaa0e420663c63402c24017bda04c029f06c46c4aa97e91a26188f7"
},
"downloads": -1,
"filename": "pytimbr_api-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "4c8cc87810902937650a23214b07be4d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4808,
"upload_time": "2025-01-02T19:31:37",
"upload_time_iso_8601": "2025-01-02T19:31:37.061696Z",
"url": "https://files.pythonhosted.org/packages/cc/80/c903fd62730e7c1a9198fd0137c3beeaed4a407ffd83d818a20f46f86f9c/pytimbr_api-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-02 19:31:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "WPSemantix",
"github_project": "timbr_python_http",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pytimbr-api"
}