Entry Point Classes¶
The Bigdata
class is the main entry point for interacting with the Bigdata
API. You typically create a Bigdata object, providing the credentials, and then
use it to interact with the API, through one of its four proxy objects, or
other objects created form them:
from bigdata_client import Bigdata
# Providing the credentials directly:
bigdata = Bigdata('username', 'password')
# Or using the environment variables BIGDATA_USERNAME and BIGDATA_PASSWORD:
bigdata = Bigdata()
bigdata.knowledge_graph # methods for interacting with the Bigdata domain
bigdata.search # methods for searching
bigdata.watchlists # methods for interacting with watchlists
bigdata.uploads # methods for managing internal content
Examples¶
Some examples on how to use the Bigdata class and its proxy objects:
KnowledgeGraph Search:¶
results = bigdata.knowledge_graph.find_companies("tesla") # You can search for a company by name
tesla = results["tesla"][0] # Which will return you an array of companies
entities = bigdata.knowledge_graph.get_entities(["228D42"]) # Or you can search by any entity once you have its ID
tesla = entities[0] # Which will return you an array of results
msft, meta = bigdata.knowledge_graph.get_companies_by_listing(["XNAS:MSFT", "XNAS:META"]) # Will return an array of companies
Watchlists:¶
bigdata.watchlists.create("My new watchlist")
bigdata.watchlists.list()
bigdata.watchlists.get(watchlist_id)
bigdata.watchlists.delete(watchlist_id)
Content Search:¶
s = bigdata.search.new(query=(Keyword("tesla")|Entity("228D42")))
for result in s.limit_documents(100):
print(result)
s.save("My search")
bigdata.search.delete(search_id)
Internal Content:¶
bigdata.uploads.upload_file(filename)
bigdata.uploads.list()
bigdata.uploads.get(file.id)
bigdata.uploads.delete(file.id)
- class Bigdata[source]¶
Represents a connection to RavenPack’s Bigdata API.
- Variables:
knowledge_graph – Proxy for the knowledge graph search functionality.
search – Proxy object for the content search functionality.
watchlists – Proxy object for the watchlist functionality.
uploads – Proxy object for the internal content functionality.
subscription – Proxy object for the subscription functionality.
- __init__(username=None, password=None, *, bigdata_api_url=None, bigdata_ws_url=None, upload_api_url=None, proxy=None, verify_ssl=True)[source]¶
- Parameters:
username (str | None) –
password (str | None) –
bigdata_api_url (str | None) –
bigdata_ws_url (str | None) –
upload_api_url (str | None) –
proxy (Proxy | None) –
verify_ssl (bool | str) –
- class KnowledgeGraph[source]¶
For finding entities, sources and topics
- autosuggest(values: list[str], /, limit: int = 20) dict[str, list[MacroEntity | Etf | Company | Facility | Landmark | Organization | OrganizationType | Person | Place | Product | ProductType | Source | Topic | Language | AutosuggestedSavedSearch | Watchlist | Concept]] [source]¶
- autosuggest(value: str, /, limit: int = 20) list[MacroEntity | Etf | Company | Facility | Landmark | Organization | OrganizationType | Person | Place | Product | ProductType | Source | Topic | Language | AutosuggestedSavedSearch | Watchlist | Concept]
Searches for entities, sources, topics, searches and watchlists
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_companies(values: list[str], /, limit=20) dict[str, list[Company]] [source]¶
- find_companies(values: str, /, limit=20) list[Company]
Searches for values in the Knowledge Graph and filters out anything that is not a company.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_concepts(values: list[str], /, limit=20) dict[str, list[Concept]] [source]¶
- find_concepts(values: str, /, limit=20) list[Concept]
Searches for values in the Knowledge Graph and filters out anything that is not a concept.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_etfs(value, /, limit=20)[source]¶
Searches for value in the Knowledge Graph and filters out anything that is not a ETF.
- Args:
value: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
- Parameters:
value (str) –
- find_organizations(values: list[str], /, limit=20) dict[str, list[Organization]] [source]¶
- find_organizations(values: str, /, limit=20) list[Organization]
Searches for values in the Knowledge Graph and filters out anything that is not an organization.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_people(values: list[str], /, limit=20)[source]¶
- find_people(values: str, /, limit=20) list[Person]
Searches for values in the Knowledge Graph and filters out anything that is not a person.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_places(values: list[str], /, limit=20) dict[str, list[Place]] [source]¶
- find_places(values: str, /, limit=20) list[Place]
Searches for values in the Knowledge Graph and filters out anything that is not a place.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_products(values: list[str], /, limit=20) dict[str, list[Product]] [source]¶
- find_products(values: str, /, limit=20) list[Product]
Searches for values in the Knowledge Graph and filters out anything that is not a product.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_sources(values: list[str], /, limit=20) dict[str, list[Source]] [source]¶
- find_sources(values: str, /, limit=20) list[Source]
Searches for values in the Knowledge Graph and filters out anything that is not a source.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- find_topics(values: list[str], /, limit=20) dict[str, list[Topic]] [source]¶
- find_topics(value: str, /, limit=20) list[Topic]
Searches for values in the Knowledge Graph and filters out anything that is not a topic.
Overloaded method¶
Implementation 1
- Args:
values: Searched item (str)
limit: Upper limit for each result before applying the filter
- Returns:
List of results.
Implementation 2: DEPRECATED
- Args:
values: Searched items (list[str])
limit: Upper limit for each result before applying the filter
- Returns:
Dict with the searched terms as keys each with a list of results.
- get_companies_by_cusip(cusips)[source]¶
Retrieve a list of companies by their CUSIP
- Parameters:
cusips (list[str]) – CUSIP list
- Returns:
List of companies in the same order as original @cusip list, or None if was not found
- Return type:
list[Optional[Company]]
- get_companies_by_isin(isins)[source]¶
Retrieve a list of companies by their ISIN
- Parameters:
isins (list[str]) – ISIN list
- Returns:
List of companies in the same order as original @isin list, or None if was not found
- Return type:
list[Optional[Company]]
- get_companies_by_listing(listings)[source]¶
Retrieve a list of companies by their listing
- Parameters:
listings (list[str]) – listing list
- Returns:
List of companies in the same order as original @listing list, or None if was not found
- Return type:
list[Optional[Company]]
- get_companies_by_sedol(sedols)[source]¶
Retrieve a list of companies by their SEDOL
- Parameters:
sedols (list[str]) – SEDOL list
- Returns:
List of companies in the same order as original @sedol list, or None if was not found
- Return type:
list[Optional[Company]]
- get_entities(ids, /)[source]¶
Retrieve a list of entities by their ids.
- Parameters:
ids (list[str]) –
- Return type:
list[Etf | Company | Facility | Landmark | Organization | OrganizationType | Person | Place | Product | ProductType | Concept | None]
- get_languages(ids, /)[source]¶
Retrieve a list of languages by its ids.
- Parameters:
ids (list[str]) –
- Return type:
list[Language | None]
- class ContentSearch[source]¶
-
- new(query, date_range=None, sortby=SortBy.RELEVANCE, scope=DocumentType.ALL, rerank_threshold=None)[source]¶
Creates a new search object that allows you to perform a search on keywords, entities, etc.
Example usage:
>>> query = Entity("228D42") & Keyword("tesla") >>> search = bigdata.search.new( ... query, ... date_range=RollingDateRange.LAST_WEEK, ... sortby=SortBy.RELEVANCE, ... scope=DocumentType.ALL ... ) >>> search.save() >>> for document in search.limit_documents(100): >>> print(document) >>> print(search.get_summary()) >>> search.delete()
- Parameters:
query (QueryComponent) –
date_range (AbsoluteDateRange | RollingDateRange | None) –
sortby (SortBy) –
scope (DocumentType) –
rerank_threshold (float | None) –
- Return type:
- class Watchlists[source]¶
For finding, iterating and doing operations with watchlist objects
- create(name, items)[source]¶
Creates a new watchlist in the system.
- Parameters:
name (str) –
items (List[str]) –
- Return type:
- list(owned=False)[source]¶
Retrieve all watchlist objects for the current user.
- Parameters:
owned (bool) –
- Return type:
list[Watchlist]
Share a watchlist with the whole company.
- Parameters:
id_ (str) –
Stop sharing a watchlist with the company
- Parameters:
id_ (str) –
- class Uploads[source]¶
For managing internal uploads. Searching will be done through content
- list(start_date=None, end_date=None, tags=None, status=None, file_name=None, folder_id=None, page_size=5000, page_number=1)[source]¶
Retrieve all documents for the current user.
- Parameters:
start_date (datetime | str | None) –
end_date (datetime | str | None) –
tags (list[str] | None) –
status (FileStatus | None) –
file_name (str | None) –
folder_id (str | None) –
page_size (int) –
page_number (int) –
- Return type:
Retrieve all documents shared with the user that do not belong to them.
- Parameters:
start_date (datetime | str | None) –
end_date (datetime | str | None) –
tags (List[str] | None) –
status (FileStatus | None) –
file_name (str | None) –
folder_id (str | None) –
page_size (int) –
page_number (int) –
- Return type:
List all tags shared with the current user.
- Return type:
List[str]
Share with own company
- Parameters:
id_ (str) –
Stop sharing with own company
- Parameters:
id_ (str) –
- upload_from_disk(path, /, provider_document_id=None, provider_date_utc=None, primary_entity=None, skip_metadata=None)[source]¶
Uploads a file to the bigdata platform.
- Parameters:
path (str) –
provider_document_id (str | None) –
provider_date_utc (datetime | str | None) –
primary_entity (str | None) –
skip_metadata (bool | None) –
- Return type: