公司之家的动态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第三方库


热门话题
使用apache camel java DSL从activemq接收消息   java Gson反序列化跳过一个引号   java在自定义控制台中显示多行JLabel?   java Multiple TouchImageView在调用一个的setImageDrawable时重置另一个   在Progress 4gl中进行Java调用   java将i18n应用于支持Hibernate的SpringWebAPI   java WeakReference对象是否也与被引用对象一起被垃圾收集?   java如何始终使用HttpServletRequestWrapper?   java映射:为Integer和Double类型定义一个方法,而不是String   用于检测和捕获SocketException的多线程Java   java创建网络化虚拟硬盘/文件系统   java如何在JAXWS出现异常时发送自定义响应消息而不是错误消息?   对象的arraylist上的java深度复制   jdbc java CallableStatement打印过程中的所有参数   发生StackOverFlow错误时的java标识点   java log4j:执行sql时出错。appender中的mysql insert存在问题   java高CPU,可能是由于上下文切换?   java Hibernate:保存前刷新时违反约束   java原子引用阵列的用途是什么?