semvec/pypi-packages huggingface dataset:
ba 0.0.6
Making diagrams easily.
License: apache-2.0

# ba: Making Diagrams Easily

`ba` is a simple yet powerful library for creating and visualizing directed graphs. It provides a flexible mini-language for defining nodes, edges, and their attributes, making it easy to create complex diagrams with minimal code.

## Installation

```bash
pip install ba
```

Additionally, you'll need the GraphViz backend:

- **Mac**: `brew install graphviz`
- **Linux**: `sudo apt-get install graphviz`
- **Windows**: Download from the [GraphViz website](https://graphviz.org/download/)

## Quick Start

```python
from ba import dgdisp

# Create a simple workflow diagram
diagram = dgdisp("""
    input -> [process] -> (output)
    [process] -> /log/
""")

# Display the diagram
diagram
```

## Features

- **Simple syntax** for defining multiple edges at once
- **Inline node formatting** with shape mini-language
- **Bulk specification** of node properties
- **Support for different graphviz engines**

## Mini-language Syntax

### Edge Paths
```
node1 -> node2 -> node3
```

### Many-to-many Connections
```
node1, node2 -> node3, node4, node5
```

### Inline Node Formatting
```
[square_node] -> (circular_node) -> /parallelogram/
```

Common shape markers:
- `[name]` - box
- `(name)` - circle
- `/name/` - parallelogram
- `<name>` - diamond
- `[[name]]` - 3D box
- `((name))` - double circle

### Node Attributes
```
node1, node2: circle
special_node: {"shape": "box", "color": "red", "style": "filled"}
```

### Raw GraphViz Statements
```
node1 [shape=box style=filled fillcolor=lightblue]
```

### Default Settings
```
--dflt_node_attr: shape
--fillcolor: lightgrey
```

## Examples

### Basic Workflow

```python
dgdisp("""
    key, wf: circle
    chk: doublecircle
    fv: {"shape": "plaintext", "fontcolor": "blue"}
    key -> wf -> [chunker] -> chk -> /featurizer/ -> fv
    fv -> ([model])
""")
```

### Horizontal Layout

```python
from ba import dgdisp

# Use the horizontal layout helper
dgdisp.h("""
    A -> B -> C
    B -> D -> E
""")
```

### Choosing Different Engines

```python
dgdisp("""
    A -> B -> C -> A
    B -> D -> E -> B
""", engine=dgdisp.engines.circo)
```

## API Reference

### Main Functions

- **`dgdisp(commands, node_shapes=None, attrs_for_node=None, minilang=ModifiedDot, engine=None, **kwargs)`**  
  Create a directed graph visualization using the mini-language.

- **`horizontal_dgdisp(*args, **kwargs)`** or **`dgdisp.h(*args, **kwargs)`**  
  Create a horizontally oriented directed graph.

## Available Engines

- `dot` - Hierarchical layout (default)
- `neato` - Spring model layout
- `fdp` - Force-directed placement
- `sfdp` - Scalable force-directed placement
- `twopi` - Radial layout
- `circo` - Circular layout

Access via `dgdisp.engines.dot`, `dgdisp.engines.neato`, etc.

## License

MIT
jo 0.0.7
Automatically making flask webservices from python objects
License: apache-2.0

# jo

Automatically making flask webservices from python objects

To install:	```pip install jo```

Note: You can find more modern and flexible version of `jo` in these packages: `py2http` and `qh`.


# Examples

## ObjWrapper

A class to wrap a "controller" class for a web service API.
It takes care of LRU caching objects constructed before (so they don't need to be re-constructed for every
API call), and converting request.json and request.args arguments to the types that will be recognized by
the method calls.

```
:param obj_constructor: a function that, given some arguments, constructs an object. It is this object
    that will be wrapped for the webservice
:param obj_constructor_arg_names:
:param convert_arg: (processing) a dict keyed by variable names (str) and valued by a dict containing a
    'type': a function (typically int, float, bool, and list) that will convert the value of the variable
        to make it web service compliant
    'default': A value to assign to the variable if it's missing.
:param The pattern that determines what attributes are allowed to be accessed. Note that patterns must be
    complete patterns (i.e. describing the whole attribute path, not just a subset. For example, if you want
    to have access to this.given.thing you, specifying r"this\.given" won't be enough. You need to specify
    "this\.given.thing" or "this\.given\..*" (the latter giving access to all children of this.given.).
    Allowed formats:
        a re.compiled pattern
        a string (that will be passed on to re.compile()
        a dict with either
            an "exclude", pointing to a list of patterns to exclude
            an "include", pointing to a list of patterns to include
:param to_jdict: (input processing) Function to convert an output to a jsonizable dict
```