公司之家的动态api包装

companies-house的Python项目详细描述


公司内部python api

只需创建一个api客户机作为companieshouseapi的实例:

from companies_house.api import CompaniesHouseAPI
ch = CompaniesHouseAPI(api_key)

这将允许您访问在api中注册的所有函数。供全面参考,包括可用的 其他参数(可以作为kwargs传递),请 请参阅the official API documentation

python包装器还为每个函数提供了以下功能:

  • flatten:展平返回的dict(以允许在平面文件、熊猫等中使用)
  • follow_links:api资源由一个links属性链接。如果将follow_links设置为true,则 自动跟踪并合并到主对象中,形成一个更深、更全面的对象。小心使用 因为目前没有递归检查!
help(CompaniesHouseAPI)
Help on class CompaniesHouseAPI in module __main__:

class CompaniesHouseAPI(CompaniesHouseAPIBase)
 |  Method resolution order:
 |      CompaniesHouseAPI
 |      CompaniesHouseAPIBase
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  get_company(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the basic company information
 |      :param company_number:
 |  
 |  get_company_charges(self, company_number:str, charge_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get a single charge for a company
 |      :param company_number:
 |      :param charge_id:
 |  
 |  get_company_exemptions(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the company exemptions information.
 |      :param company_number:
 |  
 |  get_company_filing_history(self, company_number:str, transaction_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the filing history of the company
 |      :param company_number:
 |      :param transaction_id:
 |  
 |  get_company_insolvency(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get company insolvency information
 |      :param company_number:
 |  
 |  get_company_persons_with_significant_control_corporate_entity(self, company_number:str, psc_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the corporate entity with significant control
 |      :param company_number:
 |      :param psc_id:
 |  
 |  get_company_persons_with_significant_control_individual(self, company_number:str, psc_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the individual person with significant control
 |      :param company_number:
 |      :param psc_id:
 |  
 |  get_company_persons_with_significant_control_legal_person(self, company_number:str, psc_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the legal person with significant control
 |      :param company_number:
 |      :param psc_id:
 |  
 |  get_company_persons_with_significant_control_statements(self, company_number:str, statement_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the person with significant control statement
 |      :param company_number:
 |      :param statement_id:
 |  
 |  get_company_persons_with_significant_control_super_secure(self, company_number:str, super_secure_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the super secure person with significant control
 |      :param company_number:
 |      :param super_secure_id:
 |  
 |  get_company_registered_office_address(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the current address of a company
 |      :param company_number:
 |  
 |  get_company_registers(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the company registers information
 |      :param company_number:
 |  
 |  get_disqualified_officers_corporate(self, officer_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get a corporate officer's disqualifications
 |      :param officer_id:
 |  
 |  get_disqualified_officers_natural(self, officer_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get a natural officer's disqualifications
 |      :param officer_id:
 |  
 |  list_company_charges(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get a list of charges for a company
 |      :param company_number:
 |  
 |  list_company_filing_history(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get the filing history of the company
 |      :param company_number:
 |  
 |  list_company_officers(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      List the company officers
 |      :param company_number:
 |  
 |  list_company_persons_with_significant_control(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      List the company persons with significant control
 |      :param company_number:
 |  
 |  list_company_persons_with_significant_control_statements(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      List the company persons with significant control statements
 |      :param company_number:
 |  
 |  list_company_uk_establishments(self, company_number:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Get a list of UK Establishment companies
 |      :param company_number:
 |  
 |  list_officers_appointments(self, officer_id:str, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      List the officer appointments
 |      :param officer_id:
 |  
 |  search(self, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Search Companies House
 |  
 |  search_companies(self, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Search companies
 |  
 |  search_disqualified_officers(self, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Search disqualified officers
 |  
 |  search_officers(self, flatten:bool=False, follow_links:bool=False, **kwargs) -> Union[dict, NoneType]
 |      Search company officers
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from CompaniesHouseAPIBase:
 |  
 |  __init__(self, api_key:str) -> None
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  get(self, query:str, flatten:bool=False, follow_links:bool=False) -> Union[dict, NoneType]
 |      Run a GET query against the Companies' House API
 |      :param query: the query, e.g. "company/09117429"
 |      :param flatten: flatten the result dictionary
 |      :return: the result as dict
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from CompaniesHouseAPIBase:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from CompaniesHouseAPIBase:
 |  
 |  __annotations__ = {'_api_key': <class 'str'>}


当API改变时, 运行update.py重新下载api定义。 运行api时,此文档将自动更新。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
为什么在Set/List/Map中包装元素的方法名称中包含“singleton”?(java.util.Collections)   java矩形类和containsPoint方法   java为什么log4j2中的monitorInterval没有重新加载记录器   java为什么强制转换为int会给我8而不是0?   java在处理JSP页面[/views/index.JSP]时发生异常   java-Android清洁体系结构双重实现   未找到R和H2O初始化Java路径中的错误   java开发和配置视图和控制器   java Spring JSTL日期格式转换为DDMMYYYY   java机制不工作?   java上下文初始化失败。Spring错误NoSuchMethodException   从Java读取COBOL数据结构的数据结构   java对话框不显示安卓   Java中HashMap的解析   velocity中的java全局上下文   尝试模拟静态(不兼容的依赖项)时出现java NoClassDefFoundError或NoSuchMethodError   java失败[INSTALL_FAILED_UID_CHANGED]发生在应用程序调试时,即使在工厂重置后也是如此   java在序列化为JSON时忽略子属性   JComboBox的java实例