Items¶
CRUD operations for Homebox items, including attachments, maintenance entries, custom fields, and bulk import/export.
ItemsClient
¶
Sub-client for item CRUD, attachment, and maintenance-log endpoints.
Accessed via HomeboxClient.items.
Source code in homebox/client.py
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 | |
__init__
¶
query_all_items
¶
query_all_items(q: str | None = None, page: int | None = None, pageSize: int | None = None, tags: list[str] | None = None, labels: list[str] | None = None, locations: list[str] | None = None, parentIds: list[str] | None = None) -> PaginationResultRepoItemSummary
Search and paginate all items in the group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
str | None
|
Free-text search string. |
None
|
page
|
int | None
|
Page number (1-based). |
None
|
pageSize
|
int | None
|
Number of items per page. |
None
|
tags
|
list[str] | None
|
Filter to items that carry any of the given tag IDs. |
None
|
labels
|
list[str] | None
|
Backward-compatible alias for |
None
|
locations
|
list[str] | None
|
Filter to items stored at any of the given location IDs. |
None
|
parentIds
|
list[str] | None
|
Filter to items that are children of the given item IDs. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
PaginationResultRepoItemSummary |
PaginationResultRepoItemSummary
|
Paginated list of matching item summaries together with total count and pagination metadata. |
Source code in homebox/client.py
create_item
¶
Create a new item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
ItemCreate
|
Item creation payload. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemSummary |
ItemSummary
|
Summary representation of the newly created item. |
Source code in homebox/client.py
export_items
¶
Export all items as a CSV document.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Raw CSV text that can be written to a file or parsed directly. |
get_all_custom_field_names
¶
Return the distinct custom field names used across all items.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: Sorted list of custom field name strings. |
Source code in homebox/client.py
get_all_custom_field_values
¶
Return the distinct values stored in custom text fields across all items.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: List of unique custom field value strings. |
Source code in homebox/client.py
import_items
¶
Import items from a CSV file.
The CSV format matches the one produced by :meth:export_items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
csv
|
bytes
|
Raw CSV bytes to upload (e.g. the contents of an exported file opened in binary mode). |
required |
Source code in homebox/client.py
get_item
¶
Return the full details of a single item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemOut |
ItemOut
|
Full item representation including attachments, custom fields, maintenance log, and nested location/label information. |
Source code in homebox/client.py
update_item
¶
Replace a item's fields with the provided data (full update).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item to update. |
required |
data
|
ItemUpdate
|
Complete item update payload. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemOut |
ItemOut
|
Updated full item representation. |
Source code in homebox/client.py
delete_item
¶
Permanently delete an item and its attachments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item to delete. |
required |
patch_item
¶
Partially update an item (only the provided fields are changed).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item to patch. |
required |
data
|
ItemPatch
|
Partial update payload (location, labels, or quantity). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemOut |
ItemOut
|
Updated full item representation. |
Source code in homebox/client.py
create_item_attachment
¶
create_item_attachment(id: str, file: bytes, type: str | None = None, primary: bool | None = None, name: str | None = None) -> ItemOut
Upload a file attachment for an item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item to attach the file to. |
required |
file
|
bytes
|
Raw bytes of the file to upload. |
required |
type
|
str | None
|
Attachment type (e.g. |
None
|
primary
|
bool | None
|
When |
None
|
name
|
str | None
|
Display name / title for the attachment. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ItemOut |
ItemOut
|
Updated full item representation including the new attachment. |
Source code in homebox/client.py
get_item_attachment
¶
Retrieve a short-lived download token for an item attachment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
attachment_id
|
str
|
UUID of the attachment. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
Raw bytes of the attachment. |
Source code in homebox/client.py
update_item_attachment
¶
Update metadata for an existing item attachment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
attachment_id
|
str
|
UUID of the attachment to update. |
required |
data
|
ItemAttachmentUpdate
|
Fields to update (title, type, and/or primary flag). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemOut |
ItemOut
|
Updated full item representation. |
Source code in homebox/client.py
delete_item_attachment
¶
Delete an attachment from an item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
attachment_id
|
str
|
UUID of the attachment to delete. |
required |
Source code in homebox/client.py
duplicate_item
¶
Create a duplicate of an existing item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item to duplicate. |
required |
data
|
DuplicateOptions
|
Options controlling which parts to copy (attachments, custom fields, maintenance log) and an optional name prefix. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemOut |
ItemOut
|
Full representation of the newly created duplicate item. |
Source code in homebox/client.py
get_maintenance_log
¶
get_maintenance_log(id: str, status: MaintenanceFilterStatus | None = None) -> list[MaintenanceEntryWithDetails]
Return the maintenance log for a specific item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
status
|
MaintenanceFilterStatus | None
|
Optional filter – |
None
|
Returns:
| Type | Description |
|---|---|
list[MaintenanceEntryWithDetails]
|
list[MaintenanceEntryWithDetails]: Maintenance entries with item context information attached. |
Source code in homebox/client.py
create_maintenance_entry
¶
Add a maintenance log entry to an item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
data
|
MaintenanceEntryCreate
|
Maintenance entry data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MaintenanceEntry |
MaintenanceEntry
|
The newly created maintenance entry. |
Source code in homebox/client.py
get_item_path
¶
Return the ancestry path of an item (from root to the item itself).
Useful for building breadcrumb navigation in applications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
UUID of the item. |
required |
Returns:
| Type | Description |
|---|---|
list[ItemPath]
|
list[ItemPath]: Ordered list of path nodes. Each node carries an
|