Improve UX/documentation for new Python API
- Dominant language
- Python
- Stars
- 28
- Forks
- 37
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 9
Description
inspired by https://github.com/dandi/dandi-cli/pull/676/files#r673408547 and the fact that majority of seemingly public classes aren't intended to be used by public directly etc. ATM of that PR import of `dandi.dandiapi` provides over 40 names, and it is hard-to-impossible to figure out what to use without RTFM (which is yet to be composed anyways).
I think we should
- [ ] provide main modules docstring describing their purpose and what functionality is there to be actually used by users
- [ ] may be define `__all__` with those which should be imported if users do `import *`
- [x] classes such as RemoteDandiset etc should get sensible `__repr__` so they convey what the are instead of default Python's class + IDs for those objects. Do not need to be a real `repr` and thus could even be within `<>` or some other decoration? done for `__str__` in #753
even such a simple one is already handy
```shell
+ def __repr__(self):
+ return f"<{self.__class__.__name__} {self.identifier}>" # + all non-None..
```
```shell
$> python -c 'from dandi.dandiapi import *; cl = DandiAPIClient(); print(list(cl.get_dandisets()))'
[, , ,...
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.