piate
A python library and cli tool to interact with the IATE (Interactive Terminology for Europe) database.
Installing
pip install piate
CLI tool
Currently working commands:
iate list-collectionsiate list-domainsiate list-institutionsiate inventories list-languagesiate inventories list-primaritiesiate inventories list-query-operatorsiate inventories list-reliabilitiesiate inventories list-searchable-fieldsiate inventories list-term-types
Filtering
It's suggested to use the jq to filter the responses on the command line.
For example, only select official languages:
iate inventories list-languages | jq '[.[] | select(.is_official == true)] | length'
Library
client(**kwargs)
The entrypoint into the library, allowing the provision of authentication.
Parameters
- username (string) -- Username to use to authenticate against the API. Conflicts with
session. Requirespassword. - password (string) -- Password to use to authenticate against the API. Conflicts with
session. Requiresusername. - session (piate.api.session.Session) -- Session object to use to authenticate against the API. Conflicts with
usernameandpassword.
Examples
# Example with username and password
import piate
iate_client = piate.client(username="myusername", api_key="...")
# Example with session object
import piate
from piate.api.session import Session
from piate.api.credentials import Credentials
iate_client = piate.client(
session=Session(
credentials=Credentials(
username="myusername",
api_key="..."
)
)
)
Collections
A resource representing collections
import piate
collections = piate.client(...).collections
These are the available methods:
pages()
Iterate through pages of responses for Collections objects.
Examples
for page in collections.pages():
for collection in page.items:
print(collection.name)
Institutions
A resource representing institutions
import piate
institutions = piate.client(...).institutions
These are the available methods:
pages()
Iterate through pages of response for Institutions objects.
Examples
for page in institutions.pages():
for institution in page.items:
print(institution.name)
Domains
A resource representing domains
import piate
domains = piate.client(...).domains
These are the available methods:
list()
List all the available domains.
Examples
for domain in domains.list():
print(domain.name)
Inventories
A resoure representing inventories
import piate
inventories = piate.client(...).inventories
These are the available methods:
pages_languages()pages_query_operators()pages_term_types()pages_searchable_fields()pages_primarities()pages_reliabilities()
pages_languages(**kwargs)
Iterate through pages of response for language objects.
Parameters
- translation_language (string) -- Translation Language
Examples
for page in inventories.pages_languages(translation_language="en"):
for language in page.items:
print(language.name)
pages_query_operators(**kwargs)
Iterate through pages of response for language objects.
Parameters
- translation_language (string) -- Translation Language
Examples
for page in inventories.pages_query_operators(translation_language="en"):
for query_operators in page.items:
print(query_operators.name)
pages_term_types(**kwargs)
Iterate through pages of response for language objects.
Parameters
- translation_language (string) -- Translation Language
Examples
for page in inventories.pages_term_types(translation_language="en"):
for term_types in page.items:
print(term_types.name)
pages_searchable_fields(**kwargs)
Iterate through pages of response for language objects.
Parameters
- translation_language (string) -- Translation Language
Examples
for page in inventories.pages_searchable_fields(translation_language="en"):
for searchable_field in page.items:
print(searchable_field.name)
pages_primarities(**kwargs)
Iterate through pages of response for language objects.
Parameters
- translation_language (string) -- Translation Language
Examples
for page in inventories.pages_primarities(translation_language="en"):
for primarities in page.items:
print(primarities.name)
pages_reliabilities(**kwargs)
Iterate through pages of response for language objects.
Parameters
- translation_language (string) -- Translation Language
Examples
for page in inventories.pages_reliabilities(translation_language="en"):
for reliabilities in page.items:
print(reliabilities.name)
Metadata
Release files for piate 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| piate-0.1.6.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| piate-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.9 kB
Release files / piate-0.1.6.tar.gz
| Download URL | piate-0.1.6.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3bc7d66307db47926135679c0656a8d24369433d054d05e8e2e749ed7ef63dd
|
|
BLAKE2b-256 checksum How to use checksums |
8c1a5cdc760085cf751e372382d3803e685c57a63685012cf02b1954aa0fa625
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Release files / piate-0.1.6-py3-none-any.whl
| Download URL | piate-0.1.6-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d9d97ccf0793b80bd91c8f32adccb118fcaabebb0f08ea0a761a5ffcce4bbb9
|
|
BLAKE2b-256 checksum How to use checksums |
6116f24f59676f4a6b6aa32ced86a5c6f9bfa0cca318d53fd0a29de66d800a79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|