Schema
Source code in scrape_schema/base.py
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 | |
__raw__
property
Get raw string markdown value
Returns:
| Type | Description |
|---|---|
str
|
markup string object |
__sc_params__
property
__schema_aliases__
instance-attribute
Main schema class
Attributes:
| Name | Type | Description |
|---|---|---|
__schema_fields__ |
Dict[str, BaseField] access to fields object by key in current schema |
|
__schema_annotations__ |
Dict[str, Type] access to fields annotations in current schema |
|
__schema_aliases__ |
Dict[str, str] access to fields aliases in current schema |
__schema_name__
property
Returns:
| Type | Description |
|---|---|
str
|
class name |
__selector__
property
Get available cached Parsel.Selector or SelectorList object
Returns:
| Type | Description |
|---|---|
Union[Selector, SelectorList]
|
Parsel SelectorType object |
__init__(markup)
Create a new object by parsing fields from markup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
markup
|
Union[str, bytes, Selector, SelectorList]
|
string, bytes or parsel.Selector object |
required |
Raises: TypeError: if markup is not string, bytes or Selector objects
Source code in scrape_schema/base.py
__init_fields()
Parse fields entrypoint.
Automatically called in the __init__ constructor
Source code in scrape_schema/base.py
dict(*, by_alias=True)
Convert schema object to python dict. if field have alias key - set alias key Args: by_alias: bool set key by field alias. Default True Returns: dictionary with all public fields and sc_param properties