Metadata-Version: 2.1
Name: itkdb
Version: 0.4.0rc9
Summary: Python wrapper to interface with ITk DB.
Project-URL: Homepage, https://gitlab.cern.ch/atlas-itk/sw/db/itkdb
Project-URL: Bug Tracker, https://gitlab.cern.ch/atlas-itk/sw/db/itkdb/issues
Project-URL: Source, https://gitlab.cern.ch/atlas-itk/sw/db/itkdb
Author-email: Giordon Stark <kratsg@gmail.com>
Maintainer-email: Giordon Stark <kratsg@gmail.com>
License-File: COPYING
License-File: LICENSE
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
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: Topic :: Scientific/Engineering
Requires-Python: >=3.7
Requires-Dist: attrs
Requires-Dist: cachecontrol[filecache]
Requires-Dist: certifi
Requires-Dist: click>=6.0
Requires-Dist: importlib-resources; python_version < '3.9'
Requires-Dist: pylibmagic
Requires-Dist: python-dotenv
Requires-Dist: python-jose
Requires-Dist: python-magic
Requires-Dist: requests>=1.6.1
Requires-Dist: simple-settings
Provides-Extra: contrib
Requires-Dist: html2text; extra == 'contrib'
Provides-Extra: dev
Requires-Dist: betamax; extra == 'dev'
Requires-Dist: betamax-serializers; extra == 'dev'
Requires-Dist: pytest-cov>=3; extra == 'dev'
Requires-Dist: pytest-mock; extra == 'dev'
Requires-Dist: pytest>=6; extra == 'dev'
Requires-Dist: requests-mock; extra == 'dev'
Requires-Dist: tbump>=6.7.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser>=0.13; extra == 'docs'
Requires-Dist: sphinx-book-theme>=0.1.0; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx>=4.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: betamax; extra == 'test'
Requires-Dist: betamax-serializers; extra == 'test'
Requires-Dist: pytest-cov>=3; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'
Requires-Dist: pytest>=6; extra == 'test'
Requires-Dist: requests-mock; extra == 'test'
Description-Content-Type: text/markdown

# ITk DB v0.4.0rc9

[![PyPI version](https://badge.fury.io/py/itkdb.svg)](https://badge.fury.io/py/itkdb)
[![Downloads](https://pepy.tech/badge/itkdb)](https://pepy.tech/project/itkdb)
[![Downloads](https://pepy.tech/badge/itkdb/month)](https://pepy.tech/project/itkdb)
[![Downloads](https://pepy.tech/badge/itkdb/week)](https://pepy.tech/project/itkdb)

To install as a user

```
pip install itkdb
```

or if you wish to develop/contribute

```
git clone ...
pip install -e .[develop]
```

or

```
git clone ...
pip install -e .[complete]
```

## Using

Command line available via

```
itkdb --help
```

## Environment Variables

See [itkdb/settings/base.py](src/itkdb/settings/base.py) for all environment
variables that can be set. All environment variables for this package are
prefixed with `ITKDB_`. As of now, there are:

- `ITKDB_ACCESS_CODE1`: access code #1 for authentication
- `ITKDB_ACCESS_CODE2`: access code #2 for authentication
- `ITKDB_ACCESS_SCOPE`: scope for the access token authentication request
- `ITKDB_AUTH_URL`: authentication server
- `ITKDB_SITE_URL`: API server
- `ITKDB_CASSETTE_LIBRARY_DIR`: for tests, where to store recorded
  requests/responses

## Develop

### Bump Version

Run `bump2version x.y.z` to bump to the next version. We will always tag any
version we bump, and this creates the relevant commits/tags for you. All you
need to do is `git push --tags` and that should be it.

# Examples

```python
import itkdb

client = itkdb.Client()
comps = client.get(
    "listComponents", json={"project": "P", "pageInfo": {"pageSize": 32}}
)

for i, comp in enumerate(comps):
    print(i, comp["code"])
```

# FAQ

## SSL Error with CERN websites

If you run into SSL errors with CERN websites, you might need the CERN
certificate chain to sign the certificates correctly. Just add a `verify`
keyword into your calls:

```python
client.get(..., verify=itkdb.data / "CERN_chain.pem")
```

and it should work.
