Skip to main content

LPSN API

Using the LPSN API requires registration. Registrations is free but the usage of LPSN data is only permitted when in compliance with the LPSN copyright. See LPSN copyright notice for details.

Please register here.

The Python package can be initialized using your login credentials:

import lpsn

client = lpsn.LpsnClient('name@mail.example', 'password')

# the prepare method fetches all LPSN-IDs matching your query
# and returns the number of IDs found
count = client.search(taxon_name='Sulfolobus', correct_name='yes')
print(count, 'entries found.')

# the retrieve method lets you iterate over all results
# and returns the full entry as dict
# Entries can be further filtered using a list of keys (e.g. ['keywords'])
for entry in client.retrieve():
    print(entry)

Example queries:

You can use IDs to query LPSN as described here. Note that when using the parameter id, all other parameters are ignored.

# Search by LPSN-IDs (either semicolon separated or as list):
query = {"id": 520424}
query = {"id": "520424;4948;17724"}
query = {"id": [520424, 4948, 17724]}

# run query
client.search(**query)

Or you can use all the advanced search parameters that are described here.

Note that dashes (-) are replaced by underscores when used as python parameters.

# Example looking for validly published species from Escherichia that have risk group 1:
client.search(taxon_name='Escherichia', category='species', riskgroup='1', validly_published='yes')

# The same example using a Python dictionary:
query = {
    'taxon-name': 'Escherichia', 
    'category': 'species',
    'riskgroup': '1',
    'validly-published': 'yes'
}
client.search(**query)

Filtering

Results from the retrieve Method of both clients can be further filtered. The result contains a list of matched keyword dicts:

result = client.retrieve(filter=["full_name", "lpsn_taxonomic_status"])
print({k:v for x in result for k,v in x.items()})

The printed result will look like this:

{782310: [{'full_name': 'Sulfolobus acidocaldarius'},
          {'lpsn_taxonomic_status': 'correct name'}],
 782311: [{'full_name': 'Sulfolobus brierleyi'},
          {'lpsn_taxonomic_status': 'synonym'}],
 782312: [{'full_name': 'Sulfolobus hakonensis'},
          {'lpsn_taxonomic_status': 'synonym'}],
 782313: [{'full_name': 'Sulfolobus metallicus'},
          {'lpsn_taxonomic_status': 'synonym'}],
...

Metadata

Release files for lpsn 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lpsn 0.1
File Size Uploaded
lpsn-0.1.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lpsn 0.1
File Interpreter ABI Platform
lpsn-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / lpsn-0.1.tar.gz

Download URL lpsn-0.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9e052a514cb49aa862db7fec96dc1f992febb2b01dbc522218fd175eccefbe72
BLAKE2b-256 checksum
How to use checksums
518b10745e5ea815d31305011ac32748d72885825e612786877a6f05a2249379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release files / lpsn-0.1-py3-none-any.whl

Download URL lpsn-0.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
208d0569239a077acf944a45258ee66fbd06a5ff9c366251954caf0bb292344a
BLAKE2b-256 checksum
How to use checksums
f771105dac665ae382107ce19947a72179b0fbdb2eac27ec57414a48bae2ca63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release history Release notifications | RSS feed

1.0.0

2 release files

0.1.1

2 release files

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page