Add comprehensive docstrings to core modules#740
Merged
Conversation
Improve documentation coverage across the library: - session.py: Add docstrings for get_connection_info, rebuild_auth, s3_is_overloaded, get_tasks_api_rate_limit - item.py: Add docstrings for BaseItem class, load, refresh, get_files, review methods (get_review, index_review, noindex_review, delete_review, review), and flag methods (get_flags, add_flag, delete_flag) - config.py: Add docstrings for get_auth_config, write_config_file, parse_config_file, get_config; fix mypy type error - files.py: Add class docstring for BaseFile with attribute documentation - search.py: Add docstrings for Search.__init__, iter_as_results, iter_as_items - iarequest.py: Add class docstrings for S3Request and MetadataRequest - catalog.py: Add docstring for get_rate_limit - auth.py: Improve class docstrings for S3Auth and S3PostAuth Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove legacy :type: and :rtype: lines, consolidating type information into the :param: and :returns: lines for a more concise format. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- utils.py: Add docstrings to deep_update, validate_s3_identifier, needs_quote, norm_filepath, get_md5, chunk_generator, IterableToFileAdapter, IdentifierListAsItems, get_s3_xml_text, get_file_size, recursive_file_count_and_size, remove_none, is_valid_metadata_key, parse_dict_cookies, is_valid_email, is_windows. Convert sanitize_* functions from Args/Returns to :param:/:returns: - account.py: Convert all methods from Google-style (Args/Returns) to Sphinx-style (:param:/:returns:) for consistency - iarequest.py: Add docstrings to prepare_patch, prepare_target_patch, prepare_files_patch. Convert prepare_metadata and _process_indexed_keys from Args/Returns to :param:/:returns: - api.py: Add missing param docs to get_tasks, fix secure->config reference in search_items, add host param to configure - session.py: Add docstring to send() method Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix broken Installation link (use :ref:`installation` not :ref:`install`) - Fix heading hierarchy (Setup & Configuration same level as siblings) - Move Authors to top-level section - Add Module Index to Indices and tables - Update copyright to 2015-2026 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All source files now have consistent copyright: 2012-2026 Internet Archive Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
These directories are for local development: - plans/: Local design and planning documents - .worktrees/: Git worktrees for isolated feature development Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:param:,:returns:,:raises:)config.pyChanges
utils.py
deep_update()- Document recursive dict mergingvalidate_s3_identifier()- Document identifier validation rulesneeds_quote()- Document URI quoting checknorm_filepath()- Document path normalizationget_md5()- Document MD5 hash calculationchunk_generator()- Document file chunk generationIterableToFileAdapterclass - Document file-like wrapper for iterablesIdentifierListAsItemsclass - Add param documentationget_s3_xml_text()- Document S3 XML error parsingget_file_size()- Document file size determinationrecursive_file_count_and_size()- Complete param documentationremove_none()- Document None value removalis_valid_metadata_key()- Document metadata key validationparse_dict_cookies()- Document cookie string parsingis_valid_email()- Document email validationis_windows()- Document platform detectionsanitize_*functions from Args/Returns to:param:/:returns:account.py
_post_api_request(),from_account_lookup(),_fetch_account_data_from_api()from_json(),lock(),unlock(),to_dict()api.py
get_tasks()- Add missing param docs (config, config_file, archive_session, etc.)search_items()- Fix incorrectsecurereference, addarchive_sessionandconfigparamsconfigure()- Add missingconfig_fileandhostparam docssession.py
get_connection_info()- Document return dict structurerebuild_auth()- Explain redirect authentication handlings3_is_overloaded()- Document S3 rate limit checkingget_tasks_api_rate_limit()- Document Tasks API rate limitssend()- Add docstring for HTTPS security handlingitem.py
BaseItemclass - Add class-level docstringload(),refresh()- Document metadata loadingget_files()- Document file filtering optionsget_review,index_review,noindex_review,delete_review,review)get_flags,add_flag,delete_flag)config.py
get_auth_config()- Document authentication flowwrite_config_file()- Document config file writingparse_config_file()- Document config file search orderget_config()- Document config merging precedenceconfig.set()callfiles.py
BaseFileclass - Add class docstring with attribute documentationsearch.py
Search.__init__()- Document all parametersiter_as_results(),iter_as_items()- Document iteration methodsiarequest.py
S3Requestclass - Document IA-S3 upload request handlingMetadataRequestclass - Document metadata modification requestsprepare_patch()- Add docstring for JSON Patch creationprepare_target_patch()- Add docstring for target path patchingprepare_files_patch()- Add docstring for file-level metadata patchingprepare_metadata()- Convert to Sphinx-style_process_indexed_keys()- Convert to Sphinx-stylecatalog.py
get_rate_limit()- Document rate limit checkingauth.py
S3Auth- Improve docstring with usage exampleS3PostAuth- Document POST authentication schemedocs/source/index.rst
:ref:install→ `:ref:`installation)docs/source/conf.py
Test plan
cd docs && make html🤖 Generated with Claude Code