Argumentari: Generalised API for JSON Structured Argument Data
Project description
Argumentari 🗣️
Argumentari is a lightweight, cross-platform Python package for constructing, serializing, manipulating, and visualizing structured argument data.
Build argument trees, apply formal reasoning schemes, and interactively analyze debate structures.
Features
- Define argument nodes (
premise,conclusion) and build trees - Manipulate arguments: add, move, clone, edit, prune and collapse nodes
- Visualize argument graphs interactively
- Register and use formal argumentation schemes (e.g., Authority, Causal)
- Find and replace nodes by text or scheme
- Serialize and deserialize argument trees
- Cross-platform: Linux, macOS, Windows
- Simple API for integration into your projects
Usage
Create and manipulate an argument tree
from argumentari.nodes import premise, conclusion
from argumentari.tree import argumentTree
from argumentari.manipulation import (
addNode, removeNode, replaceNode, moveSubtree,
editNode, cloneSubtree, findNodes, pruneNode, collapseSubtree
)
root = premise("Electric cars reduce emissions.")
child1 = premise("EVs produce no exhaust.")
child2 = premise("Fossil fuels are the main source of carbon emissions.")
concl = conclusion("Adopting EVs will decrease fossil fuel use.")
addNode(root, child1)
addNode(child1, child2)
addNode(child2, concl)
tree = argumentTree(root)
Manipulate argument nodes
# Add a premise
addNode(root, premise("Countries with high EV adoption show lower emissions growth."))
# Move a subtree
moveSubtree(tree, child1, concl)
# Edit a node's text
editNode(concl, new_text="Governments should invest in EVs.")
# Clone a subtree
clone = cloneSubtree(child1)
addNode(root, clone)
# Prune a node
pruneNode(child1)
# Collapse a subtree
collapseSubtree(child2)
Visualize your argument
from argumentari.visualize import treeToGraph, visualize
graph = treeToGraph(tree.root)
visualize(graph)
Apply argument schemes
from argumentari.schemes import getScheme, argumentScheme
root.setScheme("Argument from Authority", {"Authority": "Dr. Smith", "Statement": "EVs help climate"})
Serialize and deserialize argument trees
from argumentari.io import argumentSerializer
# Serialize to JSON
json_str = argumentSerializer.toJson(tree.root)
# Deserialize from JSON
new_root = argumentSerializer.fromJson(json_str)
Find nodes
matches = findNodes(tree, pattern="EVs")
for node in matches:
print(node.text)
Contact
- GitHub Issues: Argumentari Issues
- Author: literal-gargoyle
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file argumentari-0.1.1.tar.gz.
File metadata
- Download URL: argumentari-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
458e709ca38ce675044afe6c2419a8e37a6e0280eed8e0055a15693e5b15e3c2
|
|
| MD5 |
d1dd8dd7e0daa9413a9e2a51e096cd58
|
|
| BLAKE2b-256 |
1544957e0c317517555419155d2db4694a9e4a2d16e6ec5ecff0b1de33edc339
|
Provenance
The following attestation bundles were made for argumentari-0.1.1.tar.gz:
Publisher:
python-publish.yml on literal-gargoyle/argumentari
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
argumentari-0.1.1.tar.gz -
Subject digest:
458e709ca38ce675044afe6c2419a8e37a6e0280eed8e0055a15693e5b15e3c2 - Sigstore transparency entry: 605626058
- Sigstore integration time:
-
Permalink:
literal-gargoyle/argumentari@fa9a97401f5ecca3f5868c194f5d456ca40e9890 -
Branch / Tag:
refs/tags/V0.1.3 - Owner: https://github.com/literal-gargoyle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fa9a97401f5ecca3f5868c194f5d456ca40e9890 -
Trigger Event:
release
-
Statement type:
File details
Details for the file argumentari-0.1.1-py3-none-any.whl.
File metadata
- Download URL: argumentari-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31cffd79c90e74f2954482730725f54af46a1dcf6ac1033e5abd3b201e523b00
|
|
| MD5 |
40dcc79e8aeb6f1210e8cb3befea4de0
|
|
| BLAKE2b-256 |
290d14b1d49bd58e2c46999cf2fb8b0527c10ebad7d0b7befc413cdf1a1c1bde
|
Provenance
The following attestation bundles were made for argumentari-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on literal-gargoyle/argumentari
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
argumentari-0.1.1-py3-none-any.whl -
Subject digest:
31cffd79c90e74f2954482730725f54af46a1dcf6ac1033e5abd3b201e523b00 - Sigstore transparency entry: 605626061
- Sigstore integration time:
-
Permalink:
literal-gargoyle/argumentari@fa9a97401f5ecca3f5868c194f5d456ca40e9890 -
Branch / Tag:
refs/tags/V0.1.3 - Owner: https://github.com/literal-gargoyle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fa9a97401f5ecca3f5868c194f5d456ca40e9890 -
Trigger Event:
release
-
Statement type: