Skip to main content

aridity

Build Status

The Arid Manifesto

  • Paths as keys to avoid key concatenation
  • It's never necessary to repeat a value
  • Minimal syntax for surprise-free authoring
  • Lazy context-sensitive evaluation
  • Strongly (dynamically) typed values
  • Central defaulting rather than at call sites
  • Templating using same syntax as expressions
  • Easy to correctly quote/escape values in templates
  • Extensibility via user-defined functions
  • Easy tasks are easy, hard tasks are possible
  • Many applications can share one user config
  • Principle of least astonishment driven design

Config file syntax

: Until aridity gets support for comments, you can use the colon directive to ignore data.
: Directives MUST be separated from data by whitespace, and are typically punctuation.

: Here's the equals directive:
foo = bar
: This does what you'd expect - assign the string value bar to foo.
: foo is actually a path of length 1, path components are whitespace-separated:
this is a path = this is a value

: Internal whitespace in values is preserved (leading and trailing whitespace is not):
two sentences = Some like 2 spaces.  After a full stop.

: You can use indentation to avoid typing a common path prefix multiple times:
app1 feature1
    data1 = value1
    data2 = value2
app2
    feature1 data = value3
    feature2
        data1 = value4
        data2 = value5
: Exactly the same effect without using indentation:
app1 feature1 data1 = value1
app1 feature1 data2 = value2
app2 feature1 data = value3
app2 feature2 data1 = value4
app2 feature2 data2 = value5

: The right hand side of an equals is actually an expression.
: In an expression, a dollar sign with brackets can be used to refer to another path:
has value
    bar = $(foo)
    value3 = $(app2 feature1 data)
: Round brackets and square brackets have exactly the same effect:
also has value bar = $[foo]
: Values can be concatenated:
two bars
    without spacing = $(foo)$(foo)
    with one space  = $(foo) $(foo)
    with 2 spaces   = $(foo)  $(foo)

: To get a literal dollar there is a special form for quoting:
financial report = $'(We lost $100 on Friday.)
: Be careful with nested brackets, the first matching bracket ends the special form:
behaviour
    expected   = $'[Lunch cost $20 (worth it though).]
    unexpected = $'(Lunch cost $20 (worth it though).)

: Another special form can be used to preserve leading/trailing whitespace:
padded bars = $.( $(foo) $(foo) )
: Brackets can span multiple lines:
bar per line
    without final newline = $.($(foo)
$(foo))
    with final newline = $.($(foo)
$(foo)
)

: Evaluation is lazy, the expression is what is actually assigned to the path:
no problem = $(this path will get a value later)
: If your use-case demands it, you can force eager evaluation:
bar even if foo changes later := $(foo)

: When evaluating a path the local context is examined first, then its parents if path not found:
host
    short path = nope
    guest short path = yep
    should be nope = $(short path)
    guest should be yep = $(short path)
does not work = $(short path)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aridity-14.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aridity-14-py2.py3-none-any.whl (58.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file aridity-14.tar.gz.

File metadata

  • Download URL: aridity-14.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for aridity-14.tar.gz
Algorithm Hash digest
SHA256 ded6fe1cfae5a7a2ec576b7139ab0ca53bffa38b282db7cdafa4c08d1f983ec0
MD5 e4805d9bf5a0fbe18eddd3a36d8d5539
BLAKE2b-256 035879a315a4483bea680a2927c1010e99a13c824edb8ece04af82fe597d49b9

See more details on using hashes here.

File details

Details for the file aridity-14-py2.py3-none-any.whl.

File metadata

  • Download URL: aridity-14-py2.py3-none-any.whl
  • Upload date:
  • Size: 58.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for aridity-14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7237478208036c43b098421a35f2abb3185b53b52ca2676e9f95a3c93fd4708b
MD5 02cebc5d044a65f42c590aa6728113d0
BLAKE2b-256 9ddc17828a197dc1e52dbfa606207dece6f069db67c9ca133d2ea1df861d004f

See more details on using hashes here.

Release history Release notifications | RSS feed

102

2 files

101

2 files

100

2 files

99

2 files

98

2 files

97

2 files

96

2 files

95

2 files

94

2 files

93

2 files

92

2 files

91

2 files

90

2 files

89

2 files

88

2 files

87

2 files

86

2 files

85

2 files

84

2 files

83

2 files

82

2 files

81

2 files

80

2 files

79

2 files

78

2 files

77

2 files

76

2 files

75

2 files

74

2 files

73

2 files

72

2 files

71

2 files

70

2 files

69

2 files

68

2 files

67

2 files

66

2 files

65

2 files

64

2 files

63

2 files

62

2 files

61

2 files

60

2 files

59

2 files

58

2 files

57

2 files

56

2 files

55

2 files

54

2 files

53

2 files

52

2 files

51

2 files

50

2 files

49

2 files

48

2 files

47

2 files

46

2 files

45

2 files

44

2 files

43

2 files

42

2 files

41

2 files

40

2 files

39

2 files

38

2 files

37

2 files

36

2 files

35

2 files

34

2 files

33

2 files

32

2 files

31

2 files

30

2 files

29

2 files

28

2 files

27

2 files

26

2 files

25

2 files

24

2 files

23

2 files

22

2 files

21

2 files

20

2 files

19

2 files

18

2 files

17

2 files

16

2 files

15

2 files

This release

14 This release

2 files

13

2 files

12

2 files

11

2 files

10

2 files

9

2 files

8

2 files

7

2 files

6

2 files

5

2 files

4

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page