@@ -405,8 +405,10 @@ def accessor_entry_point_loader() -> None:
405
405
Load and register pandas accessors declared via entry points.
406
406
407
407
This function scans the 'pandas.<pd_obj>.accessor' entry point group for
408
- accessors registered by third-party packages. Each entry point is expected
409
- to follow the format:
408
+ accessors registered by third-party packages. These accessors extend
409
+ core pandas objects (`DataFrame`, `Series`, `Index`).
410
+
411
+ Each entry point is expected to follow the format:
410
412
411
413
# setup.py
412
414
entry_points={
@@ -415,7 +417,7 @@ def accessor_entry_point_loader() -> None:
415
417
'pandas.Index.accessor': [ <name> = <module>:<AccessorClass>, ... ],
416
418
}
417
419
418
- OR for pyproject.toml file:
420
+ OR using pyproject.toml file:
419
421
420
422
# pyproject.toml
421
423
[project.entry-points."pandas.DataFrame.accessor"]
@@ -427,9 +429,6 @@ def accessor_entry_point_loader() -> None:
427
429
[project.entry-points."pandas.Index.accessor"]
428
430
<name> = "<module>:<AccessorClass>"
429
431
430
- For more information about entrypoints:
431
- https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#plugin-entry-points
432
-
433
432
434
433
For each valid entry point:
435
434
- The accessor class is dynamically imported and registered using
@@ -441,7 +440,16 @@ def accessor_entry_point_loader() -> None:
441
440
Notes
442
441
-----
443
442
- This function is only intended to be called at pandas startup.
444
- - For more information about accessors read their documentation.
443
+ - For more information about accessors, refer to:
444
+ - Pandas documentation on extending accessors:
445
+ https://pandas.pydata.org/docs/development/extending.html#registering-custom-accessors
446
+ - Series accessor API reference:
447
+ https://pandas.pydata.org/docs/reference/series.html#accessors
448
+ - Note: DataFrame and Index accessors (e.g., `.sparse`, `.str`) use the same
449
+ mechanism but are not listed in separate reference pages as of now.
450
+
451
+ - For background on Python plugin entry points:
452
+ https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#plugin-entry-points
445
453
446
454
Raises
447
455
------
0 commit comments