APIResource¶
- class xbrl_filings_api.APIResource¶
Bases:
APIObject
Base class for JSON:API resources, i.e., data objects.
Subclasses of this class may be read into a database. An instance resembles a database record.
This library assumes the API returning datetimes in UTC, if no timezone is specified (situation as of April 2024). Original datetime string is retained in attribute with
"_time_str"
ending paired with the"_time"
ended attributes (e.g.added_time_str
).Methods
get_data_attributes
([flags, filings])Return data attributes for an
APIResource
.__hash__
()Return hash of
('APIResource', cls.TYPE, self.api_id)
.__repr__
()Return repr(self).
__str__
()Return str(self).
Attributes
JSON-API resource
id
ofAPIResource
.query_time
Time when the query function was called for an
APIObject
.request_url
HTTP request URL for an
APIObject
.- TYPE: str = ''¶
JSON-API resource
type
ofAPIResource
subclass.
- api_id: str¶
JSON-API resource
id
ofAPIResource
.Can be used as a unique identifier among resources of the same type.
- classmethod get_data_attributes(flags=None, filings=None)¶
Return data attributes for an
APIResource
.Excludes internal and class attributes and the ones containing objects.
For
Filing
objects this also means excluding attributes ending_download_path
if every filing in parameterfilings
have this attribute asNone
. Additionally, ifGET_ENTITY
is not included in parameterflags
, returned attribute list will excludeentity_api_id
.
- __hash__()¶
Return hash of
('APIResource', cls.TYPE, self.api_id)
.