diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 465fa6a..2284e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,6 +107,7 @@ jobs: pdm run -v lint pdm install -v -dGtest --no-self --no-isolation pdm run -v pytest + sleep 10 pdm run -v doctests - name: Upload coverage reports to Codecov diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8a9ce9..4f8c4e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,8 @@ Contributors and contributions are welcome. Please read these guidelines first. The project homepage is on [GitHub](https://github.com/sr-murthy/fsrapiclient). -Contributors can open pull requests from a fork targeting the parent [main branch](https://github.com/sr-murthy/fsrapiclient/tree/main). But it may be a good first step to create an [issue](https://github.com/sr-murthy/fsrapiclient/issues) or open a -[discussion topic](https://github.com/sr-murthy/fsrapiclient/discussions). +Contributors can open pull requests from a fork targeting the parent [main branch](https://github.com/sr-murthy/fsrapiclient/tree/main). But it may be a good first step to create an +[issue](https://github.com/sr-murthy/fsrapiclient/issues) or open a [discussion topic](https://github.com/sr-murthy/fsrapiclient/discussions). A simple Git workflow, using a feature and/or fix branch created off the `main` branch of your fork, is recommended. @@ -42,7 +42,7 @@ git clone git+ssh://git@github.com//fsrapiclient You can create additional remotes for the parent project to enable easier syncing, or you can simply create PRs directly against the parent project. -## Dependencies & PDM `cubes` +## Dependencies & PDM The package only depends on the [requests](https://requests.readthedocs.io/en/latest/) library. @@ -92,12 +92,11 @@ pdm export -v -f requirements --dev -o requirements.txt For more information on PDM lockfiles and installing requirements see the [PDM documentation](https://pdm-project.org/latest/). -## Tests `microscope` +## Tests Tests are defined in the `tests` folder, and should be run with [pytest](https://pytest-cov.readthedocs.io/en/latest/). -For convenience different types of test targets are defined in the[Makefile](https://github.com/sr-murthy/fsrapiclient/blob/main/Makefile): lint` for Ruff linting, `doctests` for running [doctests](https://docs.python.org/3/library/doctest.html) and -`unittests` for running unittests and measuring coverage, using `pytest` and the `pytest-cov` plugin: +For convenience different types of test targets are defined in the [Makefile](https://github.com/sr-murthy/fsrapiclient/blob/main/Makefile): `lint` for Ruff linting, `doctests` for running [doctests](https://docs.python.org/3/library/doctest.html) and `unittests` for running unittests and measuring coverage, using `pytest` and the [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) plugin: ``` shell make lint @@ -107,8 +106,7 @@ make doctests Linting warnings should be addressed first, and any changes staged and committed. -Unit tests can be run all at once using `make unittests` or individually using `pytest`, e.g. running the test class for the -`~fsrapiclient.api.FsrApiClient` class: +Unit tests can be run all at once using `make unittests` or individually using `pytest`, e.g. running the test class for the `~fsrapiclient.api.FsrApiClient` class: ``` shell python -m pytest -sv tests/units/test_api.py::TestFsrApiClient @@ -120,19 +118,20 @@ The doctests serve as acceptance tests, and are best run after the unit tests. T python -m doctest -v src/fsrapiclient/api.py ``` -## Documentation `book` +## Documentation -Detailed documentation can be found [here](https://fsrapiclient.readthedocs.io). +This documentation site is written, built and deployed using [reStructuredText](https://docutils.sourceforge.io/rst.html), +[Sphinx](https://www.sphinx-doc.org/en/master/), and [Read the Docs (RTD)](https://readthedocs.org/) respectively. The Sphinx theme used is [Furo](https://github.com/pradyunsg/furo). -## CI `circle-play` +## CI The CI pipelines are defined in the [CI YML](https://github.com/sr-murthy/fsrapiclient/blob/main/.github/workflows/ci.yml) and the [CodeQL Analysis YML](https://github.com/sr-murthy/fsrapiclient/blob/main/.github/workflows/codeql-analysis.yml). Currently, pipelines for all branches include a tests stage that includes Ruff linting, unit tests, Python doctests, and in that order. -## Versioning and Releases `upload` +## Versioning and Releases -The [PyPI package](https://pypi.org/project/fsrapiclient/) is currently at version `0.2.1`. +The [PyPI package](https://pypi.org/project/fsrapiclient/) is currently at version `0.2.2`. 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. -Pipelines for releases will be added as part of a future release. \ No newline at end of file +A separate release pipeline may be added as part of a future release. diff --git a/README.md b/README.md index 1ae6548..cfd8a19 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ 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/fsrapiclient) is currently at version `0.2.2`. + The Financial Services Register, or 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). > [!NOTE] diff --git a/docs/index.rst b/docs/index.rst index 275b6b9..8893b66 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,10 +1,16 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + ============ fsrapiclient ============ -A lightweight Python client library and package for the UK `Financial Services Register (FS Register) `_ `RESTful API `_. +A lightweight Python client library for the UK `Financial Services Register `_ `RESTful API `_. + +The `PyPI package `_ is currently at version `0.2.1`. -The 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) `_ and/or the `Prudential Regulation Authority (PRA) `_. +The Financial Services Register, or 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) `_ and/or the `Prudential Regulation Authority (PRA) `_. .. note:: diff --git a/docs/sources/api-reference.rst b/docs/sources/api-reference.rst index 277263b..89265c5 100644 --- a/docs/sources/api-reference.rst +++ b/docs/sources/api-reference.rst @@ -1,3 +1,7 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + :html_theme.sidebar_secondary.remove: ============= diff --git a/docs/sources/contributing.rst b/docs/sources/contributing.rst index b8a4ede..ca8df53 100644 --- a/docs/sources/contributing.rst +++ b/docs/sources/contributing.rst @@ -1,3 +1,7 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + ============ Contributing ============ @@ -112,7 +116,7 @@ Tests :fas:`microscope` Tests are defined in the ``tests`` folder, and should be run with `pytest `_. For convenience different types of test targets are defined in the `Makefile `_: ``lint`` for Ruff linting, ``doctests`` for running `doctests `_ and -``unittests`` for running unittests and measuring coverage, using :program:`pytest` and the ``pytest-cov`` plugin: +``unittests`` for running unittests and measuring coverage, using :program:`pytest` and the `pytest-cov `_ plugin: .. code:: shell @@ -139,7 +143,7 @@ The doctests serve as acceptance tests, and are best run after the unit tests. T Documentation :fas:`book` ========================= -Detailed documentation can be found `here `_. +This documentation site is written, built and deployed using `reStructuredText `_, `Sphinx `_, and `Read the Docs (RTD) `_ respectively. The Sphinx theme used is `Furo `_. .. _contributing.ci: @@ -154,8 +158,8 @@ and the `CodeQL Analysis YML `_ is currently at version ``0.2.1``. +The `PyPI package `_ is currently at version ``0.2.2``. There is currently no dedicated pipeline for releases - both `GitHub releases `_ and `PyPI packages `_ are published manually, but both have the same version tag. -Pipelines for releases will be added as part of a future release. +A separate release pipeline may be added as part of a future release. diff --git a/docs/sources/fs-register-api.rst b/docs/sources/fs-register-api.rst index a506ead..9cefee6 100644 --- a/docs/sources/fs-register-api.rst +++ b/docs/sources/fs-register-api.rst @@ -1,8 +1,12 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + ================================= Understanding the FS Register API ================================= -The package functionality reflects the current version (``V0.1``) of the FS Register API. There is `API documentation `__ but access requires `registration `_. +The package functionality reflects the current version (``V0.1``) of the `FS Register `_ `API `_. The API is documented but access requires registration. The base URL for all API requests is: @@ -17,9 +21,9 @@ Resources and Endpoints There are three main categories of resource about which information can be requested from the register via API endpoints: -- **firms** - authorised and/or regulated firms (either current or past), or providing regulated products or services. These are described in more detail :ref:`here `. -- **individuals** - individuals associated with the type of firms described above, either current or past. These are described in more detail :ref:`here `. -- **funds** - investment funds or collective investment schemes (CIS),including subfunds of funds. These are described in more detail :ref:`here `. +- **firms** - authorised and/or regulated firms (either current or past) involved with the provision of regulated products and/or services. Firms in the register have unique **firm reference numbers (FRN)** and their endpoints usually take these as one of the parameters. They are described in more detail :ref:`here `. +- **individuals** - individuals associated with the type of firms described above, either current or past. Individuals in the register have unique **individual reference numbers (IRN)** and their endpoints usually take these as one of the parameters. They are described in more detail :ref:`here `. +- **funds** - investment funds or collective investment schemes (CIS),including subfunds of funds. Funds in the register have unique **product reference numbers (PRN)** and their endpoints usually take these as one of the parameters. They are described in more detail :ref:`here `. There is also a **common search** API endpoint that allows a search for any of these resources by a name substring and a corresponding type specification (firm, individual, or fund). This is described in more detail :ref:`here `. @@ -41,7 +45,7 @@ The FS Register API is read-only - all requests must use ``GET``, and include he Rate Limiting ============= -According to the `API documentation `__ **rate limiting** is applied to set a **maximum of 50 requests per 10 seconds per user**, and **breaches** lead to `(HTTP 429) errors `__ and **requests being blocked for 1 minute**. +According to the `API documentation `_ **rate limiting** is applied to set a **maximum of 50 requests per 10 seconds per user**, and **breaches** lead to `(HTTP 429) errors `__ and **requests being blocked for 1 minute**. .. warning:: @@ -52,50 +56,66 @@ According to the `API documentation `_ Firm Requests ============= -Firms are identified by unique firm reference numbers (FRN). The following table summarises firm-specific API endpoints. - -+-----------------------------------+------------------------+---------+ -| API endpoint | Parameters | Request | -| | | Method | -+===================================+========================+=========+ -| ``/V0.1/Firm/{FRN}`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Address`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/AR`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/CF`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1 | FRN (str) | GET | -| /Firm/{FRN}/DisciplinaryHistory`` | | | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Exclusions`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Individuals`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Names`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Passports`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN} | FRN (str), Country | GET | -| /Passports/{Country}/Permission`` | (str) | | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Permissions`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Regulators`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Requirements`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Requir | FRN (str), Requirement | GET | -| ements/{ReqRef}/InvestmentTypes`` | Reference (str) | | -+-----------------------------------+------------------------+---------+ -| ``/V0.1/Firm/{FRN}/Waiver`` | FRN (str) | GET | -+-----------------------------------+------------------------+---------+ +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 `_. + +.. list-table:: + :align: left + :widths: 75 15 30 + :header-rows: 1 + + * - API Endpoint + - Request Method + - Resource Parameters + * - ``/V0.1/Firm/{FRN}`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Address`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/AR`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/CF`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/DisciplinaryHistory`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Exclusions`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Individuals`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Names`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Passports`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Passports/{Country}/Permission`` + - GET + - FRN (str), Country (str) + * - ``/V0.1/Firm/{FRN}/Permissions`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Regulators`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Requirements`` + - GET + - FRN (str) + * - ``/V0.1/Firm/{FRN}/Requirements/{Requirement Reference}/InvestmentTypes`` + - GET + - FRN (str), Requirement Reference (str) + .. note:: The abbreviations “CF” and “AR” refer to “controlled functions” and “appointed representatives” respectively. +For details and examples on calling these endpoints via this library see :ref:`this `. + .. _fs-register-api.individual-requests: Individual Requests @@ -103,20 +123,30 @@ 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. -+-------------------------------------------------+------------+----------------+ -| API endpoint | Parameters | Request Method | -+=================================================+============+================+ -| ``/V0.1/Individuals/{IRN}`` | IRN (str) | GET | -+-------------------------------------------------+------------+----------------+ -| ``/V0.1/Individuals/{IRN}/CF`` | IRN (str) | GET | -+-------------------------------------------------+------------+----------------+ -| ``/V0.1/Individuals/{IRN}/DisciplinaryHistory`` | IRN (str) | GET | -+-------------------------------------------------+------------+----------------+ +.. list-table:: + :align: left + :widths: 75 15 30 + :header-rows: 1 + + * - API Endpoint + - Request Method + - Resource Parameters + * - ``/V0.1/Individuals/{IRN}`` + - GET + - IRN (str) + * - ``/V0.1/Individuals/{IRN}/CF`` + - GET + - IRN (str) + * - ``/V0.1/Individuals/{IRN}/DisciplinaryHistory`` + - GET + - IRN (str) .. note:: The abbreviation “CF” refers to “controlled functions”. +For how to call these endpoints see :ref:`this `. + .. _fs-register-api.fund-requests: Fund Requests @@ -124,26 +154,52 @@ 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. -=========================== ========== ============== -API endpoint Parameters Request Method -=========================== ========== ============== -``/V0.1/CIS/{PRN}`` PRN (str) GET -``/V0.1/CIS/{PRN}/Names`` PRN (str) GET -``/V0.1/CIS/{PRN}/Subfund`` PRN (str) GET -=========================== ========== ============== +.. list-table:: + :align: left + :widths: 75 15 30 + :header-rows: 1 + + * - API Endpoint + - Request Method + - Resource Parameters + * - ``/V0.1/CIS/{PRN}`` + - GET + - PRN (str) + * - ``/V0.1/CIS/{PRN}/Names`` + - GET + - PRN (str) + * - ``/V0.1/CIS/{PRN}/Subfund`` + - GET + - PRN (str) + +For details and examples of calling these endpoints via this library see :ref:`this `. .. _fs-register-api.common-search-requests: Common Search Requests ====================== -The common search API endpoint has the following request structure: +The common search API endpoint is a parameterised search endpoint which is summarised below. + +.. list-table:: + :align: left + :widths: 75 15 30 + :header-rows: 1 + + * - API Endpoint + - Request Method + - Search Parameters + * - ``/V0.1/CommonSearch`` + - GET + - ``q`` (resource name), ``type`` (resource type - ``'firm'``, ``'individual'``, or ``'fund'``) + +Requests should be of the form: .. code:: http - GET https://register.fca.org.uk/services/V0.1/CommonSearch?q=query&type=type HTTP/1.1 + GET https://register.fca.org.uk/services/V0.1/CommonSearch?q=resource_name&type=resource_type HTTP/1.1 -where ``query`` is a value of the parameter ``'q'`` and should be substring of the name of a firm, individual or fund, of interest, and ``type`` is the value of the parameter ``'type'`` and should be one of ``'firm'``, ``'individual'``, ``'fund'``. For example, here are a few valid common search requests. +For example, here are a few valid common search requests. * Common search for Barclays Bank Plc (FRN #122702): @@ -186,3 +242,5 @@ where ``query`` is a value of the parameter ``'q'`` and should be substring of t .. code:: http GET https://register.fca.org.uk/services/V0.1/CommonSearch?q=abrdn+multi-asset+fund&type=fund HTTP/1.1 + +For details and examples on calling this endpoint via this library see :ref:`this `. diff --git a/docs/sources/fsrapiclient/api.rst b/docs/sources/fsrapiclient/api.rst index 722605c..63c8af8 100644 --- a/docs/sources/fsrapiclient/api.rst +++ b/docs/sources/fsrapiclient/api.rst @@ -1,3 +1,7 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + ==================== ``fsrapiclient.api`` ==================== diff --git a/docs/sources/fsrapiclient/constants.rst b/docs/sources/fsrapiclient/constants.rst index 0e38af8..4529de4 100644 --- a/docs/sources/fsrapiclient/constants.rst +++ b/docs/sources/fsrapiclient/constants.rst @@ -1,3 +1,7 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + ========================== ``fsrapiclient.constants`` ========================== diff --git a/docs/sources/fsrapiclient/exceptions.rst b/docs/sources/fsrapiclient/exceptions.rst index 7922f2f..0bd12f1 100644 --- a/docs/sources/fsrapiclient/exceptions.rst +++ b/docs/sources/fsrapiclient/exceptions.rst @@ -1,3 +1,7 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + =========================== ``fsrapiclient.exceptions`` =========================== diff --git a/docs/sources/getting-started.rst b/docs/sources/getting-started.rst index 46df6bf..d791382 100644 --- a/docs/sources/getting-started.rst +++ b/docs/sources/getting-started.rst @@ -1,8 +1,12 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + =============== Getting Started =============== -This is a `PyPI package `_, and the source is on `GitHub `_. The package is tested on Python 3.12 & 3.13 (on Linux, Windows and macOS), but should also install fine on earlier Python versions. +This is a `PyPI package `_, and the source is on `GitHub `_. The package is tested on Python 3.12 & 3.13 (on Linux, Windows and macOS), but should also install fine on earlier Python versions from Python 3.8 and upwards. .. _getting-started.installation: diff --git a/docs/sources/usage.rst b/docs/sources/usage.rst index f7d569e..910fc1e 100644 --- a/docs/sources/usage.rst +++ b/docs/sources/usage.rst @@ -1,3 +1,7 @@ +.. meta:: + + :google-site-verification: 3F2Jbz15v4TUv5j0vDJAA-mSyHmYIJq0okBoro3-WMY + ===== Usage ===== @@ -7,7 +11,7 @@ The API client class is :py:class:`~fsrapiclient.api.FsrApiClient`. Import it, a .. code:: python >>> from fsrapiclient.api import FsrApiClient - >>> client = FsrApiClient(, ) + >>> client = FsrApiClient('', '') >>> client @@ -55,19 +59,24 @@ As :py:class:`~fsrapiclient.api.FsrApiResponse` is a subclass of :py:class:`requ Common Search ============= -The common search endpoint can be used via the :py:meth:`~fsrapiclient.api.FsrApiClient.common_search()` method to make generic queries for firms, individuals, or funds. It requires an URL-encoded string of the form: +The common search endpoint can be used via the :py:meth:`~fsrapiclient.api.FsrApiClient.common_search()` method to make generic queries for firms, individuals, or funds. It requires an URL-encoded parameterised string of the form: .. code:: bash - q=&type= + q=&type= -Use :py:func:`urllib.parse.urlencode` to do the URL-encoding. Some examples are given below. +where ``q`` is a parameter whose value should be the name (or name substring) of a resource (firm, individual, or fund), and ``type`` is a parameter whose value should be one of ``'firm'``, ``'individual'``, ``'fund'``. + +Use :py:func:`urllib.parse.urlencode` to do the URL-encoding. Some examples of common search are given below for Barclays Bank Plc. .. code:: python from urllib.parse import urlencode # - >>> client.common_search(urlencode({'q': 'barclays bank', 'type': 'firm'})).fsr_data + >>> res = client.common_search(urlencode({'q': 'barclays bank', 'type': 'firm'})) + >>> res + + >>> res.fsr_data [{'URL': 'https://register.fca.org.uk/services/V0.1/Firm/759676', 'Status': 'Authorised', 'Reference Number': '759676', @@ -79,13 +88,30 @@ Use :py:func:`urllib.parse.urlencode` to do the URL-encoding. Some examples are 'Reference Number': '122702', 'Type of business or Individual': 'Firm', 'Name': 'Barclays Bank Plc (Postcode: E14 5HP)'}] + >>> res.fsr_status + 'FSR-API-04-01-00' + >>> res.fsr_message + 'Ok. Search successful' + >>> res.fsr_resultinfo + {'page': '1', 'per_page': '20', 'total_count': '9'} + +Here are some further examples of common search for firms, individuals and funds. + +.. code:: python + + >>> client.common_search(urlencode({'q': 'revolut bank', 'type': 'firm'})).fsr_data + [{'URL': 'https://register.fca.org.uk/services/V0.1/Firm/833790', + 'Status': 'No longer authorised', + 'Reference Number': '833790', + 'Type of business or Individual': 'Firm', + 'Name': 'Revolut Bank UAB'}] # >>> client.common_search(urlencode({'q': 'mark carney', 'type': 'individual'})).fsr_data [{'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/MXC29012', 'Status': 'Active', 'Reference Number': 'MXC29012', 'Type of business or Individual': 'Individual', - 'Name': 'Mark Carney'}] + 'Name': 'Mark Carney'}] # >>> client.common_search(urlencode({'q': 'jupiter asia pacific income', 'type': 'fund'})).fsr_data [{'URL': 'https://register.fca.org.uk/services/V0.1/CIS/635641', @@ -94,7 +120,7 @@ Use :py:func:`urllib.parse.urlencode` to do the URL-encoding. Some examples are 'Type of business or Individual': 'Collective investment scheme', 'Name': 'Jupiter Asia Pacific Income Fund (IRL)'}] -The response data as stored in the :py:attr:`~fsrapiclient.api.FsrApiResponse.fsr_data` property might be non-empty or empty depending on whether the combination of query and entity type is valid, e.g.: +The response data as stored in the :py:attr:`~fsrapiclient.api.FsrApiResponse.fsr_data` property might be non-empty or empty depending on whether the combination of query and resource type is valid, e.g.: .. code:: python @@ -106,12 +132,14 @@ The response data as stored in the :py:attr:`~fsrapiclient.api.FsrApiResponse.fs 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 returns 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 if the searches are successful: - :py:meth:`~fsrapiclient.api.FsrApiClient.search_frn()` - case-insensitive search for FRNs - :py:meth:`~fsrapiclient.api.FsrApiClient.search_irn()` - case-insensitive search for IRNs - :py:meth:`~fsrapiclient.api.FsrApiClient.search_prn()` - case-insensitive search for PRNs +All three methods trigger an :py:class:`~fsrapiclient.exceptions.FsrApiResponseException` in case of non-unique, multiple results, or 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: .. code:: python @@ -119,7 +147,7 @@ FRNs, IRNs, and PRNs are associated with unique firms, individuals, and funds, r >>> client.search_frn('hiscox insurance company limited') '113849' -Imprecise names in the search can produce multiple records, and will trigger an :py:class:`~fsrapiclient.exceptions.FsrResponseException` indicating the problem, e.g.: +Imprecise names in the search can produce multiple records, and will trigger an :py:class:`~fsrapiclient.exceptions.FsrApiResponseException` indicating the problem, e.g.: .. code:: python @@ -128,7 +156,7 @@ Imprecise names in the search can produce multiple records, and will trigger an ... fsrapiclient.api.FsrApiResponseException: 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 firm entries containing this name fragment: +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 @@ -193,7 +221,7 @@ A few examples are given below of PRN searches. Firms ===== -Client methods for firm-specific requests, the associated API endpoints, and parameters and returns are summarised in the table below. +Client methods for firm-specific requests, the associated API endpoints, resource parameters, and returns are summarised in the table below. .. list-table:: :align: left @@ -203,269 +231,345 @@ Client methods for firm-specific requests, the associated API endpoints, and par * - Method - API Endpoint - Request Method - - Parameters + - Resource Parameters - Return * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm()` - ``/V0.1/Firm/{FRN}`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_addresses()` - ``/V0.1/Firm/{FRN}/Address`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_appointed_representatives()` - ``/V0.1/Firm/{FRN}/AR`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_controlled_functions()` - ``/V0.1/Firm/{FRN}/CF`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_disciplinary_history()` - ``/V0.1/Firm/{FRN}/DisciplinaryHistory`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_exclusions()` - ``/V0.1/Firm/{FRN}/Exclusions`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_individuals()` - ``/V0.1/Firm/{FRN}/Individuals`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_names()` - ``/V0.1/Firm/{FRN}/Names`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_passports()` - ``/V0.1/Firm/{FRN}/Passports`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_passport_permissions()` - ``/V0.1/Firm/{FRN}/Passports/{Country}/Permission`` - - FRN (str), Country (str) - ``GET`` + - FRN (str), Country (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_permissions()` - ``/V0.1/Firm/{FRN}/Permissions`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_regulators()` - ``/V0.1/Firm/{FRN}/Regulators`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_requirements()` - ``/V0.1/Firm/{FRN}/Requirements`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_requirement_investment_types()` - ``/V0.1/Firm/{FRN}/Requirements/{ReqRef}/InvestmentTypes`` - - FRN (str), Requirement Reference (str) - ``GET`` + - FRN (str), Requirement Reference (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_firm_waivers()` - ``/V0.1/Firm/{FRN}/Waiver`` - - FRN (str) - ``GET`` + - FRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` Examples are given below for each request type for Barclays Bank Plc (FRN #122702). -.. code:: python +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - firm details + + .. code:: python + + >>> client.get_firm('122702').fsr_data + [{'Name': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Names', + 'Individuals': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Individuals', + 'Requirements': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Requirements', + 'Permission': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Permissions', + 'Passport': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Passports', + 'Regulators': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Regulators', + 'Appointed Representative': 'https://register.fca.org.uk/services/V0.1/Firm/122702/AR', + 'Address': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Address', + 'Waivers': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Waivers', + 'Exclusions': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Exclusions', + 'DisciplinaryHistory': 'https://register.fca.org.uk/services/V0.1/Firm/122702/DisciplinaryHistory', + 'System Timestamp': '30/11/2024 20:34', + 'Exceptional Info Details': [], + 'Status Effective Date': '01/12/2001', + 'E-Money Agent Status': '', + 'PSD / EMD Effective Date': '', + 'Client Money Permission': 'Control but not hold client money', + 'Sub Status Effective from': '', + 'Sub-Status': '', + 'Mutual Society Number': '', + 'Companies House Number': '01026167', + 'MLRs Status Effective Date': '', + 'MLRs Status': '', + 'E-Money Agent Effective Date': '', + 'PSD Agent Effective date': '', + 'PSD Agent Status': '', + 'PSD / EMD Status': '', + 'Status': 'Authorised', + 'Business Type': 'Regulated', + 'Organisation Name': 'Barclays Bank Plc', + 'FRN': '122702'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - addresses + + .. code:: python + + >>> client.get_firm_addresses('122702').fsr_data + [{'URL': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Address?Type=PPOB', + 'Website Address': 'www.barclays.com', + 'Phone Number': '+442071161000', + 'Country': 'UNITED KINGDOM', + 'Postcode': 'E14 5HP', + 'County': '', + 'Town': 'London', + 'Address Line 4': '', + 'Address LIne 3': '', + 'Address Line 2': '', + 'Address Line 1': 'One Churchill Place', + 'Address Type': 'Principal Place of Business'}, + {'URL': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Address?Type=Complaint', + 'Website Address': '', + 'Phone Number': '+4403301595858', + 'Country': 'UNITED KINGDOM', + 'Postcode': 'NN4 7SG', + 'County': 'Northamptonshire', + 'Town': 'Northampton', + 'Address Line 4': '', + 'Address LIne 3': '', + 'Address Line 2': '', + 'Address Line 1': '1234 Pavilion Drive', + 'Individual': '', + 'Address Type': 'Complaints Contact'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - controlled functions + + .. code:: python + + >>> client.get_firm_controlled_functions('122702').fsr_data + [{'Current': {'(6707)SMF4 Chief Risk': {'Suspension / Restriction End Date': '', + 'Suspension / Restriction Start Date': '', + 'Restriction': '', + 'Effective Date': '16/02/2023', + 'Individual Name': 'Bevan Cowie', + 'Name': 'SMF4 Chief Risk', + 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/BXC00280'}, + ... + '(22338)[PRA CF] Significant risk taker or Material risk taker': {'End Date': '30/06/2020', + 'Suspension / Restriction End Date': '', + 'Suspension / Restriction Start Date': '', + 'Restriction': '', + 'Effective Date': '07/03/2016', + 'Individual Name': 'Lynne Atkin', + 'Name': '[PRA CF] Significant risk taker or Material risk taker', + 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/LAA01049'}}}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - disciplinary history + + .. code:: python + + >>> client.get_firm_disciplinary_history('122702').fsr_data + [{'TypeofDescription': "On 19 August 2009, the FSA imposed a penalty on Barclays Bank plc and Barclays Capital Securities Limited (Barclays) of £2,450,000 (discounted from £3,500,000 for early settlement) in respect of breaches of SUP 17 of the FSA Handbook and breaches of Principles 2 and 3 of the FSA's Principles for Businesses which occurred between 1 October 2006 and 31 October 2008. The breach of SUP 17 related to Barclays failure to submit accurate transaction reports as required in respect of an estimated 57.5 million transactions. Barclays breached Principle 2 by failing to conduct its business with due skill, care and diligence in failing to respond sufficiently to opportunities to review the adequacy of its transaction reporting systems. Barclays breached Principle 3 by failing to take reasonable care to organise and control its affairs responsibly and effectively, with adequate risk management systems, to meet the requirements to submit accurate transaction reports to the FSA", + 'TypeofAction': 'Fines', + 'EnforcementType': 'FSMA', + 'ActionEffectiveFrom': '08/09/2009'}, + ... + {'TypeofDescription': "On 23 September 2022, the FCA decided to impose a financial penalty on Barclays Bank Plc. The reason for this action is because Barclays Bank Plc failed to comply with Listing Rule 1.3.3 in October 2008. This matter has been referred by Barclays Bank Plc to the Upper Tribunal. The FCA’s findings and proposed action are therefore provisional and will not take effect pending determination of this matter by the Upper Tribunal. The FCA’s decision was issued on 23 September 2022 and a copy of the Decision Notice is displayed on the FCA's web site here: https://www.fca.org.uk/publication/decision-notices/barclays-bank-plc-dn-2022.pdf \xa0", + 'TypeofAction': 'Fines', + 'EnforcementType': 'FSMA', + 'ActionEffectiveFrom': '23/09/2022'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - exclusions + + .. code:: python + + >>> client.get_firm_exclusions('122702').fsr_data + [{'PSD2_Exclusion_Type': 'Limited Network Exclusion', + 'Particular_Exclusion_relied_upon': '2(k)(iii) – may be used only to acquire a very limited range of goods or services', + 'Description_of_services': 'Precision pay Virtual Prepaid - DVLA Service'}] + # + >>> client.get_firm_individuals('122702').fsr_data + [{'Status': 'Approved by regulator', + 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/BXC00280', + 'IRN': 'BXC00280', + 'Name': 'Bevan Cowie'}, + ... + {'Status': 'Approved by regulator', + 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/TXW00011', + 'IRN': 'TXW00011', + 'Name': 'Herbert Wright'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - alternative or secondary trading names + + .. code:: python + + >>> client.get_firm_names('122702').fsr_data + [{'Current Names': [{'Effective From': '17/05/2013', + 'Status': 'Trading', + 'Name': 'Barclays Bank'}, + ... + {'Effective To': '25/01/2010', + 'Effective From': '08/03/2004', + 'Status': 'Trading', + 'Name': 'Banca Woolwich'}]}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - passports + + .. code:: python + + >>> client.get_firm_passports('122702').fsr_data + [{'Passports': [{'PassportDirection': 'Passporting Out', + 'Permissions': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Passports/GIBRALTAR/Permission', + 'Country': 'GIBRALTAR'}]}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - firm country-specific passport permissions and activities + + .. code:: python + + >>> client.get_firm_passport_permissions('122702', 'Gibraltar').fsr_data + [{'Permissions': [{'Name': '* - additional MiFID services and activities subject to mutual recognition under the BCD', + 'InvestmentTypes': []}, + ... + {'Permissions': [{'Name': 'Insurance Distribution or Reinsurance Distribution', + 'InvestmentTypes': []}], + 'PassportType': 'Service', + 'PassportDirection': 'Passporting Out', + 'Directive': 'Insurance Distribution', + 'Country': 'GIBRALTAR'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - permissions and activities + + .. code:: python + + >>> client.get_firm_permissions('122702').fsr_data + {'Debt Adjusting': [{'Limitation': ['This permission is limited to debt adjusting with no debt management activity']}], + 'Credit Broking': [{'Limitation Not Found': ['Valid limitation not present']}], + ... + 'Accepting Deposits': [{'Customer Type': ['All']}, + {'Investment Type': ['Deposit']}]} - >>> client.get_firm('122702').fsr_data - [{'Name': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Names', - 'Individuals': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Individuals', - 'Requirements': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Requirements', - 'Permission': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Permissions', - 'Passport': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Passports', - 'Regulators': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Regulators', - 'Appointed Representative': 'https://register.fca.org.uk/services/V0.1/Firm/122702/AR', - 'Address': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Address', - 'Waivers': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Waivers', - 'Exclusions': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Exclusions', - 'DisciplinaryHistory': 'https://register.fca.org.uk/services/V0.1/Firm/122702/DisciplinaryHistory', - 'System Timestamp': '30/11/2024 20:34', - 'Exceptional Info Details': [], - 'Status Effective Date': '01/12/2001', - 'E-Money Agent Status': '', - 'PSD / EMD Effective Date': '', - 'Client Money Permission': 'Control but not hold client money', - 'Sub Status Effective from': '', - 'Sub-Status': '', - 'Mutual Society Number': '', - 'Companies House Number': '01026167', - 'MLRs Status Effective Date': '', - 'MLRs Status': '', - 'E-Money Agent Effective Date': '', - 'PSD Agent Effective date': '', - 'PSD Agent Status': '', - 'PSD / EMD Status': '', - 'Status': 'Authorised', - 'Business Type': 'Regulated', - 'Organisation Name': 'Barclays Bank Plc', - 'FRN': '122702'}] - # - >>> client.get_firm_addresses('122702').fsr_data - [{'URL': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Address?Type=PPOB', - 'Website Address': 'www.barclays.com', - 'Phone Number': '+442071161000', - 'Country': 'UNITED KINGDOM', - 'Postcode': 'E14 5HP', - 'County': '', - 'Town': 'London', - 'Address Line 4': '', - 'Address LIne 3': '', - 'Address Line 2': '', - 'Address Line 1': 'One Churchill Place', - 'Address Type': 'Principal Place of Business'}, - {'URL': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Address?Type=Complaint', - 'Website Address': '', - 'Phone Number': '+4403301595858', - 'Country': 'UNITED KINGDOM', - 'Postcode': 'NN4 7SG', - 'County': 'Northamptonshire', - 'Town': 'Northampton', - 'Address Line 4': '', - 'Address LIne 3': '', - 'Address Line 2': '', - 'Address Line 1': '1234 Pavilion Drive', - 'Individual': '', - 'Address Type': 'Complaints Contact'}] - # - >>> client.get_firm_controlled_functions('122702').fsr_data - [{'Current': {'(6707)SMF4 Chief Risk': {'Suspension / Restriction End Date': '', - 'Suspension / Restriction Start Date': '', - 'Restriction': '', - 'Effective Date': '16/02/2023', - 'Individual Name': 'Bevan Cowie', - 'Name': 'SMF4 Chief Risk', - 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/BXC00280'}, - ... - '(22338)[PRA CF] Significant risk taker or Material risk taker': {'End Date': '30/06/2020', - 'Suspension / Restriction End Date': '', - 'Suspension / Restriction Start Date': '', - 'Restriction': '', - 'Effective Date': '07/03/2016', - 'Individual Name': 'Lynne Atkin', - 'Name': '[PRA CF] Significant risk taker or Material risk taker', - 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/LAA01049'}}}] - # - >>> client.get_firm_disciplinary_history('122702').fsr_data - [{'TypeofDescription': "On 19 August 2009, the FSA imposed a penalty on Barclays Bank plc and Barclays Capital Securities Limited (Barclays) of £2,450,000 (discounted from £3,500,000 for early settlement) in respect of breaches of SUP 17 of the FSA Handbook and breaches of Principles 2 and 3 of the FSA's Principles for Businesses which occurred between 1 October 2006 and 31 October 2008. The breach of SUP 17 related to Barclays failure to submit accurate transaction reports as required in respect of an estimated 57.5 million transactions. Barclays breached Principle 2 by failing to conduct its business with due skill, care and diligence in failing to respond sufficiently to opportunities to review the adequacy of its transaction reporting systems. Barclays breached Principle 3 by failing to take reasonable care to organise and control its affairs responsibly and effectively, with adequate risk management systems, to meet the requirements to submit accurate transaction reports to the FSA", - 'TypeofAction': 'Fines', - 'EnforcementType': 'FSMA', - 'ActionEffectiveFrom': '08/09/2009'}, - ... - {'TypeofDescription': "On 23 September 2022, the FCA decided to impose a financial penalty on Barclays Bank Plc. The reason for this action is because Barclays Bank Plc failed to comply with Listing Rule 1.3.3 in October 2008. This matter has been referred by Barclays Bank Plc to the Upper Tribunal. The FCA’s findings and proposed action are therefore provisional and will not take effect pending determination of this matter by the Upper Tribunal. The FCA’s decision was issued on 23 September 2022 and a copy of the Decision Notice is displayed on the FCA's web site here: https://www.fca.org.uk/publication/decision-notices/barclays-bank-plc-dn-2022.pdf \xa0", - 'TypeofAction': 'Fines', - 'EnforcementType': 'FSMA', - 'ActionEffectiveFrom': '23/09/2022'}] - # - >>> client.get_firm_exclusions('122702').fsr_data - [{'PSD2_Exclusion_Type': 'Limited Network Exclusion', - 'Particular_Exclusion_relied_upon': '2(k)(iii) – may be used only to acquire a very limited range of goods or services', - 'Description_of_services': 'Precision pay Virtual Prepaid - DVLA Service'}] - # - >>> client.get_firm_individuals('122702').fsr_data - [{'Status': 'Approved by regulator', - 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/BXC00280', - 'IRN': 'BXC00280', - 'Name': 'Bevan Cowie'}, - ... - {'Status': 'Approved by regulator', - 'URL': 'https://register.fca.org.uk/services/V0.1/Individuals/TXW00011', - 'IRN': 'TXW00011', - 'Name': 'Herbert Wright'}] - # - >>> client.get_firm_names('122702').fsr_data - [{'Current Names': [{'Effective From': '17/05/2013', - 'Status': 'Trading', - 'Name': 'Barclays Bank'}, - ... - {'Effective To': '25/01/2010', - 'Effective From': '08/03/2004', - 'Status': 'Trading', - 'Name': 'Banca Woolwich'}]}] - # - >>> client.get_firm_passports('122702').fsr_data - [{'Passports': [{'PassportDirection': 'Passporting Out', - 'Permissions': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Passports/GIBRALTAR/Permission', - 'Country': 'GIBRALTAR'}]}] - # - >>> client.get_firm_passport_permissions('122702', 'Gibraltar').fsr_data - [{'Permissions': [{'Name': '* - additional MiFID services and activities subject to mutual recognition under the BCD', - 'InvestmentTypes': []}, - ... - {'Permissions': [{'Name': 'Insurance Distribution or Reinsurance Distribution', - 'InvestmentTypes': []}], - 'PassportType': 'Service', - 'PassportDirection': 'Passporting Out', - 'Directive': 'Insurance Distribution', - 'Country': 'GIBRALTAR'}] - # - >>> client.get_firm_permissions('122702').fsr_data - {'Debt Adjusting': [{'Limitation': ['This permission is limited to debt adjusting with no debt management activity']}], - 'Credit Broking': [{'Limitation Not Found': ['Valid limitation not present']}], - ... - 'Accepting Deposits': [{'Customer Type': ['All']}, - {'Investment Type': ['Deposit']}]} - # - >>> client.get_firm_regulators('122702').fsr_data - [{'Termination Date': '', - 'Effective Date': '01/04/2013', - 'Regulator Name': 'Financial Conduct Authority'}, - ... - {'Termination Date': '30/11/2001', - 'Effective Date': '25/11/1993', - 'Regulator Name': 'Securities and Futures Authority'}] - # - >>> client.get_firm_requirements('122702').fsr_data - [{'Effective Date': '23/03/2020', - 'Written Notice - Market Risk Consolidation': 'REQUIREMENTS RELEVANT TO THE MARKET RISK CONSOLIDATION PERMISSION THAT THE FIRM HAS SOUGHT AND THE PRA IMPOSES UNDER SECTION 55M (5) OF THE ACT 1.This Market Risk Consolidation Permission applies to an institution or undertaking listed in Table 1 only for as long as it remains part of the Barclays Group. The firm must notify the PRA promptly if any of those institutions or undertakings ceases to be part of the Barclays Group. 2.The firm must, no later than 23 business days after the end of each quarter, ending March, June, September and December submit, in respect of that quarter, a report to the PRA highlighting the capital impact of market risk consolidation for each of the institutions listed in Table 1. 3.The firm must: 1.ensure that any existing legal agreements or arrangements necessary for fulfilment of the conditions of Article 325(2) of the CRR as between any of the institutions in Table 1 are maintained; and 2.notify the PRA of any variation in the terms of such agreements, or of any change in the relevant legal or regulatory framework of which it becomes aware and which may have an impact on the ability of any of the institutions listed in Table 1 to meet the conditions of Article 325(2) of the CRR. THE MARKET RISK CONSOLIDATION PERMISSION Legal Entities 1.The Market Risk Consolidation Permission means that the firm may use positions in an institution or undertaking listed in Table 1 to offset positions in another institution or undertaking listed therein only for the purposes of calculating net positions and own funds requirements in accordance with Title IV of the CRR on a consolidated basis. Table 1 Institutions and Location of undertaking: Barclays Bank PLC (BBPLC) - UK Barclays Capital Securities Limited (BCSL) UK Barclays Bank Ireland - Ireland', - 'Requirement Reference': 'OR-0170047', - 'Financial Promotions Requirement': 'FALSE'}, - ... - {'Effective Date': '01/10/2024', - 'Financial Promotion for other unauthorised clients': 'This firm can: (1) approve its own financial promotions as well as those of members of its wider group and, in certain circumstances, those of its appointed representatives; and (2) approve financial promotions for other unauthorised persons for the following types of investment:', - 'Requirement Reference': 'OR-0262545', - 'Financial Promotions Requirement': 'TRUE', - 'Financial Promotions Investment Types': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Requirements/OR-0262545/InvestmentTypes'}] - # - >>> client.get_firm_requirement_investment_types('122702', 'OR-0262545').fsr_data - [{'Investment Type Name': 'Certificates representing certain securities'}, - {'Investment Type Name': 'Debentures'}, - {'Investment Type Name': 'Government and public security'}, - {'Investment Type Name': 'Listed shares'}, - {'Investment Type Name': 'Warrants'}] - # - >>> client.get_firm_waivers('122702').fsr_data - [{'Waivers_Discretions_URL': 'https://register.fca.org.uk/servlet/servlet.FileDownload?file=00P0X00001YXBw1UAH', - 'Waivers_Discretions': 'A4823494P.pdf', - 'Rule_ArticleNo': ['CRR Ar.313']}, - ... - {'Waivers_Discretions_URL': 'https://register.fca.org.uk/servlet/servlet.FileDownload?file=00P4G00002oJPciUAG', - 'Waivers_Discretions': 'A00003642P.pdf', - 'Rule_ArticleNo': ['Perm & Wav - CRR Ru 2.2']}] +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - regulators + + .. code:: python + + >>> client.get_firm_regulators('122702').fsr_data + [{'Termination Date': '', + 'Effective Date': '01/04/2013', + 'Regulator Name': 'Financial Conduct Authority'}, + ... + {'Termination Date': '30/11/2001', + 'Effective Date': '25/11/1993', + 'Regulator Name': 'Securities and Futures Authority'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - requirements + + .. code:: python + + >>> client.get_firm_requirements('122702').fsr_data + [{'Effective Date': '23/03/2020', + 'Written Notice - Market Risk Consolidation': 'REQUIREMENTS RELEVANT TO THE MARKET RISK CONSOLIDATION PERMISSION THAT THE FIRM HAS SOUGHT AND THE PRA IMPOSES UNDER SECTION 55M (5) OF THE ACT 1.This Market Risk Consolidation Permission applies to an institution or undertaking listed in Table 1 only for as long as it remains part of the Barclays Group. The firm must notify the PRA promptly if any of those institutions or undertakings ceases to be part of the Barclays Group. 2.The firm must, no later than 23 business days after the end of each quarter, ending March, June, September and December submit, in respect of that quarter, a report to the PRA highlighting the capital impact of market risk consolidation for each of the institutions listed in Table 1. 3.The firm must: 1.ensure that any existing legal agreements or arrangements necessary for fulfilment of the conditions of Article 325(2) of the CRR as between any of the institutions in Table 1 are maintained; and 2.notify the PRA of any variation in the terms of such agreements, or of any change in the relevant legal or regulatory framework of which it becomes aware and which may have an impact on the ability of any of the institutions listed in Table 1 to meet the conditions of Article 325(2) of the CRR. THE MARKET RISK CONSOLIDATION PERMISSION Legal Entities 1.The Market Risk Consolidation Permission means that the firm may use positions in an institution or undertaking listed in Table 1 to offset positions in another institution or undertaking listed therein only for the purposes of calculating net positions and own funds requirements in accordance with Title IV of the CRR on a consolidated basis. Table 1 Institutions and Location of undertaking: Barclays Bank PLC (BBPLC) - UK Barclays Capital Securities Limited (BCSL) UK Barclays Bank Ireland - Ireland', + 'Requirement Reference': 'OR-0170047', + 'Financial Promotions Requirement': 'FALSE'}, + ... + {'Effective Date': '01/10/2024', + 'Financial Promotion for other unauthorised clients': 'This firm can: (1) approve its own financial promotions as well as those of members of its wider group and, in certain circumstances, those of its appointed representatives; and (2) approve financial promotions for other unauthorised persons for the following types of investment:', + 'Requirement Reference': 'OR-0262545', + 'Financial Promotions Requirement': 'TRUE', + 'Financial Promotions Investment Types': 'https://register.fca.org.uk/services/V0.1/Firm/122702/Requirements/OR-0262545/InvestmentTypes'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - investment types associated with a specific firm requirement + + .. code:: python + + >>> client.get_firm_requirement_investment_types('122702', 'OR-0262545').fsr_data + [{'Investment Type Name': 'Certificates representing certain securities'}, + {'Investment Type Name': 'Debentures'}, + {'Investment Type Name': 'Government and public security'}, + {'Investment Type Name': 'Listed shares'}, + {'Investment Type Name': 'Warrants'}] + +.. grid:: 1 + + .. grid-item-card:: **Barclays Bank (FRN #122702)** - waivers + + .. code:: python + + >>> client.get_firm_waivers('122702').fsr_data + [{'Waivers_Discretions_URL': 'https://register.fca.org.uk/servlet/servlet.FileDownload?file=00P0X00001YXBw1UAH', + 'Waivers_Discretions': 'A4823494P.pdf', + 'Rule_ArticleNo': ['CRR Ar.313']}, + ... + {'Waivers_Discretions_URL': 'https://register.fca.org.uk/servlet/servlet.FileDownload?file=00P4G00002oJPciUAG', + 'Waivers_Discretions': 'A00003642P.pdf', + 'Rule_ArticleNo': ['Perm & Wav - CRR Ru 2.2']}] .. _usage.individuals: Individuals =========== -Client methods for individual-specific requests, the associated API endpoints, and parameters and returns are summarised in the table below. +Client methods for individual-specific requests, the associated API endpoints, resource parameters, and returns are summarised in the table below. .. list-table:: :align: left @@ -479,63 +583,80 @@ Client methods for individual-specific requests, the associated API endpoints, a - Return * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_individual()` - ``/V0.1/Individuals/{IRN}`` - - IRN (str) - ``GET`` + - IRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_individual_controlled_functions()` - ``/V0.1/Individuals/{IRN}/CF`` - - IRN (str) - ``GET`` + - IRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_individual_disciplinary_history()` - ``/V0.1/Individuals/{IRN}/DisciplinaryHistory`` - - IRN (str) - ``GET`` + - IRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` -Some examples are given below for a specific, existing individual, Mark Carney (IRN #MXC29012). +Some examples are given below for each type of request for a specific, existing individual, Mark Carney (IRN #MXC29012). -.. code:: python +.. grid:: 1 - >>> client.get_individual('MXC29012').fsr_data - [{'Details': {'Disciplinary History': 'https://register.fca.org.uk/services/V0.1/Individuals/MXC29012/DisciplinaryHistory', - 'Current roles & activities': 'https://register.fca.org.uk/services/V0.1/Individuals/MXC29012/CF', - 'IRN': 'MXC29012', - 'Commonly Used Name': 'Mark', - 'Status': 'Certified / assessed by firm', - 'Full Name': 'Mark Carney'}, - 'Workplace Location 1': {'Firm Name': 'TSB Bank plc', - 'Location 1': 'Liverpool'}}] - # - >>> client.get_individual_controlled_functions('MXC29012').fsr_data - [{'Previous': {'(5)Appointed representative dealing with clients for which they require qualification': {'Customer Engagement Method': 'Face To Face; Telephone; Online', - 'End Date': '05/04/2022', - 'Suspension / Restriction End Date': '', - 'Suspension / Restriction Start Date': '', - 'Restriction': '', - 'Effective Date': '23/10/2020', - 'Firm Name': 'HL Partnership Limited', - 'Name': 'Appointed representative dealing with clients for which they require qualification', - 'URL': 'https://register.fca.org.uk/services/V0.1/Firm/303397'}, - ... - '(1)The London Institute of Banking and Finance (LIBF) - formerly known as IFS': {'Customer Engagement Method': '', - 'Suspension / Restriction End Date': '', - 'Suspension / Restriction Start Date': '', - 'Restriction': '', - 'Effective Date': '', - 'Firm Name': 'Echo Finance Limited', - 'Name': 'The London Institute of Banking and Finance (LIBF) - formerly known as IFS', - 'URL': 'https://register.fca.org.uk/services/V0.1/Firm/570073'}}}] - # - >>> client.get_individual_disciplinary_history('MXC29012').fsr_data - # None + .. grid-item-card:: **Mark Carney (IRN #MXC29012)** - individual details + + .. code:: python + + >>> client.get_individual('MXC29012').fsr_data + [{'Details': {'Disciplinary History': 'https://register.fca.org.uk/services/V0.1/Individuals/MXC29012/DisciplinaryHistory', + 'Current roles & activities': 'https://register.fca.org.uk/services/V0.1/Individuals/MXC29012/CF', + 'IRN': 'MXC29012', + 'Commonly Used Name': 'Mark', + 'Status': 'Certified / assessed by firm', + 'Full Name': 'Mark Carney'}, + 'Workplace Location 1': {'Firm Name': 'TSB Bank plc', + 'Location 1': 'Liverpool'}}] + +.. grid:: 1 + + .. grid-item-card:: **Mark Carney (IRN #MXC29012)** - controlled functions + + .. code:: python + + >>> client.get_individual_controlled_functions('MXC29012').fsr_data + [{'Previous': {'(5)Appointed representative dealing with clients for which they require qualification': {'Customer Engagement Method': 'Face To Face; Telephone; Online', + 'End Date': '05/04/2022', + 'Suspension / Restriction End Date': '', + 'Suspension / Restriction Start Date': '', + 'Restriction': '', + 'Effective Date': '23/10/2020', + 'Firm Name': 'HL Partnership Limited', + 'Name': 'Appointed representative dealing with clients for which they require qualification', + 'URL': 'https://register.fca.org.uk/services/V0.1/Firm/303397'}, + ... + '(1)The London Institute of Banking and Finance (LIBF) - formerly known as IFS': {'Customer Engagement Method': '', + 'Suspension / Restriction End Date': '', + 'Suspension / Restriction Start Date': '', + 'Restriction': '', + 'Effective Date': '', + 'Firm Name': 'Echo Finance Limited', + 'Name': 'The London Institute of Banking and Finance (LIBF) - formerly known as IFS', + 'URL': 'https://register.fca.org.uk/services/V0.1/Firm/570073'}}}] + + +.. grid:: 1 + + .. grid-item-card:: **Mark Carney (IRN #MXC29012)** - disciplinary history + + .. code:: python + + >>> client.get_individual_disciplinary_history('MXC29012').fsr_data + # None .. _usage.funds: Funds ===== -Client methods for fund-specific requests, the associated API endpoints, and parameters and returns are summarised in the table below. +Client methods for fund-specific requests, the associated API endpoints, resource parameters, and returns are summarised in the table below. .. list-table:: :align: left @@ -549,52 +670,68 @@ Client methods for fund-specific requests, the associated API endpoints, and par - Return * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_fund()` - ``/V0.1/CIS/{PRN}`` - - PRN (str) - ``GET`` + - PRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_fund_names()` - ``/V0.1/CIS/{PRN}/Names`` - - PRN (str) - ``GET`` + - PRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` * - :py:meth:`~fsrapiclient.api.FsrApiClient.get_fund_subfunds()` - ``/V0.1/CIS/{PRN}/Subfund`` - - PRN (str) - ``GET`` + - PRN (str) - :py:class:`~fsrapiclient.api.FsrApiResponse` -Some examples are given below for a specific, existing fund, abrdn Multi-Asset Fund (PRN #185045). +Some examples are given below for each type of request for a specific, existing fund, abrdn Multi-Asset Fund (PRN #185045). -.. code:: python +.. grid:: 1 - >>> client.get_fund('185045').fsr_data - [{'Sub-funds': 'https://register.fca.org.uk/services/V0.1/CIS/185045/Subfund', - 'Other Name': 'https://register.fca.org.uk/services/V0.1/CIS/185045/Names', - 'CIS Depositary': 'https://register.fca.org.uk/services/V0.1/Firm/805574', - 'CIS Depositary Name': 'Citibank UK Limited', - 'Operator Name': 'abrdn Fund Managers Limited', - 'Operator': 'https://register.fca.org.uk/services/V0.1/Firm/121803', - 'MMF Term Type': '', - 'MMF NAV Type': '', - 'Effective Date': '23/12/1997', - 'Scheme Type': 'UCITS (COLL)', - 'Product Type': 'ICVC', - 'ICVC Registration No': 'SI000001', - 'Status': 'Authorised'}] - # - >>> client.get_fund_names('185045').fsr_data - [{'Effective To': '22/08/2019', - 'Effective From': '23/12/1997', - 'Product Other Name': 'ABERDEEN INVESTMENT FUNDS ICVC'}, - {'Effective To': '01/08/2022', - 'Effective From': '23/12/1997', - 'Product Other Name': 'Aberdeen Standard OEIC I'}] - # - >>> client.get_fund_subfunds('185045').fsr_data - [{'URL': 'https://register.fca.org.uk/services/apexrest/V0.1/CIS/185045', - 'Sub-Fund Type': 'Other', - 'Name': 'abrdn (AAM) UK Smaller Companies Fund'}, - ... - {'URL': 'https://register.fca.org.uk/services/apexrest/V0.1/CIS/185045', - 'Sub-Fund Type': 'Other', - 'Name': 'abrdn Strategic Bond Fund'}] + .. grid-item-card:: **abrdn Multi-Asset Fund (PRN #185045)** - fund details + + .. code:: python + + >>> client.get_fund('185045').fsr_data + [{'Sub-funds': 'https://register.fca.org.uk/services/V0.1/CIS/185045/Subfund', + 'Other Name': 'https://register.fca.org.uk/services/V0.1/CIS/185045/Names', + 'CIS Depositary': 'https://register.fca.org.uk/services/V0.1/Firm/805574', + 'CIS Depositary Name': 'Citibank UK Limited', + 'Operator Name': 'abrdn Fund Managers Limited', + 'Operator': 'https://register.fca.org.uk/services/V0.1/Firm/121803', + 'MMF Term Type': '', + 'MMF NAV Type': '', + 'Effective Date': '23/12/1997', + 'Scheme Type': 'UCITS (COLL)', + 'Product Type': 'ICVC', + 'ICVC Registration No': 'SI000001', + 'Status': 'Authorised'}] + +.. grid:: 1 + + .. grid-item-card:: **abrdn Multi-Asset Fund (PRN #185045)** - alternative or secondary names + + .. code:: python + + >>> client.get_fund_names('185045').fsr_data + [{'Effective To': '22/08/2019', + 'Effective From': '23/12/1997', + 'Product Other Name': 'ABERDEEN INVESTMENT FUNDS ICVC'}, + {'Effective To': '01/08/2022', + 'Effective From': '23/12/1997', + 'Product Other Name': 'Aberdeen Standard OEIC I'}] + +.. grid:: 1 + + .. grid-item-card:: **abrdn Multi-Asset Fund (PRN #185045)** - subfunds + + .. code:: python + + >>> client.get_fund_subfunds('185045').fsr_data + [{'URL': 'https://register.fca.org.uk/services/apexrest/V0.1/CIS/185045', + 'Sub-Fund Type': 'Other', + 'Name': 'abrdn (AAM) UK Smaller Companies Fund'}, + ... + {'URL': 'https://register.fca.org.uk/services/apexrest/V0.1/CIS/185045', + 'Sub-Fund Type': 'Other', + 'Name': 'abrdn Strategic Bond Fund'}] diff --git a/pyproject.toml b/pyproject.toml index 922ba2d..f63d18d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ # https://packaging.python.org/en/latest/tutorials/packaging-projects/ # name = "fsrapiclient" -description = "Lightweight Python client library for the UK Financial Services Register (FSR) RESTful API" +description = "Lightweight Python client library for the UK Financial Services Register RESTful API" authors = [ {name = "S. R. Murthy", email = "s.murthy@tutanota.com"}, @@ -23,7 +23,7 @@ dynamic = ["version"] requires-python = ">=3.10" -license = {text = "MPL"} +license = {file = "LICENSE"} dependencies = [ "requests", @@ -32,18 +32,21 @@ dependencies = [ readme = "README.md" keywords = [ - "authorised firm", "financial conduct authority", "financial data", + "financial regulation", + "financial services", "financial services register", "prudential regulation authority", - "regulated firm", "restful api", + "uk", ] classifiers = [ "Environment :: Console", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -66,8 +69,8 @@ requires = ["pdm-backend"] build-backend = "pdm.backend" [project.urls] -Homepage = "https://github.com/sr-murthy/fsrapiclient" -Documentation = "https://github.com/sr-murthy/fsrapiclient" +Homepage = "https://fsrapiclient.readthedocs.io/index.html" +Documentation = "https://fsrapiclient.readthedocs.io" Repository = "https://github.com/sr-murthy/fsrapiclient" # For working with PDM, including configuration and usage see: diff --git a/src/fsrapiclient/__version__.py b/src/fsrapiclient/__version__.py index 2995a62..1f4ca89 100644 --- a/src/fsrapiclient/__version__.py +++ b/src/fsrapiclient/__version__.py @@ -1,2 +1,2 @@ -__version__ = "0.2.1" +__version__ = "0.2.2" diff --git a/src/fsrapiclient/api.py b/src/fsrapiclient/api.py index 0ac4453..34e031c 100644 --- a/src/fsrapiclient/api.py +++ b/src/fsrapiclient/api.py @@ -53,9 +53,8 @@ def __init__(self, api_username: str, api_key: str) -> None: api_username : str The API username which will be the email used to sign up on the FS Register developer portal: - :: - https://register.fca.org.uk/Developer/s/ + https://register.fca.org.uk/Developer/s/ api_key : str The API key obtained from the registration profile on the FS @@ -187,8 +186,7 @@ def fsr_data(self) -> dict | list[dict]: class FsrApiClient: """Client for the FS Register API (V0.1). - Consult the developer documentation for further details on the underlying - API: + Consult the API documentation for further details. https://register.fca.org.uk/Developer/s/ @@ -285,14 +283,14 @@ def common_search(self, search_str: str) -> FsrApiResponse: Directly calls on the API common search endpoint: :: - /V0.1/Search?q=&type= + /V0.1/Search?q=&type= to perform a case-insensitive search in the FS Register on the given - search string and entity type (``"firm"``, ``"individual"``, + search string and resource type (``"firm"``, ``"individual"``, ``"fund"``). - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse` object if the API call completes - without exceptions or errors. + Returns an :py:class:`~fsrapiclient.api.FsrApiResponse` object if the + API call completes without exceptions or errors. Parameters ---------- @@ -301,16 +299,16 @@ def common_search(self, search_str: str) -> FsrApiResponse: search string of the form: :: - q=&type= + q=&type= - where ```` is the name of a firm, individual or fund - (collective investment scheme), and ```` is one of + where ```` is the name of a firm, individual or fund + (collective investment scheme), and ```` is one of the strings ``"firm"``, ``"individual"``, or ``"fund"``. Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Raises @@ -499,7 +497,7 @@ def _firm_info(self, frn: str, modifiers: tuple[str] = None) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. """ url = f'{FSR_API_CONSTANTS.BASEURL.value}/{self.api_version}/Firm/{frn}' @@ -520,8 +518,8 @@ def get_firm(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN} - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -531,7 +529,7 @@ def get_firm(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -555,8 +553,8 @@ def get_firm_names(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Names - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -566,7 +564,7 @@ def get_firm_names(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -591,8 +589,8 @@ def get_firm_addresses(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Address - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the FRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -602,7 +600,7 @@ def get_firm_addresses(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -626,8 +624,8 @@ def get_firm_controlled_functions(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/CF - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -637,7 +635,7 @@ def get_firm_controlled_functions(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -661,8 +659,8 @@ def get_firm_individuals(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Individuals - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -672,7 +670,7 @@ def get_firm_individuals(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -696,8 +694,8 @@ def get_firm_permissions(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Permissions - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -707,7 +705,7 @@ def get_firm_permissions(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -731,8 +729,8 @@ def get_firm_requirements(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Requirements - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -742,7 +740,7 @@ def get_firm_requirements(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -766,8 +764,8 @@ def get_firm_requirement_investment_types(self, frn: str, req_ref: str) -> FsrAp /V0.1/Firm/{FRN}/Requirements//InvestmentTypes - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -780,7 +778,7 @@ def get_firm_requirement_investment_types(self, frn: str, req_ref: str) -> FsrAp Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -802,8 +800,8 @@ def get_firm_regulators(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Regulators - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -813,7 +811,7 @@ def get_firm_regulators(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -837,8 +835,8 @@ def get_firm_passports(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Passports - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the FRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -848,7 +846,7 @@ def get_firm_passports(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -872,8 +870,8 @@ def get_firm_passport_permissions(self, frn: str, country: str) -> FsrApiRespons /V0.1/Firm/{FRN}/Requirements/{Country}/Permission - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the FRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -886,7 +884,7 @@ def get_firm_passport_permissions(self, frn: str, country: str) -> FsrApiRespons Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -908,8 +906,8 @@ def get_firm_waivers(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Waivers - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could - have data if the FRN exists, or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -919,7 +917,7 @@ def get_firm_waivers(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -943,8 +941,8 @@ def get_firm_exclusions(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/Exclusions - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the FRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -954,7 +952,7 @@ def get_firm_exclusions(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -978,8 +976,8 @@ def get_firm_disciplinary_history(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/DisciplinaryHistory - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the FRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -989,7 +987,7 @@ def get_firm_disciplinary_history(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -1013,8 +1011,8 @@ def get_firm_appointed_representatives(self, frn: str) -> FsrApiResponse: /V0.1/Firm/{FRN}/AR - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the FRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -1024,7 +1022,7 @@ def get_firm_appointed_representatives(self, frn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. Examples @@ -1181,7 +1179,7 @@ def _individual_info(self, irn: str, modifiers: tuple[str] = None) -> FsrApiResp Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. """ url = f'{FSR_API_CONSTANTS.BASEURL.value}/{self.api_version}/Individuals/{irn}' @@ -1202,8 +1200,8 @@ def get_individual(self, irn: str) -> FsrApiResponse: /V0.1/Individuals/{IRN} - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the IRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the IRN is found, otherwise with no data. Parameters ---------- @@ -1213,7 +1211,7 @@ def get_individual(self, irn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the IRN isn't found. Examples @@ -1237,8 +1235,8 @@ def get_individual_controlled_functions(self, irn: str) -> FsrApiResponse: /V0.1/Firm/{IRN}/CF - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the IRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the IRN is found, otherwise with no data. Parameters ---------- @@ -1248,7 +1246,7 @@ def get_individual_controlled_functions(self, irn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapepr of the API response object - there may still be no data in + Wrapepr of the API response object - there may be no data in the response if the IRN isn't found. Examples @@ -1272,8 +1270,8 @@ def get_individual_disciplinary_history(self, irn: str) -> FsrApiResponse: /V0.1/Firm/{IRN}/DisciplinaryHistory - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the IRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the IRN is found, otherwise with no data. Parameters ---------- @@ -1283,7 +1281,7 @@ def get_individual_disciplinary_history(self, irn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the IRN isn't found. Examples @@ -1302,7 +1300,7 @@ def get_individual_disciplinary_history(self, irn: str) -> FsrApiResponse: return self._individual_info(irn, modifiers=('DisciplinaryHistory',)) def search_prn(self, fund_name: str) -> str: - """:py:class:`~fsrapiclient.api.FsrApiResponse` : Returns the unique product reference number (IRN) of a given fund or collective investment scheme (CIS), including subfunds, if it exists. + """:py:class:`str` : Returns the unique product reference number (PRN) of a given fund or collective investment scheme (CIS), including subfunds, if it exists. Uses the API common search endpoint: :: @@ -1408,9 +1406,10 @@ def _fund_info(self, prn: str, modifiers: tuple[str] = None) -> FsrApiResponse: /V0.1/CIS/{PRN}[/] - and returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, e.g. a request for information - on "'Northern Trust High Dividend ESG World Equity Feeder Fund", which - has the PRN '913937'. + and returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, e.g. a + request for information on + "Northern Trust High Dividend ESG World Equity Feeder Fund" + (PRN 913937). :: /V0.1/CIS/913937 @@ -1443,7 +1442,7 @@ def _fund_info(self, prn: str, modifiers: tuple[str] = None) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the FRN isn't found. """ url = f'{FSR_API_CONSTANTS.BASEURL.value}/{self.api_version}/CIS/{prn}' @@ -1464,8 +1463,8 @@ def get_fund(self, prn: str) -> FsrApiResponse: /V0.1/CIS/{PRN} - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the PRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the PRN is found, otherwise with no data. Parameters ---------- @@ -1475,7 +1474,7 @@ def get_fund(self, prn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the PRN isn't found. Examples @@ -1499,8 +1498,8 @@ def get_fund_names(self, prn: str) -> FsrApiResponse: /V0.1/CIS/{PRN}/Names - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the PRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the PRN is found, otherwise with no data. Parameters ---------- @@ -1510,7 +1509,7 @@ def get_fund_names(self, prn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the PRN isn't found. Examples @@ -1534,8 +1533,8 @@ def get_fund_subfunds(self, prn: str) -> FsrApiResponse: /V0.1/CIS/{PRN}/Subfund - Returns an :py:class:`~fsrapiclient.api.FsrApiResponse`, which could have data if the PRN exists, - or null if it not. + Returns a :py:class:`~fsrapiclient.api.FsrApiResponse`, with data + if the FRN is found, otherwise with no data. Parameters ---------- @@ -1545,7 +1544,7 @@ def get_fund_subfunds(self, prn: str) -> FsrApiResponse: Returns ------- FsrApiResponse - Wrapper of the API response object - there may still be no data in + Wrapper of the API response object - there may be no data in the response if the PRN isn't found. Examples