New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ckdl

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ckdl

KDL parser and writer with a C back-end

  • 1.0
  • PyPI
  • Socket score

Maintainers
1

ckdl - KDL reading and writing using a C backend

ckdl is a C library that implements reading and writing a the KDL Document Language.

This package lets Python programs read and write KDL (both version 2.0.0 and version 1.0.0) files, using ckdl as a back-end.

Install with

pip install ckdl

Examples

Reading

>>> import ckdl
>>> kdl_txt = """
... best-primes 2 3 5 7
... colours importance=(%)1000 { green; blue shade=синий; blue shade=голубой; violet }
... """
>>> doc = ckdl.parse(kdl_txt)
>>> doc
<Document; 2 nodes>
>>> doc[0]
<Node best-primes; 4 args>
>>> doc[0].args
[2, 3, 5, 7]
>>> doc[1].properties
{'importance': <Value (%)1000>}
>>> doc[1].properties['importance'].value
1000
>>> doc[1].properties['importance'].type_annotation
'%'
>>> doc[1].children
[<Node green>, <Node blue; 1 property>, <Node blue; 1 property>, <Node violet>]
>>> doc[1].children[1].properties['shade']

Writing

>>> mydoc = ckdl.Document(ckdl.Node("best-primes", 7, 11, 13), ckdl.Node("worst-values", ckdl.Value("scary", None)))
>>> print(str(mydoc))
best-primes 7 11 13
worst-values (scary)#null

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc