Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ and the [CodeQL Analysis YML](https://github.com/sr-murthy/fsrapiclient/blob/mai

## Versioning and Releases

The [PyPI package](https://pypi.org/project/fsrapiclient/) is currently at version `1.0.0`.
The [PyPI package](https://pypi.org/project/fsrapiclient/) is currently at version `1.1.0`.

There is currently no dedicated pipeline for releases - both [GitHub releases](https://github.com/sr-murthy/fsrapiclient/releases) and [PyPI packages](https://pypi.org/project/fsrapiclient) are published manually, but both have the same version tag.

Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@
[![License: MPL
2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
[![Docs](https://readthedocs.org/projects/financial-services-register-api/badge/?version=latest)](https://financial-services-register-api.readthedocs.io/en/latest/?badge=latest)
<a href="https://trackgit.com">
<img src="https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/m45fbfbm6zgkqmfudv6m" alt="trackgit-views" />
</a>
[![PyPI version](https://img.shields.io/pypi/v/financial-services-register-api?logo=python&color=41bb13)](https://pypi.org/project/financial-services-register-api)
![PyPI Downloads](https://static.pepy.tech/badge/financial-services-register-api)
![PyPI Downloads](https://static.pepy.tech/badge/fsrapiclient)

</div>

# financial-services-register-api

A lightweight Python client library for the UK [Financial Services Register](https://register.fca.org.uk/s/) [RESTful API](https://register.fca.org.uk/Developer/s/).

The [PyPI package](https://pypi.org/project/financial-services-register-api) is currently at version `1.0.0`.
The [PyPI package](https://pypi.org/project/financial-services-register-api) is currently at version `1.1.0`.

> [!NOTE]
> The new package `financial-services-register-api` supersedes the older package `fsrapiclient`, which will no longer be published. Existing versions of the older package may be retracted in the future. Please use the new package.
Expand Down
31 changes: 8 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@
# Publish author(s)
show_authors = True

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# Sphinx extensions: not all of these are used or required, but they are still
# listed here if requirements change.
extensions = ['jupyter_sphinx',
'matplotlib.sphinxext.plot_directive',
'myst_parser',
Expand Down Expand Up @@ -106,10 +105,10 @@
# For more on all available autodoc defaults see
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options
autodoc_default_options = {
'exclude-members': '__call__,__weakref__,__slots__,__match_args__',
'exclude-members': '',
'member-order': 'bysource',
'private-members': True,
'special-members': '__eq__, __init__, __new__'
'private-members': False,
'special-members': '__init__,__new__'
}

# Sphinx autodoc autosummary settings
Expand All @@ -122,24 +121,10 @@
numpydoc_attributes_as_param_list = False
numpydoc_xref_param_type = False

# Intersphinx mappings to reference external documentation domains
intersphinx_mapping = {
'coverage': ('https://coverage.readthedocs.io/en/7.3.1/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'networkx': ('https://networkx.org/documentation/stable/', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'pdm': ('https://pdm-project.org/latest/', None),
'pygraphviz': ('https://pygraphviz.github.io/documentation/stable/', None),
'pytest': ('https://docs.pytest.org/en/7.4.x/', None),
'python': ('https://docs.python.org/3', None),
'requests': ('https://requests.readthedocs.io/en/latest/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
'sympy': ('https://docs.sympy.org/latest/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
# Intersphinx mappings to reference external documentation domains - none required.
intersphinx_mapping = {}

# Add any paths that contain templates here, relative to this directory.
# Static template paths
templates_path = ['_templates']

# The suffix of source filenames.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ financial-services-register-api

A Python client library for the UK `Financial Services Register <https://register.fca.org.uk/s/>`_ `RESTful API <https://register.fca.org.uk/Developer/s/>`_.

The `PyPI package <https://pypi.org/project/financial-services-register-api>`_ is currently at version `1.0.0`.
The `PyPI package <https://pypi.org/project/financial-services-register-api>`_ is currently at version `1.1.0`.

.. note::

The new package `financial-services-register-api` supersedes the older package `fsrapiclient`, which will no longer be published. Existing versions of the older package may be retracted in the future. Please use the new package.

The Financial Services Register (alternatively, FS Register), is a **public** database of all firms, individuals, funds, and other entities, that are either currently, or have been previously, authorised and/or regulated by the UK `Financial Conduct Authority (FCA) <https://www.fca.org.uk>`_ and/or the `Prudential Regulation Authority (PRA) <http://bankofengland.co.uk/pra>`_.
The Financial Services Register (or simply, the Register), is a **public** database of all firms, individuals, funds, and other entities, that are either currently, or have been previously, authorised and/or regulated by the UK `Financial Conduct Authority (FCA) <https://www.fca.org.uk>`_ and/or the `Prudential Regulation Authority (PRA) <http://bankofengland.co.uk/pra>`_.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ and the `CodeQL Analysis YML <https://github.com/sr-murthy/financial-services-re
Versioning and Releases :fas:`upload`
=====================================

The `PyPI package <https://pypi.org/project/financial-services-register-api/>`_ is currently at version ``1.0.0``.
The `PyPI package <https://pypi.org/project/financial-services-register-api/>`_ is currently at version ``1.1.0``.

There is currently no dedicated pipeline for releases - both `GitHub releases <https://github.com/sr-murthy/financial-services-register-api/releases>`_ and `PyPI packages <https://pypi.org/project/financial-services-register-api>`_ are published manually, but both have the same version tag.

Expand Down
6 changes: 3 additions & 3 deletions docs/sources/financial-services-register-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ According to the `API documentation <https://register.fca.org.uk/Developer/s/>`_
Firm Requests
=============

Firms in the FS Register are identified by unique firm reference numbers (FRN). The following table summarises firm-specific API endpoints. For further details consult the `API documentation <https://register.fca.org.uk/Developer/s/>`_.
Firms in the Register are identified by unique firm reference numbers (FRN). The following table summarises firm-specific API endpoints. For further details consult the `API documentation <https://register.fca.org.uk/Developer/s/>`_.

.. list-table::
:align: left
Expand Down Expand Up @@ -121,7 +121,7 @@ For details and examples on calling these endpoints via this library see :ref:`t
Individual Requests
===================

Individuals associated with firms in the FS Register are identified by unique individual reference numbers (IRN). The following table summarises individual-specific API endpoints.
Individuals associated with firms in the Register are identified by unique individual reference numbers (IRN). The following table summarises individual-specific API endpoints.

.. list-table::
:align: left
Expand Down Expand Up @@ -152,7 +152,7 @@ For how to call these endpoints see :ref:`this <usage.individuals>`.
Fund Requests
=============

Funds, also referred to as collective investment schemes (CIS) in the FS Register, are identified by unique product reference numbers (PRN). The following table summarises fund-specific API endpoints.
Funds, also referred to as collective investment schemes (CIS) in the Register, are identified by unique product reference numbers (PRN). The following table summarises fund-specific API endpoints.

.. list-table::
:align: left
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/financial_services_register_api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

.. automodule:: financial_services_register_api.api
:members:
:private-members:
:special-members:
61 changes: 36 additions & 25 deletions docs/sources/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ storing the API username (signup email) and API key. These, and also the API ver
>>> client.api_version
'V0.1'

Almost all public client methods return :py:class:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse` objects, which have four properties specific to the FS Register API:
Almost all public client methods return :py:class:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse` objects, which have four properties specific to the API:

- :py:attr:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse.status` - an FS Register-specific status indicator for the
- :py:attr:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse.status` - an API-specific status indicator for the
request
- :py:attr:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse.message` - an FS Register-specific status message for the
- :py:attr:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse.message` - an API-specific status message for the
request
- :py:attr:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse.data` - the response data
- :py:attr:`~financial_services_register_api.api.FinancialServicesRegisterApiResponse.resultinfo` - pagination information for the response data
Expand Down Expand Up @@ -172,48 +172,41 @@ The client implements a `regulated markets <https://www.handbook.fca.org.uk/hand
Searching for FRNs, IRNs and PRNs
=================================

Generally, firm reference numbers (FRN), individual reference numbers (IRN), and product reference numbers (PRN), may not be known in advance. These can be found via the following client search methods, which return strings if the searches are successful:
Generally, firm reference numbers (FRN), individual reference numbers (IRN), and product reference numbers (PRN), may not be known in advance. These can be found via the following client search methods, which return strings in the case of unique matches, or a JSON arrays of matching records if there are non-unique matches:

- :py:meth:`~financial_services_register_api.api.FinancialServicesRegisterApiClient.search_frn()` - case-insensitive search for FRNs
- :py:meth:`~financial_services_register_api.api.FinancialServicesRegisterApiClient.search_irn()` - case-insensitive search for IRNs
- :py:meth:`~financial_services_register_api.api.FinancialServicesRegisterApiClient.search_prn()` - case-insensitive search for PRNs

All three methods trigger an :py:class:`~financial_services_register_api.exceptions.FinancialServicesRegisterApiResponseException` in case of non-unique, multiple results, or no data.
These methods do not directly raise any exceptions, but may indirectly incur the following exceptions: a :py:class:`~financial_services_register_api.exceptions.FinancialServicesRegisterApiRequestException` in the case of bad searches, or a :py:class:`~financial_services_register_api.exceptions.FinancialServicesRegisterApiResponseException` in the case of non-standard or malformed responses with possibly no data.

FRNs, IRNs, and PRNs are associated with unique firms, individuals, and funds, respectively, in the FS Register, whether current or past. The more precise the name substring the more likely is an exact, unique result. Some examples are given below for each type of search, starting with FRNs:
FRNs, IRNs, and PRNs are associated with unique firms, individuals, and funds, respectively, in the Register, whether current or past. The more precise the name substring the more likely is an exact, unique result. Some examples are given below for each type of search, starting with FRNs:

.. code:: python

>>> client.search_frn('hiscox insurance company limited')
'113849'

Imprecise names in the search can produce multiple records, and will trigger an :py:class:`~financial_services_register_api.exceptions.FinancialServicesRegisterApiResponseException` indicating the problem, e.g.:
Imprecise or inadequality specified names in the search can produce non-unique matches, in which all matching records are returned in a JSON array, for example:

.. code:: python

>>> client.search_frn('hiscox')
Traceback (most recent call last):
...
financial_services_register_api.api.FinancialServicesRegisterApiResponseException: Multiple firms returned. Firm name needs to be more precise. If you are unsure of the results please use the common search endpoint

In this case the exception was generated because a common search for ``'hiscox'`` shows that there are multiple firms entries containing this name fragment:

.. code:: python

>>> client.common_search(urlencode({'q': 'hiscox', 'type': 'firm'})).data
[{'URL': 'https://register.fca.org.uk/services/V0.1/Firm/812274',
'Status': 'No longer authorised',
'Reference Number': '812274',
'Type of business or Individual': 'Firm',
'Name': 'HISCOX ASSURE'},
...
...
...
{'URL': 'https://register.fca.org.uk/services/V0.1/Firm/732312',
'Status': 'Authorised',
'Reference Number': '732312',
'Type of business or Individual': 'Firm',
'Name': 'Hiscox MGA Ltd (Postcode: EC2N 4BQ)'}]
'Name': 'Hiscox MGA Ltd (Postcode: EC2N 4BQ)'}
]

Searches for non-existent firms will trigger an :py:class:`~financial_services_register_api.exceptions.FinancialServicesRegisterApiResponseException` indicating that no data found in the FS Register for the given name:
Searches for non-existent firms will trigger an :py:class:`~financial_services_register_api.exceptions.FinancialServicesRegisterApiRequestException` indicating that no data found in the Register for the given name:

.. code:: python

Expand All @@ -230,9 +223,18 @@ A few examples are given below of IRN searches.
'MXC29012'
#
>>> client.search_irn('mark c')
Traceback (most recent call last):
...
financial_services_register_api.api.FinancialServicesRegisterApiResponseException: Multiple individuals returned. The individual name needs to be more precise. If you are unsure of the results please use the common search endpoint
[{'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/MWC01033',
'Status': 'Active',
'Reference Number': 'MWC01033',
'Type of business or Individual': 'Individual',
'Name': 'Mark William Cowell'},
...
...
{'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/RMG01106',
'Status': 'Active',
'Reference Number': 'RMG01106',
'Type of business or Individual': 'Individual',
'Name': 'Richard Mark Greenfield'}]
#
>>> client.search_irn('a nonexistent individual')
Traceback (most recent call last):
Expand All @@ -247,9 +249,18 @@ A few examples are given below of PRN searches.
'635641'
#
>>> client.search_prn('jupiter asia')
Traceback (most recent call last):
...
financial_services_register_api.api.FinancialServicesRegisterApiResponseException: Multiple funds returned. The fund name needs to be more precise. If you are unsure of the results please use the common search endpoint
[{'URL': 'https://register.fca.org.uk/services/V0.1/CIS/718428',
'Status': 'Authorised',
'Reference Number': '718428',
'Type of business or Individual': 'Collective investment scheme',
'Name': 'Jupiter Asian Income Fund'},
...
...
{'URL': 'https://register.fca.org.uk/services/V0.1/CIS/140620',
'Status': 'Terminated',
'Reference Number': '140620',
'Type of business or Individual': 'Collective investment scheme',
'Name': 'JUPITER ASIAN FUND'}]
#
>>> client.search_prn('a nonexistent fund')
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/financial_services_register_api/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "1.1.0"
Loading
Loading