All Projects → owainlewis → Yaml

owainlewis / Yaml

Licence: mit
A fast, idiomatic and easy to use Clojure YAML library. Based on Snake YAML

Programming Languages

clojure
4091 projects

Labels

Projects that are alternatives of or similar to Yaml

Home Assistant Config
My Home Assistant configuration
Stars: ✭ 41 (-37.88%)
Mutual labels:  yaml
Resticprofile
Configuration profiles for restic backup
Stars: ✭ 48 (-27.27%)
Mutual labels:  yaml
Re Txt
converts text-formats from one to another, it is very useful if you want to re-format a json file to yaml, toml to yaml, csv to yaml, ... etc
Stars: ✭ 59 (-10.61%)
Mutual labels:  yaml
Bashful
Use a yaml file to stitch together commands and bash snippits and run them with a bit of style. Why? Because your bash script should be quiet and shy-like (...and not such a loud mouth).
Stars: ✭ 1,018 (+1442.42%)
Mutual labels:  yaml
Shon
A simple tool to convert json or yaml into a shell-compliant data structure.
Stars: ✭ 47 (-28.79%)
Mutual labels:  yaml
Communityscrapers
This is a public repository containing scrapers created by the Stash Community.
Stars: ✭ 51 (-22.73%)
Mutual labels:  yaml
Emrichen
A Template engine for YAML & JSON
Stars: ✭ 40 (-39.39%)
Mutual labels:  yaml
Ansible In Action
Ansible playbook to deploy your Laravel code base to VPS
Stars: ✭ 61 (-7.58%)
Mutual labels:  yaml
Ansible Config encoder filters
Ansible role used to deliver the Config Encoder Filters.
Stars: ✭ 48 (-27.27%)
Mutual labels:  yaml
Hiyapyco
HiYaPyCo - A Hierarchical Yaml Python Config
Stars: ✭ 58 (-12.12%)
Mutual labels:  yaml
I18nplugin
Intellij idea i18next support plugin
Stars: ✭ 43 (-34.85%)
Mutual labels:  yaml
Legivel
F# Yaml 1.2 parser
Stars: ✭ 47 (-28.79%)
Mutual labels:  yaml
Feedr
Use feedr to fetch the data from a remote url, respect its caching, and parse its data. Despite its name, it's not just for feed data but also for all data that you can feed into it (including binary data).
Stars: ✭ 56 (-15.15%)
Mutual labels:  yaml
Jsonj
A fluent Java API for manipulating json data structures
Stars: ✭ 42 (-36.36%)
Mutual labels:  yaml
Vim Yaml Folds
YAML, RAML, EYAML & SaltStack SLS folding for Vim
Stars: ✭ 59 (-10.61%)
Mutual labels:  yaml
Fast yaml
Fast YAML native library for Erlang / Elixir
Stars: ✭ 40 (-39.39%)
Mutual labels:  yaml
Yglu
Yglu ᕄ !? - YAML glue for structural templating and processing
Stars: ✭ 51 (-22.73%)
Mutual labels:  yaml
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 (+1612.12%)
Mutual labels:  yaml
Github Labeler
Declarative way to configure GitHub labels
Stars: ✭ 62 (-6.06%)
Mutual labels:  yaml
Yaml2go
Converts YAML specs into Go Lang type definitions
Stars: ✭ 57 (-13.64%)
Mutual labels:  yaml

YAML

wercker status

An updated YAML library for Clojure based on Snake YAML and heavily inspired by clj-yaml

Install

Lein

Clojars Project

Usage

(ns demo.core
  (:refer-clojure :exclude [load])
  (:require [yaml.core :as yaml]))

;; Note on DSL
;; yaml/load & yaml/parse-string are identical
;; yaml/dump & yaml/generate-string are identical

;; Parse a YAML file

(yaml/from-file "config.yml")

;; Parse a YAML string

(yaml/parse-string "foo: bar")

;; Optionally pass `true` as a second argument to from-file or parse-string to keywordize all keys
(yaml/parse-string "foo: bar" :keywords true)

;; Parsing YAML with unknown tags
(yaml/parse-string "--- !foobar
  foo: HELLO WORLD")

;; This will parse properly
(yaml/parse-string "--- !foobar
  foo: HELLO WORLD" :constructor yaml.reader/passthrough-constructor)

;; Dump YAML

(yaml/generate-string {:foo "bar"})

;; Examples

(yaml/generate-string [{:name "John Smith", :age 33} {:name "Mary Smith", :age 27}])
;; "- {name: John Smith, age: 33}\n- {name: Mary Smith, age: 27}\n"

(yaml/parse-string "
- {name: John Smith, age: 33}
- name: Mary Smith
  age: 27
")

=> ({:name "John Smith", :age 33}
    {:name "Mary Smith", :age 27})

;; Output Formatting examples

(def data [{:name "John Smith", :age 33} {:name "Mary Smith", :age 27}])

(yaml/generate-string data)
=> - {age: 33, name: John Smith}
   - {age: 27, name: Mary Smith}

(yaml/generate-string data :dumper-options {:flow-style :flow})
=> [{age: 33, name: John Smith}, {age: 27, name: Mary Smith}]

(yaml/generate-string data :dumper-options {:flow-style :block})
=> - age: 33
     name: John Smith
   - age: 27
     name: Mary Smith

(yaml/generate-string data :dumper-options {:flow-style :flow :scalar-style :single-quoted})
=> [{'age': !!int '33', 'name': 'John Smith'}, {'age': !!int '27', 'name': 'Mary Smith'}]

Valid values for flow-style are:
- :auto
- :block
- :flow

Valid values for scalar-style are:
- :double-quoted
- :single-quoted
- :literal
- :folded
- :plain

All are documented at http://yaml.org/spec/current.html

This is mainly an updated version of clj-yaml with some updates

  1. Updates snake YAML to latest version
  2. Split reader and writer into separate protocols and files
  3. Ability to read YAML from file in single function
  4. Return vector [] instead of list when parsing java.util.ArrayList
  5. Ability to parse multiple documents

License

Distributed under the Eclipse Public License

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].