pointblank 0.15.0__py3-none-any.whl → 0.17.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pointblank/__init__.py +2 -0
- pointblank/_constants.py +25 -1
- pointblank/_constants_translations.py +2361 -2
- pointblank/_interrogation.py +24 -0
- pointblank/_typing.py +37 -9
- pointblank/_utils.py +0 -355
- pointblank/_utils_llms_txt.py +661 -0
- pointblank/column.py +24 -0
- pointblank/data/api-docs.txt +336 -3
- pointblank/validate.py +2551 -926
- pointblank/yaml.py +10 -2
- {pointblank-0.15.0.dist-info → pointblank-0.17.0.dist-info}/METADATA +9 -4
- {pointblank-0.15.0.dist-info → pointblank-0.17.0.dist-info}/RECORD +17 -16
- {pointblank-0.15.0.dist-info → pointblank-0.17.0.dist-info}/WHEEL +0 -0
- {pointblank-0.15.0.dist-info → pointblank-0.17.0.dist-info}/entry_points.txt +0 -0
- {pointblank-0.15.0.dist-info → pointblank-0.17.0.dist-info}/licenses/LICENSE +0 -0
- {pointblank-0.15.0.dist-info → pointblank-0.17.0.dist-info}/top_level.txt +0 -0
pointblank/_interrogation.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import functools
|
|
4
|
+
from collections.abc import Callable
|
|
4
5
|
from dataclasses import dataclass
|
|
5
6
|
from typing import Any
|
|
6
7
|
|
|
@@ -16,6 +17,7 @@ from pointblank._spec_utils import (
|
|
|
16
17
|
check_postal_code,
|
|
17
18
|
check_vin,
|
|
18
19
|
)
|
|
20
|
+
from pointblank._typing import AbsoluteBounds
|
|
19
21
|
from pointblank._utils import (
|
|
20
22
|
_column_test_prep,
|
|
21
23
|
_convert_to_narwhals,
|
|
@@ -745,6 +747,28 @@ def row_count_match(data_tbl: FrameT, count, inverse: bool, abs_tol_bounds) -> b
|
|
|
745
747
|
return row_count >= min_val and row_count <= max_val
|
|
746
748
|
|
|
747
749
|
|
|
750
|
+
def col_pct_null(
|
|
751
|
+
data_tbl: FrameT, column: str, p: float, bound_finder: Callable[[int], AbsoluteBounds]
|
|
752
|
+
) -> bool:
|
|
753
|
+
"""Check if the percentage of null vales are within p given the absolute bounds."""
|
|
754
|
+
# Convert to narwhals for consistent API across backends
|
|
755
|
+
nw_tbl = nw.from_native(data_tbl)
|
|
756
|
+
|
|
757
|
+
# Handle LazyFrames by collecting them first
|
|
758
|
+
if hasattr(nw_tbl, "collect"):
|
|
759
|
+
nw_tbl = nw_tbl.collect()
|
|
760
|
+
|
|
761
|
+
# Get total rows using narwhals
|
|
762
|
+
total_rows: int = nw_tbl.select(nw.len()).item()
|
|
763
|
+
abs_target: float = round(total_rows * p)
|
|
764
|
+
lower_bound, upper_bound = bound_finder(abs_target)
|
|
765
|
+
|
|
766
|
+
# Count null values
|
|
767
|
+
n_null: int = nw_tbl.select(nw.col(column).is_null().sum()).item()
|
|
768
|
+
|
|
769
|
+
return n_null >= (abs_target - lower_bound) and n_null <= (abs_target + upper_bound)
|
|
770
|
+
|
|
771
|
+
|
|
748
772
|
def col_count_match(data_tbl: FrameT, count, inverse: bool) -> bool:
|
|
749
773
|
"""
|
|
750
774
|
Check if DataFrame column count matches expected count.
|
pointblank/_typing.py
CHANGED
|
@@ -26,12 +26,40 @@ else:
|
|
|
26
26
|
SegmentSpec = Union[str, SegmentTuple, List[SegmentItem]]
|
|
27
27
|
|
|
28
28
|
# Add docstrings for better IDE support
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
# In Python 3.14+, __doc__ attribute on typing.Union objects became read-only
|
|
30
|
+
try:
|
|
31
|
+
AbsoluteBounds.__doc__ = "Absolute bounds (i.e., plus or minus)"
|
|
32
|
+
except AttributeError:
|
|
33
|
+
pass
|
|
34
|
+
|
|
35
|
+
try:
|
|
36
|
+
RelativeBounds.__doc__ = "Relative bounds (i.e., plus or minus some percent)"
|
|
37
|
+
except AttributeError:
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
Tolerance.__doc__ = "Tolerance (i.e., the allowed deviation)"
|
|
42
|
+
except AttributeError:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
try:
|
|
46
|
+
SegmentValue.__doc__ = "Value(s) that can be used in a segment tuple"
|
|
47
|
+
except AttributeError:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
SegmentTuple.__doc__ = "(column, value(s)) format for segments"
|
|
52
|
+
except AttributeError:
|
|
53
|
+
pass
|
|
54
|
+
|
|
55
|
+
try:
|
|
56
|
+
SegmentItem.__doc__ = "Individual segment item (string or tuple)"
|
|
57
|
+
except AttributeError:
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
try:
|
|
61
|
+
SegmentSpec.__doc__ = (
|
|
62
|
+
"Full segment specification options (i.e., all options for segment specification)"
|
|
63
|
+
)
|
|
64
|
+
except AttributeError:
|
|
65
|
+
pass
|
pointblank/_utils.py
CHANGED
|
@@ -588,361 +588,6 @@ def _check_invalid_fields(fields: list[str], valid_fields: list[str]):
|
|
|
588
588
|
raise ValueError(f"Invalid field: {field}")
|
|
589
589
|
|
|
590
590
|
|
|
591
|
-
def get_api_details(module, exported_list):
|
|
592
|
-
"""
|
|
593
|
-
Retrieve the signatures and docstrings of the functions/classes in the exported list.
|
|
594
|
-
|
|
595
|
-
Parameters
|
|
596
|
-
----------
|
|
597
|
-
module : module
|
|
598
|
-
The module from which to retrieve the functions/classes.
|
|
599
|
-
exported_list : list
|
|
600
|
-
A list of function/class names as strings.
|
|
601
|
-
|
|
602
|
-
Returns
|
|
603
|
-
-------
|
|
604
|
-
str
|
|
605
|
-
A string containing the combined class name, signature, and docstring.
|
|
606
|
-
"""
|
|
607
|
-
api_text = ""
|
|
608
|
-
|
|
609
|
-
for fn in exported_list:
|
|
610
|
-
# Split the attribute path to handle nested attributes
|
|
611
|
-
parts = fn.split(".")
|
|
612
|
-
obj = module
|
|
613
|
-
for part in parts:
|
|
614
|
-
obj = getattr(obj, part)
|
|
615
|
-
|
|
616
|
-
# Get the name of the object
|
|
617
|
-
obj_name = obj.__name__
|
|
618
|
-
|
|
619
|
-
# Get the function signature
|
|
620
|
-
sig = inspect.signature(obj)
|
|
621
|
-
|
|
622
|
-
# Get the docstring
|
|
623
|
-
doc = obj.__doc__
|
|
624
|
-
|
|
625
|
-
# Combine the class name, signature, and docstring
|
|
626
|
-
api_text += f"{obj_name}{sig}\n{doc}\n\n"
|
|
627
|
-
|
|
628
|
-
return api_text
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
def _get_api_text() -> str:
|
|
632
|
-
"""
|
|
633
|
-
Get the API documentation for the Pointblank library.
|
|
634
|
-
|
|
635
|
-
Returns
|
|
636
|
-
-------
|
|
637
|
-
str
|
|
638
|
-
The API documentation for the Pointblank library.
|
|
639
|
-
"""
|
|
640
|
-
|
|
641
|
-
import pointblank
|
|
642
|
-
|
|
643
|
-
sep_line = "-" * 70
|
|
644
|
-
|
|
645
|
-
api_text = (
|
|
646
|
-
f"{sep_line}\nThis is the API documentation for the Pointblank library.\n{sep_line}\n\n"
|
|
647
|
-
)
|
|
648
|
-
|
|
649
|
-
#
|
|
650
|
-
# Lists of exported functions and methods in different families
|
|
651
|
-
#
|
|
652
|
-
|
|
653
|
-
validate_exported = [
|
|
654
|
-
"Validate",
|
|
655
|
-
"Thresholds",
|
|
656
|
-
"Actions",
|
|
657
|
-
"FinalActions",
|
|
658
|
-
"Schema",
|
|
659
|
-
"DraftValidation",
|
|
660
|
-
]
|
|
661
|
-
|
|
662
|
-
val_steps_exported = [
|
|
663
|
-
"Validate.col_vals_gt",
|
|
664
|
-
"Validate.col_vals_lt",
|
|
665
|
-
"Validate.col_vals_ge",
|
|
666
|
-
"Validate.col_vals_le",
|
|
667
|
-
"Validate.col_vals_eq",
|
|
668
|
-
"Validate.col_vals_ne",
|
|
669
|
-
"Validate.col_vals_between",
|
|
670
|
-
"Validate.col_vals_outside",
|
|
671
|
-
"Validate.col_vals_in_set",
|
|
672
|
-
"Validate.col_vals_not_in_set",
|
|
673
|
-
"Validate.col_vals_increasing",
|
|
674
|
-
"Validate.col_vals_decreasing",
|
|
675
|
-
"Validate.col_vals_null",
|
|
676
|
-
"Validate.col_vals_not_null",
|
|
677
|
-
"Validate.col_vals_regex",
|
|
678
|
-
"Validate.col_vals_within_spec",
|
|
679
|
-
"Validate.col_vals_expr",
|
|
680
|
-
"Validate.rows_distinct",
|
|
681
|
-
"Validate.rows_complete",
|
|
682
|
-
"Validate.col_exists",
|
|
683
|
-
"Validate.col_schema_match",
|
|
684
|
-
"Validate.row_count_match",
|
|
685
|
-
"Validate.col_count_match",
|
|
686
|
-
"Validate.tbl_match",
|
|
687
|
-
"Validate.conjointly",
|
|
688
|
-
"Validate.specially",
|
|
689
|
-
"Validate.prompt",
|
|
690
|
-
]
|
|
691
|
-
|
|
692
|
-
column_selection_exported = [
|
|
693
|
-
"col",
|
|
694
|
-
"starts_with",
|
|
695
|
-
"ends_with",
|
|
696
|
-
"contains",
|
|
697
|
-
"matches",
|
|
698
|
-
"everything",
|
|
699
|
-
"first_n",
|
|
700
|
-
"last_n",
|
|
701
|
-
"expr_col",
|
|
702
|
-
]
|
|
703
|
-
|
|
704
|
-
segments_exported = [
|
|
705
|
-
"seg_group",
|
|
706
|
-
]
|
|
707
|
-
|
|
708
|
-
interrogation_exported = [
|
|
709
|
-
"Validate.interrogate",
|
|
710
|
-
"Validate.set_tbl",
|
|
711
|
-
"Validate.get_tabular_report",
|
|
712
|
-
"Validate.get_step_report",
|
|
713
|
-
"Validate.get_json_report",
|
|
714
|
-
"Validate.get_sundered_data",
|
|
715
|
-
"Validate.get_data_extracts",
|
|
716
|
-
"Validate.all_passed",
|
|
717
|
-
"Validate.assert_passing",
|
|
718
|
-
"Validate.assert_below_threshold",
|
|
719
|
-
"Validate.above_threshold",
|
|
720
|
-
"Validate.n",
|
|
721
|
-
"Validate.n_passed",
|
|
722
|
-
"Validate.n_failed",
|
|
723
|
-
"Validate.f_passed",
|
|
724
|
-
"Validate.f_failed",
|
|
725
|
-
"Validate.warning",
|
|
726
|
-
"Validate.error",
|
|
727
|
-
"Validate.critical",
|
|
728
|
-
]
|
|
729
|
-
|
|
730
|
-
inspect_exported = [
|
|
731
|
-
"DataScan",
|
|
732
|
-
"preview",
|
|
733
|
-
"col_summary_tbl",
|
|
734
|
-
"missing_vals_tbl",
|
|
735
|
-
"assistant",
|
|
736
|
-
"load_dataset",
|
|
737
|
-
"get_data_path",
|
|
738
|
-
"connect_to_table",
|
|
739
|
-
]
|
|
740
|
-
|
|
741
|
-
yaml_exported = [
|
|
742
|
-
"yaml_interrogate",
|
|
743
|
-
"validate_yaml",
|
|
744
|
-
"yaml_to_python",
|
|
745
|
-
]
|
|
746
|
-
|
|
747
|
-
utility_exported = [
|
|
748
|
-
"get_column_count",
|
|
749
|
-
"get_row_count",
|
|
750
|
-
"get_action_metadata",
|
|
751
|
-
"get_validation_summary",
|
|
752
|
-
"write_file",
|
|
753
|
-
"read_file",
|
|
754
|
-
"config",
|
|
755
|
-
]
|
|
756
|
-
|
|
757
|
-
prebuilt_actions_exported = [
|
|
758
|
-
"send_slack_notification",
|
|
759
|
-
]
|
|
760
|
-
|
|
761
|
-
validate_desc = """When peforming data validation, you'll need the `Validate` class to get the
|
|
762
|
-
process started. It's given the target table and you can optionally provide some metadata and/or
|
|
763
|
-
failure thresholds (using the `Thresholds` class or through shorthands for this task). The
|
|
764
|
-
`Validate` class has numerous methods for defining validation steps and for obtaining
|
|
765
|
-
post-interrogation metrics and data."""
|
|
766
|
-
|
|
767
|
-
val_steps_desc = """Validation steps can be thought of as sequential validations on the target
|
|
768
|
-
data. We call `Validate`'s validation methods to build up a validation plan: a collection of steps
|
|
769
|
-
that, in the aggregate, provides good validation coverage."""
|
|
770
|
-
|
|
771
|
-
column_selection_desc = """A flexible way to select columns for validation is to use the `col()`
|
|
772
|
-
function along with column selection helper functions. A combination of `col()` + `starts_with()`,
|
|
773
|
-
`matches()`, etc., allows for the selection of multiple target columns (mapping a validation across
|
|
774
|
-
many steps). Furthermore, the `col()` function can be used to declare a comparison column (e.g.,
|
|
775
|
-
for the `value=` argument in many `col_vals_*()` methods) when you can't use a fixed value
|
|
776
|
-
for comparison."""
|
|
777
|
-
|
|
778
|
-
segments_desc = (
|
|
779
|
-
"""Combine multiple values into a single segment using `seg_*()` helper functions."""
|
|
780
|
-
)
|
|
781
|
-
|
|
782
|
-
interrogation_desc = """The validation plan is put into action when `interrogate()` is called.
|
|
783
|
-
The workflow for performing a comprehensive validation is then: (1) `Validate()`, (2) adding
|
|
784
|
-
validation steps, (3) `interrogate()`. After interrogation of the data, we can view a validation
|
|
785
|
-
report table (by printing the object or using `get_tabular_report()`), extract key metrics, or we
|
|
786
|
-
can split the data based on the validation results (with `get_sundered_data()`)."""
|
|
787
|
-
|
|
788
|
-
inspect_desc = """The *Inspection and Assistance* group contains functions that are helpful for
|
|
789
|
-
getting to grips on a new data table. Use the `DataScan` class to get a quick overview of the data,
|
|
790
|
-
`preview()` to see the first and last few rows of a table, `col_summary_tbl()` for a column-level
|
|
791
|
-
summary of a table, `missing_vals_tbl()` to see where there are missing values in a table, and
|
|
792
|
-
`get_column_count()`/`get_row_count()` to get the number of columns and rows in a table. Several
|
|
793
|
-
datasets included in the package can be accessed via the `load_dataset()` function. Finally, the
|
|
794
|
-
`config()` utility lets us set global configuration parameters. Want to chat with an assistant? Use
|
|
795
|
-
the `assistant()` function to get help with Pointblank."""
|
|
796
|
-
|
|
797
|
-
yaml_desc = """The *YAML* group contains functions that allow for the use of YAML to orchestrate
|
|
798
|
-
validation workflows. The `yaml_interrogate()` function can be used to run a validation workflow
|
|
799
|
-
from YAML strings or files. The `validate_yaml()` function checks if the YAML configuration passes
|
|
800
|
-
its own validity checks. The `yaml_to_python()` function converts YAML configuration to equivalent
|
|
801
|
-
Python code."""
|
|
802
|
-
|
|
803
|
-
utility_desc = """The Utility Functions group contains functions that are useful for accessing
|
|
804
|
-
metadata about the target data. Use `get_column_count()` or `get_row_count()` to get the number of
|
|
805
|
-
columns or rows in a table. The `get_action_metadata()` function is useful when building custom
|
|
806
|
-
actions since it returns metadata about the validation step that's triggering the action. Lastly,
|
|
807
|
-
the `config()` utility lets us set global configuration parameters."""
|
|
808
|
-
|
|
809
|
-
prebuilt_actions_desc = """The Prebuilt Actions group contains a function that can be used to
|
|
810
|
-
send a Slack notification when validation steps exceed failure threshold levels or just to provide a
|
|
811
|
-
summary of the validation results, including the status, number of steps, passing and failing steps,
|
|
812
|
-
table information, and timing details."""
|
|
813
|
-
|
|
814
|
-
#
|
|
815
|
-
# Add headings (`*_desc` text) and API details for each family of functions/methods
|
|
816
|
-
#
|
|
817
|
-
|
|
818
|
-
api_text += f"""\n## The Validate family\n\n{validate_desc}\n\n"""
|
|
819
|
-
api_text += get_api_details(module=pointblank, exported_list=validate_exported)
|
|
820
|
-
|
|
821
|
-
api_text += f"""\n## The Validation Steps family\n\n{val_steps_desc}\n\n"""
|
|
822
|
-
api_text += get_api_details(module=pointblank, exported_list=val_steps_exported)
|
|
823
|
-
|
|
824
|
-
api_text += f"""\n## The Column Selection family\n\n{column_selection_desc}\n\n"""
|
|
825
|
-
api_text += get_api_details(module=pointblank, exported_list=column_selection_exported)
|
|
826
|
-
|
|
827
|
-
api_text += f"""\n## The Segments family\n\n{segments_desc}\n\n"""
|
|
828
|
-
api_text += get_api_details(module=pointblank, exported_list=segments_exported)
|
|
829
|
-
|
|
830
|
-
api_text += f"""\n## The Interrogation and Reporting family\n\n{interrogation_desc}\n\n"""
|
|
831
|
-
api_text += get_api_details(module=pointblank, exported_list=interrogation_exported)
|
|
832
|
-
|
|
833
|
-
api_text += f"""\n## The Inspection and Assistance family\n\n{inspect_desc}\n\n"""
|
|
834
|
-
api_text += get_api_details(module=pointblank, exported_list=inspect_exported)
|
|
835
|
-
|
|
836
|
-
api_text += f"""\n## The YAML family\n\n{yaml_desc}\n\n"""
|
|
837
|
-
api_text += get_api_details(module=pointblank, exported_list=yaml_exported)
|
|
838
|
-
|
|
839
|
-
api_text += f"""\n## The Utility Functions family\n\n{utility_desc}\n\n"""
|
|
840
|
-
api_text += get_api_details(module=pointblank, exported_list=utility_exported)
|
|
841
|
-
|
|
842
|
-
api_text += f"""\n## The Prebuilt Actions family\n\n{prebuilt_actions_desc}\n\n"""
|
|
843
|
-
api_text += get_api_details(module=pointblank, exported_list=prebuilt_actions_exported)
|
|
844
|
-
|
|
845
|
-
# Modify language syntax in all code cells
|
|
846
|
-
api_text = api_text.replace("{python}", "python")
|
|
847
|
-
|
|
848
|
-
# Remove code cells that contain `#| echo: false` (i.e., don't display the code)
|
|
849
|
-
api_text = re.sub(r"```python\n\s*.*\n\s*.*\n.*\n.*\n.*```\n\s*", "", api_text)
|
|
850
|
-
|
|
851
|
-
return api_text
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
def _get_examples_text() -> str:
|
|
855
|
-
"""
|
|
856
|
-
Get the examples for the Pointblank library. These examples are extracted from the Quarto
|
|
857
|
-
documents in the `docs/demos` directory.
|
|
858
|
-
|
|
859
|
-
Returns
|
|
860
|
-
-------
|
|
861
|
-
str
|
|
862
|
-
The examples for the Pointblank library.
|
|
863
|
-
"""
|
|
864
|
-
|
|
865
|
-
sep_line = "-" * 70
|
|
866
|
-
|
|
867
|
-
examples_text = (
|
|
868
|
-
f"{sep_line}\nThis is a set of examples for the Pointblank library.\n{sep_line}\n\n"
|
|
869
|
-
)
|
|
870
|
-
|
|
871
|
-
# A large set of examples is available in the docs/demos directory, and each of the
|
|
872
|
-
# subdirectories contains a different example (in the form of a Quarto document)
|
|
873
|
-
|
|
874
|
-
example_dirs = [
|
|
875
|
-
"01-starter",
|
|
876
|
-
"02-advanced",
|
|
877
|
-
"03-data-extracts",
|
|
878
|
-
"04-sundered-data",
|
|
879
|
-
"05-step-report-column-check",
|
|
880
|
-
"06-step-report-schema-check",
|
|
881
|
-
"apply-checks-to-several-columns",
|
|
882
|
-
"check-row-column-counts",
|
|
883
|
-
"checks-for-missing",
|
|
884
|
-
"col-vals-custom-expr",
|
|
885
|
-
"column-selector-functions",
|
|
886
|
-
"comparisons-across-columns",
|
|
887
|
-
"expect-no-duplicate-rows",
|
|
888
|
-
"expect-no-duplicate-values",
|
|
889
|
-
"expect-text-pattern",
|
|
890
|
-
"failure-thresholds",
|
|
891
|
-
"mutate-table-in-step",
|
|
892
|
-
"numeric-comparisons",
|
|
893
|
-
"schema-check",
|
|
894
|
-
"set-membership",
|
|
895
|
-
"using-parquet-data",
|
|
896
|
-
]
|
|
897
|
-
|
|
898
|
-
for example_dir in example_dirs:
|
|
899
|
-
link = f"https://posit-dev.github.io/pointblank/demos/{example_dir}/"
|
|
900
|
-
|
|
901
|
-
# Read in the index.qmd file for each example
|
|
902
|
-
with open(f"docs/demos/{example_dir}/index.qmd", "r") as f:
|
|
903
|
-
example_text = f.read()
|
|
904
|
-
|
|
905
|
-
# Remove the first eight lines of the example text (contains the YAML front matter)
|
|
906
|
-
example_text = "\n".join(example_text.split("\n")[8:])
|
|
907
|
-
|
|
908
|
-
# Extract the title of the example (the line beginning with `###`)
|
|
909
|
-
title = re.search(r"### (.*)", example_text).group(1)
|
|
910
|
-
|
|
911
|
-
# The next line with text is the short description of the example
|
|
912
|
-
desc = re.search(r"(.*)\.", example_text).group(1)
|
|
913
|
-
|
|
914
|
-
# Get all of the Python code blocks in the example
|
|
915
|
-
# these can be identified as starting with ```python and ending with ```
|
|
916
|
-
code_blocks = re.findall(r"```python\n(.*?)```", example_text, re.DOTALL)
|
|
917
|
-
|
|
918
|
-
# Wrap each code block with a leading ```python and trailing ```
|
|
919
|
-
code_blocks = [f"```python\n{code}```" for code in code_blocks]
|
|
920
|
-
|
|
921
|
-
# Collapse all code blocks into a single string
|
|
922
|
-
code_text = "\n\n".join(code_blocks)
|
|
923
|
-
|
|
924
|
-
# Add the example title, description, and code to the examples text
|
|
925
|
-
examples_text += f"### {title} ({link})\n\n{desc}\n\n{code_text}\n\n"
|
|
926
|
-
|
|
927
|
-
return examples_text
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
def _get_api_and_examples_text() -> str:
|
|
931
|
-
"""
|
|
932
|
-
Get the combined API and examples text for the Pointblank library.
|
|
933
|
-
|
|
934
|
-
Returns
|
|
935
|
-
-------
|
|
936
|
-
str
|
|
937
|
-
The combined API and examples text for the Pointblank library.
|
|
938
|
-
"""
|
|
939
|
-
|
|
940
|
-
api_text = _get_api_text()
|
|
941
|
-
examples_text = _get_examples_text()
|
|
942
|
-
|
|
943
|
-
return f"{api_text}\n\n{examples_text}"
|
|
944
|
-
|
|
945
|
-
|
|
946
591
|
def _format_to_integer_value(x: int | float, locale: str = "en") -> str:
|
|
947
592
|
"""
|
|
948
593
|
Format a numeric value as an integer according to a locale's specifications.
|