Metadata-Version: 2.1
Name: python-databasin
Version: 0.6.1
Summary: 
License: BSD-3-Clause
Author: Conservation Biology Institute
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
Requires-Dist: requests (>=2.32.2,<3.0.0)
Requires-Dist: restle (>=0.5.0,<0.6.0)
Requires-Dist: six (>=1.16.0,<2.0.0)
Description-Content-Type: text/markdown

# python-databasin 0.6.1

[![Build Status](https://travis-ci.org/consbio/python-databasin.png?branch=master)](https://travis-ci.org/consbio/python-databasin) [![Coverage Status](https://coveralls.io/repos/consbio/python-databasin/badge.svg?branch=master&service=github)](https://coveralls.io/github/consbio/python-databasin?branch=master)

```python-databasin``` is a client library for interacting with [Data Basin](http://databasin.org).

# Install
```bash
$ pip install python-databasin
```

# Example usage
The code snippet below will import a NetCDF dataset into Data Basin and make it public. Note that the account you use 
must have import permission and the import must have complete metadata and style information.

```python
from databasin.client import Client

c = Client()
c.login('user', 'pass')

# Package must have complete metadata and style necessary for one-step import
dataset = c.import_netcdf_dataset('/path/to/netcdf_with_metadata_and_style.zip')

# One-step imports are private by default
dataset.make_public()

print(dataset.id)
print(dataset.title)
```

You can also upload Esri layer packages (`.lpk`). As with NetCDF's, layer packages for now must have the all metadata
required by Data Basin to successfully import:

```python
dataset = c.import_lpk('/path/to/lpk_with_metadata.lpk')
print(dataset.id)
print(dataset.title)
```

`python-databasin` can be used with an API key instead of a password:

```python
from databasin.client import Client

c = Client()
c.set_api_key('<username>', '<api key>')

my_datasets = c.list_my_datasets()
```

