No project description provided
Project description
Dataclasses Avro Schema CLI
Command line interface from dataclasses-avroschema to work with avsc
resources
Requirements
python 3.8+
Documentation
https://marcosschroh.github.io/dc-avro/
Usage
You can validate avro schemas
either from a local file
or url
:
Assuming that we have a local file schema.avsc
that contains an avro schema
, we can check whether it is valid
dc-avro validate-schema --path schema.avsc
Valid schema!! 👍
{
'type': 'record',
'name': 'UserAdvance',
'fields': [
{'name': 'name', 'type': 'string'},
{'name': 'age', 'type': 'long'},
{'name': 'pets', 'type': {'type': 'array', 'items': 'string', 'name': 'pet'}},
{'name': 'accounts', 'type': {'type': 'map', 'values': 'long', 'name': 'account'}},
{'name': 'favorite_colors', 'type': {'type': 'enum', 'name': 'FavoriteColor', 'symbols': ['BLUE', 'YELLOW', 'GREEN']}},
{'name': 'has_car', 'type': 'boolean', 'default': False},
{'name': 'country', 'type': 'string', 'default': 'Argentina'},
{'name': 'address', 'type': ['null', 'string'], 'default': None},
{'name': 'md5', 'type': {'type': 'fixed', 'name': 'md5', 'size': 16}}
]
}
To see all the commands execute dc-avro --help
Features
- Validate
schemas
- Generate
models
fromschemas
- Data deserialization with
schema
- Data serialization with
schema
- View diff between
schemas
- [] Generate fake data from
schema
Development
- Install requirements:
poetry install
- Code linting:
./scripts/format
- Run tests:
./scripts/test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dc_avro-0.6.5.tar.gz
(4.8 kB
view hashes)