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
GrouperPerspective
GrouperPerspectiveConfig
GrouperPerspectiveConfig.Config
GrouperPerspectiveConfig.hull_method
GrouperPerspectiveConfig.hull_method_options
GrouperPerspectiveConfig.operation_labels
GrouperPerspectiveConfig.operations
GrouperPerspectiveConfig.root_label
GrouperPerspectiveConfig.whitespace_calculation_method
GrouperPerspectiveConfig.whitespace_method_options
GrouperPerspectiveConfig.x_gap
GrouperPerspectiveConfig.y_gap
GrouperPerspectiveHullMethod
object_setattr()
- redshred.enrichments.huggingface module
HuggingfacePerspective
HuggingfacePerspectiveConfig
HuggingfacePerspectiveConfig.Config
HuggingfacePerspectiveConfig.model
HuggingfacePerspectiveConfig.model_class
HuggingfacePerspectiveConfig.model_source
HuggingfacePerspectiveConfig.pipeline_task
HuggingfacePerspectiveConfig.task_config
HuggingfacePerspectiveConfig.task_config_class
HuggingfacePerspectiveConfig.task_specific_template
HuggingfacePerspectiveConfig.tokenizer
HuggingfacePerspectiveConfig.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
APIObjectIterator
ApiObject
Collection
Collection.client
Collection.config
Collection.create()
Collection.created_at
Collection.created_by
Collection.delete()
Collection.description
Collection.document()
Collection.documents()
Collection.documents_link
Collection.id
Collection.load()
Collection.marked_for_delete
Collection.metadata
Collection.name
Collection.owner
Collection.perspective()
Collection.perspectives()
Collection.perspectives_link
Collection.segment()
Collection.segments()
Collection.segments_link
Collection.self_link
Collection.slug
Collection.updated_at
Collection.updated_by
Collection.upload_csv()
Collection.upload_file()
Collection.upload_text()
Collection.upload_url()
Collection.user_data
CollectionIterator
Document
Document.collection()
Document.collection_link
Document.collection_slug
Document.config
Document.content_hash
Document.create()
Document.created_at
Document.created_by
Document.csv_metadata
Document.description
Document.document_segment_link
Document.download()
Document.download_bytes()
Document.errors
Document.file_link
Document.file_size
Document.id
Document.index
Document.metadata
Document.n_pages
Document.name
Document.original_name
Document.page()
Document.pages()
Document.pages_link
Document.pdf_link
Document.perspective()
Document.perspectives()
Document.perspectives_link
Document.read_state
Document.read_state_updated_at
Document.region
Document.reread_document()
Document.segment()
Document.segments()
Document.segments_link
Document.self_link
Document.slug
Document.source
Document.summary
Document.text
Document.uniqueness_id
Document.updated_at
Document.updated_by
Document.user_data
Document.wait_until_read()
Document.warnings
DocumentIterator
Page
Page.collection()
Page.collection_link
Page.collection_slug
Page.content_hash
Page.created_at
Page.created_by
Page.document()
Page.document_index
Page.document_name
Page.dpi
Page.height
Page.id
Page.index
Page.metadata
Page.name
Page.next()
Page.page_segment_link
Page.perspective()
Page.perspectives()
Page.perspectives_link
Page.previous()
Page.region
Page.segment()
Page.segments()
Page.segments_link
Page.self_link
Page.summary
Page.text
Page.tokens()
Page.tokens_file_link
Page.units
Page.updated_at
Page.updated_by
Page.user_data
Page.width
PageIterator
Perspective
Perspective.bulk_create_segments()
Perspective.cache_id
Perspective.collection()
Perspective.collection_link
Perspective.collection_slug
Perspective.create()
Perspective.created_at
Perspective.created_by
Perspective.description
Perspective.document()
Perspective.document_link
Perspective.document_name
Perspective.enrichment_config
Perspective.enrichment_name
Perspective.errors
Perspective.id
Perspective.metadata
Perspective.name
Perspective.segment()
Perspective.segment_types
Perspective.segments()
Perspective.segments_link
Perspective.self_link
Perspective.slug
Perspective.updated_at
Perspective.updated_by
Perspective.user_data
Perspective.warnings
PerspectiveIterator
RedShredUser
Segment
Segment.between()
Segment.bounding_box
Segment.cache_id
Segment.collection()
Segment.collection_link
Segment.collection_slug
Segment.create()
Segment.created_at
Segment.created_by
Segment.document()
Segment.document_link
Segment.document_name
Segment.enrichment_data
Segment.enrichment_name
Segment.errors
Segment.get_segment_image()
Segment.get_segments_from_perspective()
Segment.get_text()
Segment.id
Segment.labels
Segment.max_x
Segment.max_y
Segment.metadata
Segment.min_x
Segment.min_y
Segment.perspective()
Segment.perspective_link
Segment.q()
Segment.regions
Segment.segment_type
Segment.self_link
Segment.summary
Segment.text
Segment.updated_at
Segment.updated_by
Segment.user_data
Segment.warnings
SegmentIterator
SerializableModel
Token
get_type()
- redshred.models.configuration module
ChoiceSegmenter
ChoiceSentenceTokenizer
CollectionConfiguration
CollectionConfiguration.Config
CollectionConfiguration.allow_anonymous_downloads
CollectionConfiguration.dict()
CollectionConfiguration.document_uniqueness
CollectionConfiguration.enrichments
CollectionConfiguration.from_dict()
CollectionConfiguration.json()
CollectionConfiguration.notifications
CollectionConfiguration.tokenizer
CollectionConfiguration.validate_remote_schema()
CollectionConfiguration.yaml()
CustomSegmenter
DocumentUniqueness
NotificationConfiguration
PerspectiveConfiguration
PerspectiveSegmentQuery
Tokenizers
TypographyConfiguration
- 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:
object
RedShred 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