xbrl_us package#
Subpackages#
- xbrl_us.schemas package
- Submodules
- xbrl_us.schemas.assertion_details module
- xbrl_us.schemas.concept_details module
ConceptDetails
ConceptDetails.balance_type
ConceptDetails.convert_key_format()
ConceptDetails.datatype
ConceptDetails.id
ConceptDetails.is_abstract
ConceptDetails.is_base
ConceptDetails.is_monetary
ConceptDetails.is_nillable
ConceptDetails.is_numeric
ConceptDetails.local_name
ConceptDetails.namespace
ConceptDetails.period_type
ConceptDetails.substitution
ConceptDetails.to_dict()
- xbrl_us.schemas.cube_details module
- xbrl_us.schemas.dimension_details module
- xbrl_us.schemas.document_details module
- xbrl_us.schemas.dts_details module
- xbrl_us.schemas.entity_details module
- xbrl_us.schemas.fact_details module
- xbrl_us.schemas.label_details module
- xbrl_us.schemas.network_details module
- xbrl_us.schemas.relationship_details module
- xbrl_us.schemas.report_details module
- Module contents
- xbrl_us.utils package
- Submodules
- xbrl_us.utils.exceptions module
- xbrl_us.utils.paramters module
Parameters
Parameters.concept_id
Parameters.concept_is_base
Parameters.concept_is_monetary
Parameters.concept_local_name
Parameters.concept_namespace
Parameters.dimension_is_base
Parameters.dimension_local_name
Parameters.dimension_namespace
Parameters.dimensions_count
Parameters.dimensions_id
Parameters.dts_entry_point
Parameters.dts_id
Parameters.dts_target_namespace
Parameters.entity_cik
Parameters.entity_id
Parameters.fact_has_dimensions
Parameters.fact_hash
Parameters.fact_id
Parameters.fact_is_extended
Parameters.fact_text_search
Parameters.fact_ultimus
Parameters.fact_ultimus_index
Parameters.fact_value
Parameters.fact_value_link
Parameters.get_parameters_dict()
Parameters.member_is_base
Parameters.member_local_name
Parameters.member_member_value
Parameters.member_namespace
Parameters.member_typed_value
Parameters.period_calendar_period
Parameters.period_fiscal_id
Parameters.period_fiscal_period
Parameters.period_fiscal_year
Parameters.period_id
Parameters.period_year
Parameters.report_accession
Parameters.report_creation_software
Parameters.report_document_index
Parameters.report_document_type
Parameters.report_entry_url
Parameters.report_id
Parameters.report_restated
Parameters.report_restated_index
Parameters.report_sec_url
Parameters.report_sic_code
Parameters.report_source_id
Parameters.report_source_name
Parameters.unit
- Module contents
Fields
Parameters
Parameters.concept_id
Parameters.concept_is_base
Parameters.concept_is_monetary
Parameters.concept_local_name
Parameters.concept_namespace
Parameters.dimension_is_base
Parameters.dimension_local_name
Parameters.dimension_namespace
Parameters.dimensions_count
Parameters.dimensions_id
Parameters.dts_entry_point
Parameters.dts_id
Parameters.dts_target_namespace
Parameters.entity_cik
Parameters.entity_id
Parameters.fact_has_dimensions
Parameters.fact_hash
Parameters.fact_id
Parameters.fact_is_extended
Parameters.fact_text_search
Parameters.fact_ultimus
Parameters.fact_ultimus_index
Parameters.fact_value
Parameters.fact_value_link
Parameters.get_parameters_dict()
Parameters.member_is_base
Parameters.member_local_name
Parameters.member_member_value
Parameters.member_namespace
Parameters.member_typed_value
Parameters.period_calendar_period
Parameters.period_fiscal_id
Parameters.period_fiscal_period
Parameters.period_fiscal_year
Parameters.period_id
Parameters.period_year
Parameters.report_accession
Parameters.report_creation_software
Parameters.report_document_index
Parameters.report_document_type
Parameters.report_entry_url
Parameters.report_id
Parameters.report_restated
Parameters.report_restated_index
Parameters.report_sec_url
Parameters.report_sic_code
Parameters.report_source_id
Parameters.report_source_name
Parameters.unit
Submodules#
xbrl_us.cli module#
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause problems: the code will get executed twice:
When you run python -mxbrl_us python will execute
__main__.py
as a script. That means there will not be anyxbrl_us.__main__
insys.modules
.When you import __main__ it will get executed again (as a module) because there”s no
xbrl_us.__main__
insys.modules
.Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration
xbrl_us.xbrl_us module#
- class xbrl_us.xbrl_us.XBRL(client_id: str, client_secret: str, username: str, password: str, grant_type: str = 'password')[source]#
Bases:
object
XBRL US API client. Initializes an instance of XBRL authorized connection.
- Parameters:
client_id (str) – Unique identifier agreed upon by XBRL US and the 3rd party client.
client_secret (str) – Base64 key used to authenticate the 3rd party client.
username (str) – Unique identifier for a given user.
password (str) – Password used to authenticate the 3rd party user.
grant_type (str) – Used to identify which credentials the authorization server needs to check
client_credentials - Requires a client_id and client_secret only
password - Requires a username and password as well as client_id and client_secret
default - “password”
- static acceptable_params(method_name: str)[source]#
- Get the names of the attributes that are allowed to be used for
the given method.
- Parameters:
method_name (str) – The name of the API method to get the acceptable parameters for (e.g. “search_fact”).
Returns:
- static methods()[source]#
- Get the names of the attributes that are allowed to be used for
the given method. A list available methods are:
Method
API Endpoint
assertion search
/api/v1/assertion/search
assertion validate
/api/v1/assertion/validate
concept name search
/api/v1/concept/{concept.local-name}/search
concept search
/api/v1/concept/search
cube search
/api/v1/cube/search
dimension search
/api/v1/dimension/search
document search
/api/v1/document/search
dts id concept label
/api/v1/dts/{dts.id}/concept/{concept.local-name}/label
dts id concept name
/api/v1/dts/{dts.id}/concept/{concept.local-name}
dts id concept reference
/api/v1/dts/{dts.id}/concept/{concept.local-name}/reference
dts id concept search
/api/v1/dts/{dts.id}/concept/search
dts id network
/api/v1/dts/{dts.id}/network
dts id network search
/api/v1/dts/{dts.id}/network/search
dts search
/api/v1/dts/search
entity id
/api/v1/entity/{entity.id}
entity id report search
/api/v1/entity/{entity.id}/report/search
entity report search
/api/v1/entity/report/search
entity search
/api/v1/entity/search
fact id
/api/v1/fact/{fact.id}
fact search
/api/v1/fact/search
fact search oim
/api/v1/fact/oim/search
label dts id search
/api/v1/label/{dts.id}/search
label search
/api/v1/label/search
network id
/api/v1/network/{network.id}
network id relationship search
/api/v1/network/{network.id}/relationship/search
network relationship search
/api/v1/network/relationship/search
relationship search
/api/v1/relationship/search
relationship tree search
/api/v1/relationship/tree/search
report fact search
/api/v1/report/fact/search
report id
/api/v1/report/{report.id}
report id delete
/api/v1/report/{report.id}/delete
report id fact
/api/v1/report/{report.id}/fact/search
report search
/api/v1/report/search
- query(method: str, fields: list | None = None, parameters: Parameters | dict | None = None, limit: dict | None = None, sort: dict | None = None, offset: dict | None = None, as_dataframe: bool = False) dict | DataFrame [source]#
- Parameters:
method (str) – The name of the method to query.
fields (list) – The fields query parameter establishes the details of the data to return for the specific query.
parameters (dict | Parameters) – The parameters for the query.
limit (dict) – A limit restricts the number of results returned by the query. The limit attribute can only be added to an object type and not a property. For example, to limit the number of facts in a query, {“fact”: 10}.
sort (dict) – Any returned value can be sorted in ascending or descending order, using
ASC
orDESC
(i.e. {“report.document-type”: “DESC”}. Multiple sort criteria can be defined and the sort sequence is determined by the order of the items in the dictionary.offset – This attribute enables targeting a return to a specific starting point in a query return sequence (i.e. {“report”: 100}. To work reliably, at least one sorted property should be included in the returned fields.
as_dataframe (bool=False) – Whether to return the results as a DataFrame or json.
- Returns:
dict | DataFrame – The results of the query.
Module contents#
- class xbrl_us.XBRL(client_id: str, client_secret: str, username: str, password: str, grant_type: str = 'password')[source]#
Bases:
object
XBRL US API client. Initializes an instance of XBRL authorized connection.
- Parameters:
client_id (str) – Unique identifier agreed upon by XBRL US and the 3rd party client.
client_secret (str) – Base64 key used to authenticate the 3rd party client.
username (str) – Unique identifier for a given user.
password (str) – Password used to authenticate the 3rd party user.
grant_type (str) – Used to identify which credentials the authorization server needs to check
client_credentials - Requires a client_id and client_secret only
password - Requires a username and password as well as client_id and client_secret
default - “password”
- static acceptable_params(method_name: str)[source]#
- Get the names of the attributes that are allowed to be used for
the given method.
- Parameters:
method_name (str) – The name of the API method to get the acceptable parameters for (e.g. “search_fact”).
Returns:
- static methods()[source]#
- Get the names of the attributes that are allowed to be used for
the given method. A list available methods are:
Method
API Endpoint
assertion search
/api/v1/assertion/search
assertion validate
/api/v1/assertion/validate
concept name search
/api/v1/concept/{concept.local-name}/search
concept search
/api/v1/concept/search
cube search
/api/v1/cube/search
dimension search
/api/v1/dimension/search
document search
/api/v1/document/search
dts id concept label
/api/v1/dts/{dts.id}/concept/{concept.local-name}/label
dts id concept name
/api/v1/dts/{dts.id}/concept/{concept.local-name}
dts id concept reference
/api/v1/dts/{dts.id}/concept/{concept.local-name}/reference
dts id concept search
/api/v1/dts/{dts.id}/concept/search
dts id network
/api/v1/dts/{dts.id}/network
dts id network search
/api/v1/dts/{dts.id}/network/search
dts search
/api/v1/dts/search
entity id
/api/v1/entity/{entity.id}
entity id report search
/api/v1/entity/{entity.id}/report/search
entity report search
/api/v1/entity/report/search
entity search
/api/v1/entity/search
fact id
/api/v1/fact/{fact.id}
fact search
/api/v1/fact/search
fact search oim
/api/v1/fact/oim/search
label dts id search
/api/v1/label/{dts.id}/search
label search
/api/v1/label/search
network id
/api/v1/network/{network.id}
network id relationship search
/api/v1/network/{network.id}/relationship/search
network relationship search
/api/v1/network/relationship/search
relationship search
/api/v1/relationship/search
relationship tree search
/api/v1/relationship/tree/search
report fact search
/api/v1/report/fact/search
report id
/api/v1/report/{report.id}
report id delete
/api/v1/report/{report.id}/delete
report id fact
/api/v1/report/{report.id}/fact/search
report search
/api/v1/report/search
- query(method: str, fields: list | None = None, parameters: Parameters | dict | None = None, limit: dict | None = None, sort: dict | None = None, offset: dict | None = None, as_dataframe: bool = False) dict | DataFrame [source]#
- Parameters:
method (str) – The name of the method to query.
fields (list) – The fields query parameter establishes the details of the data to return for the specific query.
parameters (dict | Parameters) – The parameters for the query.
limit (dict) – A limit restricts the number of results returned by the query. The limit attribute can only be added to an object type and not a property. For example, to limit the number of facts in a query, {“fact”: 10}.
sort (dict) – Any returned value can be sorted in ascending or descending order, using
ASC
orDESC
(i.e. {“report.document-type”: “DESC”}. Multiple sort criteria can be defined and the sort sequence is determined by the order of the items in the dictionary.offset – This attribute enables targeting a return to a specific starting point in a query return sequence (i.e. {“report”: 100}. To work reliably, at least one sorted property should be included in the returned fields.
as_dataframe (bool=False) – Whether to return the results as a DataFrame or json.
- Returns:
dict | DataFrame – The results of the query.