Python Library to interact with the IATE database
Project description
piate
A python library and cli tool to interact with the IATE (Interactive Terminology for Europe) database.
Installing
pip install piate
Library
client(...)
The entrypoint into the library, allowing the provision of authentication.
With username and password
import piate
iate = piate.client(username="myusername", api_key="...")
With prebuilt session
import piate
from piate.api.session import Session
from piate.api.credentials import Credentials
iate = piate.client(
session=Session(
credentials=Credentials(
username="myusername",
api_key="..."
)
)
)
Collections
import piate
for page in piate.client(...).collections.pages():
for collection in page.items:
print(collection.name)
CLI tool
Currently working commands:
iate list-collections
iate list-domains
iate list-institutions
iate inventories list-languages
iate inventories list-primarities
iate inventories list-query-operators
iate inventories list-reliabilities
iate inventories list-searchable-fields
iate 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'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
piate-0.1.5.tar.gz
(12.9 kB
view hashes)
Built Distribution
piate-0.1.5-py3-none-any.whl
(17.5 kB
view hashes)