Metadata-Version: 2.4
Name: icat-sync-parametertype
Version: 1.0.0
Summary: Python client to synchronize parameterType from the icat-esrf-definitions with the ICAT database
Author-email: ESRF <marjolaine.bodin@esrf.fr>
License: # MIT License
        
        **Copyright (c) 2024 European Synchrotron Radiation Facility**
        
        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.
        
Project-URL: Homepage, https://gitlab.esrf.fr/icat/data-sync/parametertype
Project-URL: Documentation, https://gitlab.esrf.fr/icat/data-sync/parametertype
Project-URL: Repository, https://gitlab.esrf.fr/icat/data-sync/parametertype
Project-URL: Issues, https://gitlab.esrf.fr/icat/data-sync/parametertype/issues
Project-URL: Changelog, https://gitlab.esrf.fr/icat/data-sync/parametertype/-/blob/main/CHANGELOG.md
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: python-icat
Requires-Dist: icat-esrf-definitions
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: dev
Requires-Dist: icat-sync-parametertype[test]; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# icat-sync-parametertype

A python client to synchronize the metadata defined in the [ICAT ESRF definitions](https://gitlab.esrf.fr/icat/hdf5-master-config) with the ICAT database.

```bash
icat-sync-parametertype -w http://ovm-icat-test.esrf.fr:8080 -a db -u admin -P
```

`-P` prompts for the password. The connection can also be read from a
[python-icat configuration file](https://python-icat.readthedocs.io/en/stable/config.html)
(`icat.cfg`, or the file given by the `ICAT_CFG` environment variable), selecting a section with `-s`.
Copy [icat.cfg.example](icat.cfg.example) to `icat.cfg` and fill in the credentials:

```bash
icat-sync-parametertype -s test
```

## Options

- `--dry-run`: only show the changes, nothing is registered in ICAT.
- `--yes`: register the changes without asking for confirmation (for CI).

## Exit codes

| Code | Meaning |
|------|---------|
| 0 | ICAT is up to date, or the changes were registered (or declined) |
| 1 | At least one change failed to be registered |
| 2 | `--dry-run` detected changes |
