from alephclient.api import AlephAPI
# By default, alephclient will read host and API key from the
# environment. You can also pass both as an argument here:
# Get the collection (dataset)
foreign_id = 'zz_occrp_pdi'
collection = api.load_collection_by_foreign_id(foreign_id)
collection_id = collection.get('id')
file_path = 'www.personadeinteres.org/uploads/example.pdf'
metadata = {'file_name': 'example.pdf'}
result = api.ingest_upload(collection_id, file_path, metadata)
# Finally, we have an entity ID:
document_id = result.get('id')