file
object returned is a
bigdata_client.models.uploads.File
object, which contains:
id
: The unique identifier of the file.name
: The name of the file. It will be set to the name of the
original file in the disk.status
: The status of the file. Check
bigdata_client.file_status.FileStatus
for the list of possible statuses.uploaded_at
: The datetime when the file was uploaded, according to
the server.raw_size
: The size of the file in bytes.path
, the upload_from_disk()
method also accepts the
following optional parameters:
provider_document_id
: Allows you to assign a specific ID to your
document which will be available as provider_document_id
in the
metadata node of the annotated.json
. It is useful in case you want
to co-relate your own ids with the ones provided by Bigdata.provider_date_utc
: Allows you to assign a specific timestamp (a
string with YYYY-MM-DD hh:mm:ss
format or a datetime) to your
document. This will modify the document published date, allowing us to
better assign a reporting date to detected events.primary_entity
: You can specify a “Primary Entity” to boost entity
recognition in your document. When a primary entity is set for a
document, it increases the chances to detect events even when the
entity is not explicitly mentioned. Setting a primary entity is
optional and you can use either a name or the corresponding
rp_entity_id.skip_metadata
: If True, it will upload the file but not retrieve its
metadata. Recommended for bulk uploads. It is False by default.2400
seconds (40 minutes) until the file is processed. If you want to customize the time you are willing to wait, you can pass a timeout
parameter to the method.After the timeout (In seconds) is reached, the method will raise a TimeoutError
exception:add_tags()
, remove_tags()
, and
set_tags()
methods of the File
class objects. The file object may
come from the list()
, get()
, or upload_from_disk()
methods.
add_tags()
method. You can add a
single tag or a list of tags.
remove_tags()
method. You can
remove a single tag or a list of tags.
set_tags()
method. This
operation is permanent and replaces all existing tags.
list_my_tags()
method.
list_tags_shared_with_me()
method.
list()
method:
download_original()
method of the
file object.download_annotated()
method of the file object. This is a JSON file
containing the text together with the detections made by the system.download_analytics()
method of the file object. This is a JSON file
containing the analytics created by the system.get_<file_type>_dict()
method:
share_with_company
method. For example:
company_shared_permission
attribute of the search
object will be set to SharePermission.READ
.
unshare_with_company
method:
list_shared()
method:
delete()
method of the file object,
where the object may be coming from the list()
method, from the
get()
method, or from the upload_from_disk()
method:
delete()
method of the Uploads
object. This will avoid the need to
get the file object first:
COMPLETED
or FAILED
can be deleted.
Attempting to delete a file that is still being processed will raise an
exception. To avoid this, you can use the wait_for_completion()
method: