A lightweight library for working with Akoma Ntoso Act documents
Project description
Cobalt is a lightweight Python library for working with Akoma Ntoso Act documents. It makes it easy to work with Akoma Ntoso metadata, FRBR URIs and generate Tables of Contents for a document.
It is lightweight because most operations are done on the XML document directly without intermediate objects. You still need to understand how Akoma Ntoso works.
Read the full documentation at cobalt.readthedocs.org.
Quickstart
Install using:
$ pip install cobalt
Use it like this:
>>> from cobalt import Act >>> act = Act() >>> act.title = "Act 10 of 1980" >>> act.frbr_uri = "/za/act/1980/10" >>> act.year '1980' >>> act.number '10' >>> print act.to_xml() [ lots of xml ]
Contributing
Clone the repo
Install development dependencies:
pip install -e .[dev]
Make your changes
Run tests:
nosetests && flake8 cobalt
Send a pull request
Releasing a New Version
Run the tests!
Update VERSION appropriately
Update the Change Log section in README.rst
Commit and push to github
Release to PyPI:
python setup.py sdist bdist_wheel upload
Change Log
0.1.7
TOCElement items now include a best-effort title
0.1.6
Use HTML5 semantic elements section and article when generating HTML for acts
0.1.5
FIX use schedule FRBRalias as heading
0.1.4
Transforming XML to HTML now includes all attributes as data- attributes
0.1.3
Refactor TOC helpers into own file
Fix .format in FrbrUri
0.1.1
first release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cobalt-0.1.7.tar.gz
.
File metadata
- Download URL: cobalt-0.1.7.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2895002ee5b6a691ce6501063ee1906109b7e7299e02b5611a8375795529c2 |
|
MD5 | d7fd44058f5e2156d3c09725a923e493 |
|
BLAKE2b-256 | 90f738996f445c19cc736d3b126d799f41bd7b4beb114469d7a4a8b19e966a96 |
File details
Details for the file cobalt-0.1.7-py2-none-any.whl
.
File metadata
- Download URL: cobalt-0.1.7-py2-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 071e7e48d386a92e9c0837646d4651045f380e474e05f210a91568770afdd601 |
|
MD5 | e077e8ba7c8b0781c0ac5ba080fc65cf |
|
BLAKE2b-256 | ee76c8495e64cd1f85de99d7476eb86058ab438622a24912ff029e751ed0f77c |