All Projects → python-odin → odin

python-odin / odin

Licence: BSD-3-Clause license
Data-structure definition/validation/traversal, mapping and serialisation toolkit for Python

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to odin

Choetl
ETL Framework for .NET / c# (Parser / Writer for CSV, Flat, Xml, JSON, Key-Value, Parquet, Yaml, Avro formatted files)
Stars: ✭ 372 (+1450%)
Mutual labels:  yaml, csv, xml
Python Benedict
dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. 📘
Stars: ✭ 204 (+750%)
Mutual labels:  yaml, csv, xml
cq
Clojure Command-line Data Processor for JSON, YAML, EDN, XML and more
Stars: ✭ 111 (+362.5%)
Mutual labels:  yaml, csv, msgpack
Validation
validation api extracted from play
Stars: ✭ 194 (+708.33%)
Mutual labels:  csv, validation, xml
Countries
World countries in JSON, CSV, XML and Yaml. Any help is welcome!
Stars: ✭ 5,379 (+22312.5%)
Mutual labels:  yaml, csv, xml
Structured Text Tools
A list of command line tools for manipulating structured text data
Stars: ✭ 6,180 (+25650%)
Mutual labels:  yaml, csv, xml
Countries States Cities Database
🌍 World countries, states, regions, provinces, cities, towns in JSON, SQL, XML, PLIST, YAML, and CSV. All Countries, States, Cities with ISO2, ISO3, Country Code, Phone Code, Capital, Native Language, Timezones, Latitude, Longitude, Region, Subregion, Flag Emoji, and Currency. #countries #states #cities
Stars: ✭ 1,130 (+4608.33%)
Mutual labels:  yaml, csv, xml
Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (+475%)
Mutual labels:  yaml, xml
Configurate
A simple configuration library for Java applications providing a node structure, a variety of formats, and tools for transformation
Stars: ✭ 148 (+516.67%)
Mutual labels:  yaml, xml
Srsly
🦉 Modern high-performance serialization utilities for Python (JSON, MessagePack, Pickle)
Stars: ✭ 189 (+687.5%)
Mutual labels:  yaml, msgpack
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (+766.67%)
Mutual labels:  yaml, msgpack
Oq
A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
Stars: ✭ 132 (+450%)
Mutual labels:  yaml, xml
Just Dashboard
📊 📋 Dashboards using YAML or JSON files
Stars: ✭ 1,511 (+6195.83%)
Mutual labels:  yaml, csv
Gelatin
Transform text files to XML, JSON, or YAML
Stars: ✭ 150 (+525%)
Mutual labels:  yaml, xml
Jobfunnel
Scrape job websites into a single spreadsheet with no duplicates.
Stars: ✭ 1,528 (+6266.67%)
Mutual labels:  yaml, csv
Yq
Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
Stars: ✭ 1,688 (+6933.33%)
Mutual labels:  yaml, xml
Chronicle Wire
A Java Serialisation Library that supports multiple formats
Stars: ✭ 204 (+750%)
Mutual labels:  yaml, csv
Renderer
Simple, lightweight and faster response (JSON, JSONP, XML, YAML, HTML, File) rendering package for Go
Stars: ✭ 220 (+816.67%)
Mutual labels:  yaml, xml
luban
你的最佳游戏配置解决方案 {excel, csv, xls, xlsx, json, bson, xml, yaml, lua, unity scriptableobject} => {json, bson, xml, lua, yaml, protobuf(pb), msgpack, flatbuffers, erlang, custom template} data + {c++, java, c#, go(golang), lua, javascript(js), typescript(ts), erlang, rust, gdscript, protobuf schema, flatbuffers schema, custom template} code。
Stars: ✭ 1,660 (+6816.67%)
Mutual labels:  yaml, msgpack
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (+920.83%)
Mutual labels:  yaml, csv

Odin

Odin provides a declarative framework for defining resources (classes) and their relationships, validation of the fields that make up the resources and mapping between objects (either a resource, or other python structures).

Odin also comes with built in serialisation tools for importing and exporting data from resources.

Docs/ Help ReadTheDocs Gitter.im
Build Python package Dependabot Status
Quality Maintainability Security Test Coverage Once you go Black...
Package Latest Version https://img.shields.io/pypi/pyversions/odin https://img.shields.io/pypi/l/odin PyPI - Wheel

Highlights

  • Class based declarative style
  • Fields for building composite resources
  • Field and Resource level validation
  • Easy extension to support custom fields
  • Python 2.7 1, Python 2.7+, Python 3.6+ and PyPy 1 supported
  • Support for documenting resources with Sphinx
  • Minimal dependencies (base functionality only requires six)

1 certain contrib items are not supported. Pint is not installable with PyPy.

Use cases

  • Design, document and validate complex (and simple!) data structures
  • Convert structures to and from different formats such as JSON, YAML, MsgPack, CSV, TOML
  • Validate API inputs
  • Define message formats for communications protocols, like an RPC
  • Map API requests to ORM objects

Quick links

Upcoming features

In development

  • XML Codec (export completed)
  • Complete documentation coverage
  • Improvements for CSV Codec (writing, reading multi resource CSV's)
  • Integration with other libraries (ie Django Models/Forms)
  • Integration with SQLAlchemy

Requires

  • six

Optional

  • simplejson - Odin will use simplejson if it is available or fallback to the builtin json library
  • msgpack-python - To enable use of the msgpack codec
  • pyyaml - To enable use of the YAML codec
  • toml - To enable use of the TOML codec

Contrib

  • jinja2 >= 2.7 - For documentation generation
  • pint - Support for physical quantities using the Pint library.

Development

  • pytest - Testing
  • pytest-cov - Coverage reporting

Example

With definition:

import odin

class Author(odin.Resource):
    name = odin.StringField()

class Publisher(odin.Resource):
    name = odin.StringField()

class Book(odin.Resource):
    title = odin.StringField()
    authors = odin.ArrayOf(Author)
    publisher = odin.DictAs(Publisher)
    genre = odin.StringField()
    num_pages = odin.IntegerField()
>>> b = Book(
        title="Consider Phlebas",
        genre="Space Opera",
        publisher=Publisher(name="Macmillan"),
        num_pages=471
    )
>>> b.authors.append(Author(name="Iain M. Banks"))
>>> from odin.codecs import json_codec
>>> json_codec.dumps(b, indent=4)
{
    "$": "Book",
    "authors": [
        {
            "$": "Author",
            "name": "Iain M. Banks"
        }
    ],
    "genre": "Space Opera",
    "num_pages": 471,
    "publisher": {
        "$": "Publisher",
        "name": "Macmillan"
    },
    "title": "Consider Phlebas"
}

Authors

Tim Savage

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].