directory-schema-0.0.2
توضیحات
Use JSON Schema to validate directory structures
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | directory-schema-0.0.2 |
| نام | directory-schema |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | C McCallum |
| ایمیل نویسنده | mccallucc@gmail.com |
| آدرس صفحه اصلی | https://github.com/hubmapconsortium/directory-schema |
| آدرس اینترنتی | https://pypi.org/project/directory-schema/ |
| مجوز | MIT license |
# directory_schema
[](https://pypi.org/project/directory-schema/)
Use JSON Schema to validate directory structures:
The specified directory is translated into a JSON structure like the output from `tree -J`,
and is validated against a JSON Schema, provided as a dict inside Python,
or as a JSON or YAML file through the CLI.
Sample schemas and directories are in the [test fixtures](tests/fixtures).
Instructions for contributors are [here](CONTRIBUTING.md).
## CLI
```
$ directory_schema -h
usage: directory_schema [-h] DIRECTORY SCHEMA
positional arguments:
DIRECTORY Directory to validate
SCHEMA Schema (JSON or YAML) to validate against
optional arguments:
-h, --help show this help message and exit
```
## Python
```
>>> from directory_schema import directory_schema
>>> directory_schema.validate_dir(
... 'tests/fixtures/just-a-placeholder',
... {'items':
... {'properties':
... {'name':
... {'pattern': 'not-placeholder'}}}}
... )
Traceback (most recent call last):
...
raise DirectoryValidationErrors(errors)
directory_schema.directory_schema.DirectoryValidationErrors: This string:
placeholder
fails this "pattern" check:
not-placeholder
...
```
## Thank you
This package was created with Cookiecutter and the `cs01/cookiecutter-pypackage` project template.
- [Cookiecutter](https://github.com/audreyr/cookiecutter)
- [cs01/cookiecutter-pypackage](https://github.com/cs01/cookiecutter-pypackage)
نیازمندی
| مقدار | نام |
|---|---|
| - | jsonschema |
| - | pyyaml |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl directory-schema-0.0.2:
pip install directory-schema-0.0.2.whl
نصب پکیج tar.gz directory-schema-0.0.2:
pip install directory-schema-0.0.2.tar.gz