epics-base compliant macro tools
Project description
epics-base compliant macro tools.
What?
Do you want epics-base compliant macro expansion, with all of its idiosyncracies?
No? I didn’t think so. This is a really boring project and you probably don’t need it.
Then why?
This will be the future of the macro and IOC shell splitting tools in whatrecord, removing its reliance on Cython and epicscorelibs.
Examples
macros_from_string
from epicsmacrolib import macros_from_string
macros_from_string("A=5, B=$(A=3)")
# -> {'A': '5', 'B': '$(A=3)'}
MacroContext
from epicsmacrolib import MacroContext
ctx = MacroContext(use_environment=True)
ctx.define(TEST="A")
print(ctx.expand("TEST=$(TEST) SHELL=$(SHELL)"))
# TEST=A SHELL=/bin/bash
ctx = MacroContext(use_environment=False)
ctx.define_from_string("A=5,B=6")
ctx.define(C="7")
print(ctx.expand("$(A) $(B) ${C} ${D=5} ${E}"))
# -> 5 6 7 5 $(E)
ctx = MacroContext(use_environment=False, show_warnings=True)
ctx.define_from_string("A=5,B=6")
ctx.define(C="7")
print(ctx.expand("$(A) $(B) ${C} ${D=5} ${E}"))
# -> 5 6 7 5 $(E,undefined)
ctx.define_from_string("A=5,B=$(B)")
print(ctx.expand("$(A) $(B)"))
# -> 5 $(B,recursive)
with ctx.scoped(A="10", B="0"):
print(ctx.expand("$(A)"))
# -> 10
with ctx.scoped(A="0"):
print(ctx.expand("$(A)"))
# -> 0
print(ctx.expand("$(A)"))
# -> 10
split_iocsh_line (like shlex.split)
from epicsmacrolib import split_iocsh_line
split_iocsh_line("dbLoadRecords > output_filename")
# -> IocshSplit(
# argv=["dbLoadRecords"],
# redirects={1: IocshRedirect(fileno=1, name="output_filename", mode="w")},
# error=None,
# )
License
The Python portions of this code is under a BSD-3 clause license (LicenseRef-BSD-3-Clause-SLAC, see LICENSE). Portions of epics-base have been vendored in src under its original license (see src/LICENSE).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for epicsmacrolib-0.6.1-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e923037acceb00929ca3ff5dd8b4a2e4805938b5c4e4a5da57d20422ccb301b |
|
MD5 | e01f6313c47d12f278392e09215ab903 |
|
BLAKE2b-256 | 8cfdce66a53094c116bcbdee60ae6e800cf4899419cd20e1203fc780669c110b |
Hashes for epicsmacrolib-0.6.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0bbb201fa9ac187406ca44afaeb56bf592a7b583136dab7b7579f05e3dd24aa |
|
MD5 | 91936f05243da6112ad3c0ad4e053bbb |
|
BLAKE2b-256 | 9daf279a3ac9ba64668b3246abca0fee2db7745732072ca51c1c928d371585d2 |
Hashes for epicsmacrolib-0.6.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4784d2dd4dcaacb7041819bc116efe915ad74cf2e46f954b8510cc65cb368f70 |
|
MD5 | f98982b6549e798c54bc49e54029c2b4 |
|
BLAKE2b-256 | 4924c1faff442170009528793df24372c63d01347345c7617f5cc9ab1172c1ad |
Hashes for epicsmacrolib-0.6.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71632b2dfa37d68d404f6a14f621fa2504a4dfeceac15db27c326bae39a68e6 |
|
MD5 | 67f1f5092b9085d61b8b6dfe84683ac2 |
|
BLAKE2b-256 | c53827fa383d1b2648304c3274c412da2105904cbd5d0b01dcf91a9ded5398eb |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d553b7056c2e2361317ae7576d1e6e8aafc39922d276c0b25ca7c5660b759a |
|
MD5 | 6c335fb2d1e02d7f1431cd78fe3e5722 |
|
BLAKE2b-256 | 27aa299074022ec296be73559f6ef2eb73dcf702df9e876c839248a4487fe972 |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e63f4acff6a11908ca65a497a1ac95ef4c59c2488ea432eba4d172e0556e671f |
|
MD5 | 021807b5d34164af02fb2c9e40b69e05 |
|
BLAKE2b-256 | 31c9e71017c75c9731496159765f45d91ec6301c25149053e951445ebde217a0 |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 496366b5efbad23b924a4a4b7d2167f9b40150c7fa923b7ab5dabbd178f5f027 |
|
MD5 | a12b8bbf1df93384fb190a3159fa25b5 |
|
BLAKE2b-256 | 566d2af76022c7c4f64c87ae5467925b9af69ec409f1800809edfdc8bbea986d |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd93fb912256ab22cb1c3e96b1c5d36c5947fde589094aa0fe03222d6935894e |
|
MD5 | 5368a82a24bfa3487be5fe4714aeb507 |
|
BLAKE2b-256 | 37c26b279c3a0faad5d564ea22349a4c3c2227723516e5fb295624fb35628bea |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 981d70a6ab47f7fdd3939972e2a7943ea1693cbd18cc51dc004146ba4b13a94b |
|
MD5 | d39a95377040bc0eb493d26b932c2d7d |
|
BLAKE2b-256 | f4b6ff637219e0cc21624be07e05dbfa03b3e264269617a10dc05772172732aa |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77103a35178e7a1a6a5a80c9ea8505db76aea585cf677ff629624199c85b6834 |
|
MD5 | 807a6d89b77526471c6f886059c2527b |
|
BLAKE2b-256 | af05bc93a11339a7b1c70c741d3306e35008613d15cd03eb4133e8f768ae92bb |
Hashes for epicsmacrolib-0.6.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb73224fe499860375962f15cb4d27b021b4ee101f58ac9ed3fbc35395e53c97 |
|
MD5 | e46ccf4fd5a52c027ffd6a2a384c48a8 |
|
BLAKE2b-256 | 00b1add04a8b15ff4fff8a363ec79e885d713c017fe1a6b959a2af7717291aef |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 928508b8a0d7ec962251ace084b6e374bd2e588457d8d0443efcb83325cefc83 |
|
MD5 | a940cfd6c46a713c34e68754931086a3 |
|
BLAKE2b-256 | 6682328cf02865141f6e9b8dd3b230976e85380e5493b4d8b39fa39a40a9b96b |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3206af581db6f61e7dbc2c5f766cd0ba4df2a6bc6a3e1c47a7b80456c8be32ae |
|
MD5 | 17610568f56089d9d12ebf14b017df54 |
|
BLAKE2b-256 | c5e2daf590604dd3fb7a7d5dae854435f1f09cf56d03b18c4bdb8e39fe60d842 |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae682c97da5be3c24c4f0799187a6d0518eea414b1fedd450f5bfd66a4dd9818 |
|
MD5 | 686dba8349b93b521925460571ef3990 |
|
BLAKE2b-256 | 3dde7dd1863d69d3081c90b991bf3094ee266e456638a13a964a13cb3773a49c |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2bf47a2e751840bf06cdf6bd780866e8b5dfb7778ba60dd3b0bd27158cdd9cb |
|
MD5 | 3f3711a1f7a9e8b0d7ff7dacfab8ae3d |
|
BLAKE2b-256 | f679c4190476b5ec29c45678b9d451eae58e7652771a745ff12a7f0e59370e0e |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34dd7a65ddb0cdfb979075f95e28078fd79fd2d496a78e8dfcf1eeb588933d2a |
|
MD5 | 8fc4eae83a0a0b2a1d0395802044cf8c |
|
BLAKE2b-256 | 1a327ed61c84f5224418970235fc19bf4020e1e30a94b582449b029c585bbba1 |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f1aa1cbef8191f610b4b8d4d6e27fcec249cd36c153fb12adf9f879deeb92e |
|
MD5 | 85165b1673802b84159b71c0d7b3fc17 |
|
BLAKE2b-256 | bcc2bed057bf12c0b1feb2ea691ff01b3126089f46cb853ca4fc2a33284da897 |
Hashes for epicsmacrolib-0.6.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df1d8834dcf1fde489caf61ea744cc2ce70247e130b6afc428d40755f188fc46 |
|
MD5 | b5a08d61eb9aeb628741677516c5082f |
|
BLAKE2b-256 | 0334c0f361db64ec23d77c675497817de11f9f32cd4ef10fe23866a2b4267c58 |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdb98d4022c9908ee97a9c79d5761fc515647566332682a901fbad4fcf8e313d |
|
MD5 | c1d2432798f5f012752ec5f43d00ef1e |
|
BLAKE2b-256 | 5d6648839fc387c5066b77ffb318cb82cbf337d5174a3500631d35cfb72dd461 |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 513527fb147c5f083c06d2aa8024cf30db5d3ed6c2e521495d19a0e894278bc1 |
|
MD5 | 35aecbd8d6169d2db540730feb6b4296 |
|
BLAKE2b-256 | a44a5969743c00094dc13c913e7db6d30076b0c44171b2a4da36654d224f8592 |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d869f58431efe292a8a3c9ac6aead1da3b25b77a5c567a363f8d041d8b857cf |
|
MD5 | 9e1bdf9dc2393d886fac2d7103192401 |
|
BLAKE2b-256 | bed028fdb52df5596e77ba19f9b7f875cdb9e82e2a9a0ab109ff7d04deec7ed0 |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67bee182c5ee78a2993c2c47a1ae3f74f010e5d416b96242faab50fa500b98b |
|
MD5 | fcf2a06a88ae392d92e382c2c4ad2f23 |
|
BLAKE2b-256 | efa0c7efb9d8087c28df0dba40056965d22520a0f0431be2270b071b9d8145ed |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf18d4eaeafeedf878c4cc5cfd3dc6cd265aaf6bfbcfb58207897ad002522168 |
|
MD5 | 46700ac2aba75adf2463bb49a65d5ca9 |
|
BLAKE2b-256 | c860c5ee123529ea2002237e157a16532bfb9af10be2252af807dd144d8b11f0 |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9b49c34da1a01617b4a452aa25823a13a76a775c7040d3961a8dbb89baf32d |
|
MD5 | 5dc273e8cd6befc781cd9f21c5f38677 |
|
BLAKE2b-256 | 9c7b90971f8d49e5a166d6f5383e7a21094bb27f1cbe26c60ea53151c82bb419 |
Hashes for epicsmacrolib-0.6.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e638f402f1cdaf9b84ced17cd51a8bbbfd56025375584e82e9f90126358000 |
|
MD5 | 7fd0a3950fb05188558ec72fe8734e87 |
|
BLAKE2b-256 | 2cc43131ea6340c4a8d6715b6303d7fa270d446d92366f2225ea3027643c31ab |