kbcstorage


Namekbcstorage JSON
Version 0.9.0 PyPI version JSON
download
home_pageNone
SummaryClient for Keboola Storage API
upload_time2024-05-09 12:30:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT 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/e4/1b/9639a69bd083ec51e69b07b4f3b69ec8361e4185e11b05cd546219cf08fc/kbcstorage-0.9.0.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.0",
    "project_urls": null,
    "split_keywords": [
        "keboola",
        " storage"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c0079bfaf1ba7e7bdcbf4ac87f4663dc7cf44935e0302e4405529c1a710770c",
                "md5": "95f43d8cef09ad951a1bc52b1e5f2602",
                "sha256": "962aee91bba04876f1d8f1127f17f60dc32fdc45285c5be52f306851f98d9133"
            },
            "downloads": -1,
            "filename": "kbcstorage-0.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "95f43d8cef09ad951a1bc52b1e5f2602",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 25456,
            "upload_time": "2024-05-09T12:30:04",
            "upload_time_iso_8601": "2024-05-09T12:30:04.833924Z",
            "url": "https://files.pythonhosted.org/packages/7c/00/79bfaf1ba7e7bdcbf4ac87f4663dc7cf44935e0302e4405529c1a710770c/kbcstorage-0.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e41b9639a69bd083ec51e69b07b4f3b69ec8361e4185e11b05cd546219cf08fc",
                "md5": "9f258c59f65b32b8ed13387a3c39babb",
                "sha256": "008243c3d552d936b24e7b6572e7d66cc1f765b282ebe9bc50ead957dda19f21"
            },
            "downloads": -1,
            "filename": "kbcstorage-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9f258c59f65b32b8ed13387a3c39babb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 36922,
            "upload_time": "2024-05-09T12:30:06",
            "upload_time_iso_8601": "2024-05-09T12:30:06.555186Z",
            "url": "https://files.pythonhosted.org/packages/e4/1b/9639a69bd083ec51e69b07b4f3b69ec8361e4185e11b05cd546219cf08fc/kbcstorage-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-09 12:30:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "kbcstorage"
}
        
Elapsed time: 0.22638s