Skip to main content

Argumentari: Generalised API for JSON Structured Argument Data

Project description

Argumentari 🗣️

Python Linux macOS Windows


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


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

argumentari-0.1.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

argumentari-0.1.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

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

Hashes for argumentari-0.1.1.tar.gz
Algorithm Hash digest
SHA256 458e709ca38ce675044afe6c2419a8e37a6e0280eed8e0055a15693e5b15e3c2
MD5 d1dd8dd7e0daa9413a9e2a51e096cd58
BLAKE2b-256 1544957e0c317517555419155d2db4694a9e4a2d16e6ec5ecff0b1de33edc339

See more details on using hashes here.

Provenance

The following attestation bundles were made for argumentari-0.1.1.tar.gz:

Publisher: python-publish.yml on literal-gargoyle/argumentari

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for argumentari-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31cffd79c90e74f2954482730725f54af46a1dcf6ac1033e5abd3b201e523b00
MD5 40dcc79e8aeb6f1210e8cb3befea4de0
BLAKE2b-256 290d14b1d49bd58e2c46999cf2fb8b0527c10ebad7d0b7befc413cdf1a1c1bde

See more details on using hashes here.

Provenance

The following attestation bundles were made for argumentari-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on literal-gargoyle/argumentari

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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