> built 2026-10-03 14:24 UTC from 72cac75 (master) · doodad 0.1.7. Details: build_info.json

# index.html.md

<!-- generated by epythet -->

# doodad

Making access to names easier.

doodad: A gadget or other object whose name the speaker does not know or cannot recall.

Often, when writing code, you need to specify field names, for example, when writing code that
communicates with a database. It’s so easy to make a typo in the field name, and you might only know
this once you run the code, which may be a lot later…

What `doodad` wants to do when it grows up, is make it easier to find names, and use the names
you meant to use, with tab completion etc.

To install:	`pip install doodad`

[Documentation](https://i2mint.github.io/doodad/)

# Examples

Find all the names (variables, functions, etc.) in a piece of code or data.

```none
>>> from doodad import find_names
>>> mapping = {'c': 1, 'b': {'a': 2, 'd': 3}}
>>> list(find_names(mapping))
['c', 'b', 'a', 'd']
>>> import os
>>> names = list(find_names(os.path.join))
>>> names
['join', 'a', 'a', 'sep', 'path', 'path']
```

Make an instance whose sole purpose is to contain those names.
This allows you to have a ready-to-use collection of names that you can tab complete
and catch spelling mistakes early (before, say, you ask for a field name that doesn’t exist…)

```none
>>> from doodad import mk_str_attr_obj
>>>
>>> f = mk_str_attr_obj(names)
>>> f.join
'join'
>>> f.path
'path'
>>> f = mk_str_attr_obj('date worker offre success')
>>> f.date
'date'
>>> f.worker
'worker'
>>> f.does_not_exist
Traceback (most recent call last):
...
AttributeError: 'AttrObj' object has no attribute 'does_not_exist'
```

`f` is a `namedtuple` so you can do things like:

```none
>>> list(f)
['date', 'worker', 'offre', 'success']
>>> date, worker, offer, success = f
>>> offer
'offre'
```

<p class="epythet-aggregates">This documentation as a single file: <a href="doodad.md">doodad.md</a> (Markdown, for agents).</p>


# _autosummary/doodad.find_names.html.md

# doodad.find_names

### doodad.find_names(src, \*, value_normalizer=<function dflt_value_normalizer>)

Finds all the names (variables, functions, etc.) in a piece of code or data.

```pycon
>>> mapping = {'c': 1, 'b': {'a': 2, 'd': 3}}
>>> list(find_names(mapping))
['c', 'b', 'a', 'd']
```

It also works on a python object whose source code `inspect.getsource` can
retrieve – a function defined in an importable module, for instance:

```pycon
>>> from doodad.find_names import yield_names_from_mapping
>>> names = list(find_names(yield_names_from_mapping))
>>> 'yield_names_from_mapping' in names and 'mapping' in names
True
```


# _autosummary/doodad.html.md

# doodad

Making access to names easier.

### Modules

| [`find_names`](_autosummary/doodad.find_names.html.md#doodad.find_names)(src, \*[, value_normalizer])   | Finds all the names (variables, functions, etc.) in a piece of code or data.   |
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| [`util`](_autosummary/doodad.util.html.md#module-doodad.util)                                     | Utils for doodad.                                                              |


# _autosummary/doodad.util.html.md

# doodad.util

Utils for doodad.

### Functions

| [`mk_str_attr_obj`](_autosummary/doodad.util.html.md#doodad.util.mk_str_attr_obj)(iterable[, name, trans])   | Make an object with given string attributes.                                          |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [`target_instance_checker`](_autosummary/doodad.util.html.md#doodad.util.target_instance_checker)(\*target_types)    | Returns a function that checks if an object is an instance of any of the target_types |

### doodad.util.mk_str_attr_obj(iterable, name=None, trans=None)

Make an object with given string attributes.

The purpose of this function is to offer a different option to having to write
strings in code when specifying a string value when this value should only be
taken from a fixed set of values, and use tab completion to see the available
values.

* **Parameters:**
  * **iterable** ([`Iterable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)) – an iterable of strings (or a space separate string)
  * **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – the name of the namedtuple

```pycon
>>> f = mk_str_attr_obj('date worker offre success')
>>> f.date
'date'
>>> f.worker
'worker'
>>> f.does_not_exist
Traceback (most recent call last):
...
AttributeError: 'AttrObj' object has no attribute 'does_not_exist'
```

`f` is a `namedtuple` so you can do things like:

```pycon
>>> list(f)
['date', 'worker', 'offre', 'success']
>>> date, worker, offer, success = f
>>> offer
'offre'
```

### doodad.util.target_instance_checker(\*target_types)

Returns a function that checks if an object is an instance of any of the target_types


# about-this-build.html.md

<!-- generated by epythet -->

# About this build

This documentation was built on **2026-10-03 14:24 UTC** from commit <a href="https://github.com/i2mint/doodad/commit/72cac7524ce7b80e09c8b980f2f23a1e1e1570ce"><code>72cac75</code></a> on branch <code>master</code>, for **doodad 0.1.7** (from <code>pyproject.toml</code>).

#### NOTE
Nothing suggests a mismatch: the tree was clean at the commit above, and the documented version is the one on PyPI.

## Source

|                     |                                                                                                                                                      |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| Commit              | <a href="https://github.com/i2mint/doodad/commit/72cac7524ce7b80e09c8b980f2f23a1e1e1570ce"><code>72cac7524ce7b80e09c8b980f2f23a1e1e1570ce</code></a> |
| Branch              | <code>master</code>                                                                                                                                  |
| Tags at this commit | none                                                                                                                                                 |
| Working tree        | clean                                                                                                                                                |
| Remote              | <code>https://github.com/i2mint/doodad</code>                                                                                                        |

## Continuous integration

|              |                                                                                            |
|--------------|--------------------------------------------------------------------------------------------|
| Repository   | <code>i2mint/doodad</code>                                                                 |
| Run          | <a href="https://github.com/i2mint/doodad/actions/runs/37129407661">37129407661</a>        |
| Ref          | <code>refs/heads/master</code>                                                             |
| Event commit | <code>72cac7524ce7b80e09c8b980f2f23a1e1e1570ce</code> (in the history of the built commit) |

## Tools

|          |         |
|----------|---------|
| epythet  | 0.2.12  |
| Sphinx   | 9.1.0   |
| docutils | 0.22.4  |
| Python   | 3.12.14 |

## Configuration as resolved

|               |                                                                  |
|---------------|------------------------------------------------------------------|
| theme         | <code>auto</code> (Sphinx theme <code>shibuya</code>)            |
| accent        | <code>#913146</code>                                             |
| api_generator | <code>autosummary</code>                                         |
| ignore        | <code>tests/</code>, <code>scrap/</code>, <code>examples/</code> |
| agent_outputs | <code>true</code>                                                |
| aggregates    | <code>md</code>                                                  |
| ai_artifacts  | <code>true</code>                                                |

## Package on PyPI

Latest release: <a href="https://pypi.org/project/doodad/0.1.7/">0.1.7</a>, the same as the documented version.

## Reproduce

```bash
git clone https://github.com/i2mint/doodad && cd doodad
git checkout 72cac7524ce7b80e09c8b980f2f23a1e1e1570ce
pip install "epythet==0.2.12"
epythet quickstart . --ignore tests/ scrap/ examples/
```

The same data, for machines: <a href="build_info.json"><code>build_info.json</code></a> (schema version 1).


# api.html.md

# API reference

| [`doodad`](_autosummary/doodad.html.md#module-doodad)   | Making access to names easier.   |
|-------------------------------------------------------------------------|----------------------------------|


