Skip to main content

Index

  • English Document

    English Document <- Here

  • Japanese Document

    Japanese Document

  • Annotation YAML(ANOY)

    A YAML file that allows type checking for Map types.

    More about ANOY

  • Configuration YAML(Config YAML)

    A YAML file that defines the data types usable in Annotation YAML.

    More about Config YAML

  • ANOY CLI

    A CLI application that verifies whether Annotation YAML adheres to the data type defined in Configuration YAML.

    More about ANOY CLI

Introduction

YAML maps often become nested and complex.

And these requests have come up.

  • Detecting typos in map keys.
  • Verifying the data type of map values.
  • Ensuring the map's nested structure is appropriate.

This library satisfies these requests.

Installing

pip install anoy

Package Dependencies

The following packages may not work properly if they are not installed:

  • PyYAML: Most popular YAML parser for Python.

Usage

library_config.yaml

"@Books":
  "@Summary": List the book titles.
  "!Child": "!FreeMap"
"@Author":
  "@Summary": Author of the book.
  "!Child": "!Str"
"@PublishYear":
  "@Summary": The year of the publishment.
  "!Child": "!Int"
"@Country":
  "@Summary": The author's native language.
  "!Child": "!Str"

valid_library.yaml:

"@Books":
  "Alice's Adventures in Wonderland":
    "@Author": Lewis Carroll
    "@PublishYear": 1865
    "@Country": UK
  "The Little Prince":
    "@Author": Antonie de Saint-Exupéry
    "@PublishYear": 1945
    "@Country": France
  "Harry Potter":
    "@Author": J.K.Rowling
    "@PublishYear": 1997
    "@Country": UK

Use the anoy command to verify data types.

If data type issues are not found, it outputs nothing.

>>> anoy library_config.yaml library.yaml
>>> 

If you mistyped @Auther as @Auther.

invalid_library.yaml:

"@Books":
  "Alice's Adventures in Wonderland":
    "@Auther": Lewis Carroll
    "@PublishYear": 1865
    "@Country": UK
  "The Little Prince":
    "@Auther": Antonie de Saint-Exupéry
    "@PublishYear": 1945
    "@Country": France
  "Harry Potter":
    "@Auther": J.K.Rowling
    "@PublishYear": 1997
    "@Country": UK

When there is an issue with the annotation YAML, anoy outputs as follows.

>>> anoy library_config.yaml library.yaml
>>> Traceback (most recent call last):
    ... (omission) ...
    src.anoyModule.anoyErrors.ConfigYamlError: `@Auther` is not defined.

For Developers

Testing

This project uses pytest.

If you want to test, put in following command.

pytest tests\unit\test_dictTraversal.py

Next To Do

  • READMEの詳細documentの更新。

Ideas

- key01
- key02
- key03

と

- {key01:value01}
- {key02:value02}
- {key03:value03}

を等価に扱うsystemが欲しい。

Metadata

Release files for anoy 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anoy 0.6.1
File Size Uploaded Provenance Actions
anoy-0.6.1.tar.gz 13.1 kB Without provenance Details for anoy-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anoy 0.6.1
File Interpreter ABI Platform Actions
anoy-0.6.1-py3-none-any.whl Python 3 none any Details for anoy-0.6.1-py3-none-any.whl

Total release size: 25.1 kB

Release files / anoy-0.6.1.tar.gz

Download URL anoy-0.6.1.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7ca08752808af32613c55ca16d6c4ebba74a3e2f30970d7cb4034c611208dbca
BLAKE2b-256 checksum
How to use checksums
a99184e5a69913a15e22fc8bd1df269b35d75110dcd6ef17832864967a86e659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release files / anoy-0.6.1-py3-none-any.whl

Download URL anoy-0.6.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a227494de9d3bda5204211e6cac8728075ce91528d2258f7eb8440e96a4792b3
BLAKE2b-256 checksum
How to use checksums
c53dde59ba348906d5fd4eb1a79c8b5ecca6a66f16ae30ef4c750371272c8dbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Security for anoy 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page