Skip to main content

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

Examples

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

>>> 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...)

>>> 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:

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

Metadata

Release files for doodad 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doodad 0.1.7
File Size Uploaded
doodad-0.1.7.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for doodad 0.1.7
File Interpreter ABI Platform
doodad-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / doodad-0.1.7.tar.gz

Download URL doodad-0.1.7.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0245c8c07de575e7d2c1b6e3c55dd41394264ded9db7596ca6f7c04e936dde15
BLAKE2b-256 checksum
How to use checksums
e70937563c7387e6674f76befafdc4a948f23a5fddabb490b4644cecc488738a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / doodad-0.1.7-py3-none-any.whl

Download URL doodad-0.1.7-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
418ac9b7275c83f9bba694ff54408d61c40d9beb2ab9e7fa26e7c803f856ca08
BLAKE2b-256 checksum
How to use checksums
6d34d8672eacce02933d78948d5b0522104bd736714a0dcd0e3ae1578caca428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.8

2 release files

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page