redshred package
Subpackages
- redshred.api package
- redshred.cli package
- redshred.enrichments package
- Submodules
- redshred.enrichments.base module
- redshred.enrichments.defined_acronyms module
- redshred.enrichments.external_api module
- redshred.enrichments.grouper module
GrouperPerspectiveGrouperPerspectiveConfigGrouperPerspectiveConfig.ConfigGrouperPerspectiveConfig.hull_methodGrouperPerspectiveConfig.hull_method_optionsGrouperPerspectiveConfig.operation_labelsGrouperPerspectiveConfig.operationsGrouperPerspectiveConfig.root_labelGrouperPerspectiveConfig.whitespace_calculation_methodGrouperPerspectiveConfig.whitespace_method_optionsGrouperPerspectiveConfig.x_gapGrouperPerspectiveConfig.y_gap
GrouperPerspectiveHullMethodobject_setattr()
- redshred.enrichments.huggingface module
HuggingfacePerspectiveHuggingfacePerspectiveConfigHuggingfacePerspectiveConfig.ConfigHuggingfacePerspectiveConfig.modelHuggingfacePerspectiveConfig.model_classHuggingfacePerspectiveConfig.model_sourceHuggingfacePerspectiveConfig.pipeline_taskHuggingfacePerspectiveConfig.task_configHuggingfacePerspectiveConfig.task_config_classHuggingfacePerspectiveConfig.task_specific_templateHuggingfacePerspectiveConfig.tokenizerHuggingfacePerspectiveConfig.tokenizer_class
object_setattr()
- redshred.enrichments.iris module
- redshred.enrichments.page_images module
- redshred.enrichments.pdftotext module
- redshred.enrichments.preprocess module
- redshred.enrichments.regex module
- redshred.enrichments.sentences module
- redshred.enrichments.spacy module
- redshred.enrichments.tfidf module
- redshred.enrichments.typography module
- Module contents
- redshred.microservices package
- redshred.models package
- Submodules
- redshred.models.api module
APIObjectIteratorApiObjectCollectionCollection.clientCollection.configCollection.create()Collection.created_atCollection.created_byCollection.delete()Collection.descriptionCollection.document()Collection.documents()Collection.documents_linkCollection.idCollection.load()Collection.marked_for_deleteCollection.metadataCollection.nameCollection.ownerCollection.perspective()Collection.perspectives()Collection.perspectives_linkCollection.segment()Collection.segments()Collection.segments_linkCollection.self_linkCollection.slugCollection.updated_atCollection.updated_byCollection.upload_csv()Collection.upload_file()Collection.upload_text()Collection.upload_url()Collection.user_data
CollectionIteratorDocumentDocument.collection()Document.collection_linkDocument.collection_slugDocument.configDocument.content_hashDocument.create()Document.created_atDocument.created_byDocument.csv_metadataDocument.descriptionDocument.document_segment_linkDocument.download()Document.download_bytes()Document.errorsDocument.file_linkDocument.file_sizeDocument.idDocument.indexDocument.metadataDocument.n_pagesDocument.nameDocument.original_nameDocument.page()Document.pages()Document.pages_linkDocument.pdf_linkDocument.perspective()Document.perspectives()Document.perspectives_linkDocument.read_stateDocument.read_state_updated_atDocument.regionDocument.reread_document()Document.segment()Document.segments()Document.segments_linkDocument.self_linkDocument.slugDocument.sourceDocument.summaryDocument.textDocument.uniqueness_idDocument.updated_atDocument.updated_byDocument.user_dataDocument.wait_until_read()Document.warnings
DocumentIteratorPagePage.collection()Page.collection_linkPage.collection_slugPage.content_hashPage.created_atPage.created_byPage.document()Page.document_indexPage.document_namePage.dpiPage.heightPage.idPage.indexPage.metadataPage.namePage.next()Page.page_segment_linkPage.perspective()Page.perspectives()Page.perspectives_linkPage.previous()Page.regionPage.segment()Page.segments()Page.segments_linkPage.self_linkPage.summaryPage.textPage.tokens()Page.tokens_file_linkPage.unitsPage.updated_atPage.updated_byPage.user_dataPage.width
PageIteratorPerspectivePerspective.bulk_create_segments()Perspective.cache_idPerspective.collection()Perspective.collection_linkPerspective.collection_slugPerspective.create()Perspective.created_atPerspective.created_byPerspective.descriptionPerspective.document()Perspective.document_linkPerspective.document_namePerspective.enrichment_configPerspective.enrichment_namePerspective.errorsPerspective.idPerspective.metadataPerspective.namePerspective.segment()Perspective.segment_typesPerspective.segments()Perspective.segments_linkPerspective.self_linkPerspective.slugPerspective.updated_atPerspective.updated_byPerspective.user_dataPerspective.warnings
PerspectiveIteratorRedShredUserSegmentSegment.between()Segment.bounding_boxSegment.cache_idSegment.collection()Segment.collection_linkSegment.collection_slugSegment.create()Segment.created_atSegment.created_bySegment.document()Segment.document_linkSegment.document_nameSegment.enrichment_dataSegment.enrichment_nameSegment.errorsSegment.get_segment_image()Segment.get_segments_from_perspective()Segment.get_text()Segment.idSegment.labelsSegment.max_xSegment.max_ySegment.metadataSegment.min_xSegment.min_ySegment.perspective()Segment.perspective_linkSegment.q()Segment.regionsSegment.segment_typeSegment.self_linkSegment.summarySegment.textSegment.updated_atSegment.updated_bySegment.user_dataSegment.warnings
SegmentIteratorSerializableModelTokenget_type()
- redshred.models.configuration module
ChoiceSegmenterChoiceSentenceTokenizerCollectionConfigurationCollectionConfiguration.ConfigCollectionConfiguration.allow_anonymous_downloadsCollectionConfiguration.dict()CollectionConfiguration.document_uniquenessCollectionConfiguration.enrichmentsCollectionConfiguration.from_dict()CollectionConfiguration.json()CollectionConfiguration.notificationsCollectionConfiguration.tokenizerCollectionConfiguration.validate_remote_schema()CollectionConfiguration.yaml()
CustomSegmenterDocumentUniquenessNotificationConfigurationPerspectiveConfigurationPerspectiveSegmentQueryTokenizersTypographyConfiguration
- redshred.models.enrichments module
- Module contents
- redshred.visualize package
Submodules
redshred.configuration module
- class redshred.configuration.Configuration(token=None, host=None, host_verify=None, config_path=None, context_override=None)[source]
Bases:
objectRedShred Configuration, here is the order that various configured sources are looked up
REDSHRED_TOKEN + REDSHRED_HOST REDSHRED_CONTEXT + REDSHRED_CONFIG REDSHRED_CONTEXT (uses default config path) REDSHRED_CONFIG (defaults to currentContext) None default config path with currentContext
- context: str
- host: str
- options: Dict[str, Any]
- source: str
- token: str
- user: str | None
- verify: bool
redshred.exceptions module
- exception redshred.exceptions.RedShredAPIError(*args, reason=None, **kwargs)[source]
Bases:
Exception- reason: Any
- exception redshred.exceptions.RedShredFileExistsError(*args, **kwargs)[source]
Bases:
RedShredHTTPError
redshred.spatial module
- class redshred.spatial.BoundingBox(initlist: Iterable | None = None)[source]
Bases:
list,_BaseGeometricMixin- as_boundingbox() BoundingBox[source]
Get a BoundingBox object from a GeoJSON object
- classmethod from_shape(geometry) BoundingBox[source]
- get_bounds() BoundingBox[source]
for api consistency with Geojson
- get_offsets(numpy=False) tuple[int, int][source]
x and y offsets for each coordinate of the geojson object
- property height
- property min_x
- property min_y
- normalize_to_page() BoundingBox[source]
- rotate(rotation, origin=(0.5, 0.5)) BoundingBox[source]
- scale(xfact=1.0, yfact=1.0, origin=(0, 0)) BoundingBox[source]
shapely scaling transformation
- translate(xoff=0.0, yoff=0.0) BoundingBox[source]
shapely offset transformation
- property width
- class redshred.spatial.GeoJSON[source]
Bases:
dict,_BaseGeometricMixin- as_boundingbox() BoundingBox[source]
Get a BoundingBox object from a GeoJSON object
- as_shape() BaseGeometry[source]
Get a shapely object from the GeoJSON dictionary Returns:
BaseGeometry
- classmethod from_bounds(x_min, y_min, x_max, y_max, base_class='polygon')[source]
Create a new object from x_min, y_min, x_max, y_max values. By default, a polygon is returned, but you can override this functionality by passing “multipolygon” as your base_class
- classmethod from_coords(coords)[source]
Create a new GeoJSON object from either a list of coordinates, or a list of list of coordinates for a Polygon and Multipolygon respectively
- get_bounds() BoundingBox[source]
Get a BoundingBox object from a GeoJSON object
- get_coordinates(canonical=True, numpy=False) List[List[float]][source]
Get a coordinates list object from a GeoJSON object
- get_offsets(numpy=False) Tuple[int, int][source]
x and y offsets for each coordinate of the geojson object
- property height
- property min_x
- property min_y
- normalize_to_page() GeoJSON[source]
Normalize the given GeoJSON from the quiltspace or document space to a [0,1], [0,1] scale. This returns a new GeoJSON instance.
- rotate(angle, origin='center') GeoJSON[source]
Rotate a GeoJSON object using affine transformations. This returns a new GeoJSON instance.
- scale(xfact=1.0, yfact=1.0, origin=(0, 0)) GeoJSON[source]
Scale a GeoJSON object using affine transformations. This returns a new GeoJSON instance.
- translate(xoff=0.0, yoff=0.0) GeoJSON[source]
Offset a GeoJSON object by the specified amount. This returns a new GeoJSON instance.
- property width
redshred.util module
util functions
Module contents
This is the RedShred client library in Python.
RedShred, LLC 2018-2023