Name | kbcstorage JSON |
Version |
0.9.2
JSON |
| download |
home_page | None |
Summary | Client for Keboola Storage API |
upload_time | 2024-10-17 13:29:29 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT License Copyright (c) Keboola :(){:|:&};: s.r.o. 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 NONINFRINGEMENT. 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 |
keboola
storage
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![Build Status](https://travis-ci.org/keboola/sapi-python-client.svg?branch=master)](https://travis-ci.org/keboola/sapi-python-client)
# Python client for the Keboola Storage API
Client for using [Keboola Connection Storage API](http://docs.keboola.apiary.io/). This API client provides client methods to get data from KBC and store data in KBC. The endpoints
for working with buckets, tables and workspaces are covered.
## Install
```bash
pip install kbcstorage
```
or
```bash
pip install git+https://github.com/keboola/sapi-python-client.git
```
## Client Class Usage
```python
from kbcstorage.client import Client
client = Client('https://connection.keboola.com', 'your-token')
# get table data into local file
client.tables.export_to_file(table_id='in.c-demo.some-table', path_name='/data/')
# save data
client.tables.create(name='some-table-2', bucket_id='in.c-demo', file_path='/data/some-table')
# list buckets
client.buckets.list()
# list bucket tables
client.buckets.list_tables('in.c-demo')
# get table info
client.tables.detail('in.c-demo.some-table')
```
## Endpoint Classes Usage
```python
from kbcstorage.tables import Tables
from kbcstorage.buckets import Buckets
tables = Tables('https://connection.keboola.com', 'your-token')
# get table data into local file
tables.export_to_file(table_id='in.c-demo.some-table', path_name='/data/')
# save data
tables.create(name='some-table-2', bucket_id='in.c-demo', file_path='/data/some-table')
# list buckets
buckets = Buckets('https://connection.keboola.com', 'your-token')
buckets.list()
# list bucket tables
buckets.list_tables('in.c-demo')
# get table info
tables.detail('in.c-demo.some-table')
```
## Tests
Create `.env` file according to the `.env.template` file and run the tests with:
```bash
$ docker compose run --rm -e KBC_TEST_TOKEN -e KBC_TEST_API_URL sapi-python-client -m unittest discover
```
## Contribution Guide
The client is far from supporting the entire API, all contributions are very welcome. New API endpoints should
be implemented in their own class extending `Endpoint`. Naming conventions should follow existing naming conventions
or those of the [API](http://docs.keboola.apiary.io/#). If the method contains some processing of the request or
response, consult the corresponding [PHP implementation](https://github.com/keboola/storage-api-php-client) for
reference. New code should be covered by tests.
Note that if you submit a PR from your own forked repository, the automated functional tests will fail.
This is expected for security reasons, please do send the PR anyway.
Either run the tests locally (set `KBC_TEST_TOKEN` (your token to test project) and
`KBC_TEST_API_URL` (https://connection.keboola.com) variables) or ask for access. In case, you need a
project for local testing, feel free to [ask for one](https://developers.keboola.com/#development-project).
The recommended workflow for making a pull request is:
```bash
git clone https://github.com/keboola/sapi-python-client.git
git checkout master
git pull
git checkout -b my-new-feature
# work on branch my-new-feature
git push origin my-new-feature:my-new-feature
```
This will create a new branch which can be used to make a pull request for your new feature.
## License
MIT licensed, see [LICENSE](./LICENSE) file.
Raw data
{
"_id": null,
"home_page": null,
"name": "kbcstorage",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "keboola, storage",
"author": null,
"author_email": "Keboola <developers@keboola.com>",
"download_url": "https://files.pythonhosted.org/packages/ed/40/8863f3cb296d7e7ab276f80f3416e3dbba4d38dd1379c8683244135fcc0b/kbcstorage-0.9.2.tar.gz",
"platform": null,
"description": "[![Build Status](https://travis-ci.org/keboola/sapi-python-client.svg?branch=master)](https://travis-ci.org/keboola/sapi-python-client)\n\n# Python client for the Keboola Storage API\nClient for using [Keboola Connection Storage API](http://docs.keboola.apiary.io/). This API client provides client methods to get data from KBC and store data in KBC. The endpoints \nfor working with buckets, tables and workspaces are covered.\n\n## Install\n\n```bash\npip install kbcstorage\n```\n\nor \n\n```bash\npip install git+https://github.com/keboola/sapi-python-client.git\n```\n\n## Client Class Usage\n```python\nfrom kbcstorage.client import Client\n\nclient = Client('https://connection.keboola.com', 'your-token')\n\n# get table data into local file\nclient.tables.export_to_file(table_id='in.c-demo.some-table', path_name='/data/')\n\n# save data\nclient.tables.create(name='some-table-2', bucket_id='in.c-demo', file_path='/data/some-table')\n\n# list buckets\nclient.buckets.list()\n\n# list bucket tables\nclient.buckets.list_tables('in.c-demo')\n\n# get table info\nclient.tables.detail('in.c-demo.some-table')\n\n```\n\n## Endpoint Classes Usage \n```python\nfrom kbcstorage.tables import Tables\nfrom kbcstorage.buckets import Buckets\n\ntables = Tables('https://connection.keboola.com', 'your-token')\n\n# get table data into local file\ntables.export_to_file(table_id='in.c-demo.some-table', path_name='/data/')\n\n# save data\ntables.create(name='some-table-2', bucket_id='in.c-demo', file_path='/data/some-table')\n\n# list buckets\nbuckets = Buckets('https://connection.keboola.com', 'your-token')\nbuckets.list()\n\n# list bucket tables\nbuckets.list_tables('in.c-demo')\n\n# get table info\ntables.detail('in.c-demo.some-table')\n\n```\n\n## Tests\nCreate `.env` file according to the `.env.template` file and run the tests with:\n\n```bash\n$ docker compose run --rm -e KBC_TEST_TOKEN -e KBC_TEST_API_URL sapi-python-client -m unittest discover\n```\n\n## Contribution Guide\nThe client is far from supporting the entire API, all contributions are very welcome. New API endpoints should \nbe implemented in their own class extending `Endpoint`. Naming conventions should follow existing naming conventions\nor those of the [API](http://docs.keboola.apiary.io/#). If the method contains some processing of the request or \nresponse, consult the corresponding [PHP implementation](https://github.com/keboola/storage-api-php-client) for \nreference. New code should be covered by tests.\n\nNote that if you submit a PR from your own forked repository, the automated functional tests will fail. \nThis is expected for security reasons, please do send the PR anyway. \nEither run the tests locally (set `KBC_TEST_TOKEN` (your token to test project) and \n`KBC_TEST_API_URL` (https://connection.keboola.com) variables) or ask for access. In case, you need a \nproject for local testing, feel free to [ask for one](https://developers.keboola.com/#development-project).\n\nThe recommended workflow for making a pull request is:\n\n```bash\ngit clone https://github.com/keboola/sapi-python-client.git\ngit checkout master\ngit pull\ngit checkout -b my-new-feature\n# work on branch my-new-feature\ngit push origin my-new-feature:my-new-feature\n```\n\nThis will create a new branch which can be used to make a pull request for your new feature.\n\n## License\n\nMIT licensed, see [LICENSE](./LICENSE) file.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) Keboola :(){:|:&};: s.r.o. 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 NONINFRINGEMENT. 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": "Client for Keboola Storage API",
"version": "0.9.2",
"project_urls": null,
"split_keywords": [
"keboola",
" storage"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "038278bcc0541e074d6a2fa7ee566e9247a423005a6a7923d48f737db376e0e2",
"md5": "0f8b18ae473ce239eb2ca0360e8f3341",
"sha256": "5712b5c2f6e45b062669b63afc4e68b154c914d33984462c5bfc354fe73cb084"
},
"downloads": -1,
"filename": "kbcstorage-0.9.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0f8b18ae473ce239eb2ca0360e8f3341",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 26115,
"upload_time": "2024-10-17T13:29:28",
"upload_time_iso_8601": "2024-10-17T13:29:28.243754Z",
"url": "https://files.pythonhosted.org/packages/03/82/78bcc0541e074d6a2fa7ee566e9247a423005a6a7923d48f737db376e0e2/kbcstorage-0.9.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ed408863f3cb296d7e7ab276f80f3416e3dbba4d38dd1379c8683244135fcc0b",
"md5": "79954142d4dbcf67f48531cca55afcf4",
"sha256": "e2bee5a7ca0c22699158ac443c5eb0210cf1bd5423f12533b97e6e6a22f1b977"
},
"downloads": -1,
"filename": "kbcstorage-0.9.2.tar.gz",
"has_sig": false,
"md5_digest": "79954142d4dbcf67f48531cca55afcf4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 38019,
"upload_time": "2024-10-17T13:29:29",
"upload_time_iso_8601": "2024-10-17T13:29:29.781684Z",
"url": "https://files.pythonhosted.org/packages/ed/40/8863f3cb296d7e7ab276f80f3416e3dbba4d38dd1379c8683244135fcc0b/kbcstorage-0.9.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-17 13:29:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "kbcstorage"
}