A Python wrapper for Yale's Lux API, provided by Yale University.
Project description
LuxY is a Python wrapper for Yale's Lux API. Currently, there is minimal support for the API, but it is in active development.
Installation
warning not on pypi yet...
pip install luxy
Usage
from luxy import PeopleGroups
result = (
PeopleGroups()
.filter(recordType="person")
.filter(hasDigitalImage=True)
.filter(text="rembrandt")
.filter(gender="male")
.get()
)
# print the number of results
print("Number of results:", result.num_results)
# print the url
print("URL:", result.url)
# print the json
print("JSON:", result.json)
Expected Output
Number of results: 131
URL: https://lux.collections.yale.edu/api/search/agent?q=%7B%22AND%22%3A%20%5B%7B%22recordType%22%3A%20%22person%22%7D%2C%20%7B%22hasDigitalImage%22%3A%201%7D%2C%20%7B%22text%22%3A%20%22rembrandt%22%7D%2C%20%7B%22gender%22%3A%20%7B%22id%22%3A%20%22https%3A//lux.collections.yale.edu/data/concept/6f652917-4c07-4d51-8209-fcdd4f285343%22%7D%7D%5D%7D
JSON: {'@context': 'https://linked.art/ns/v1/search.json'...
Working with Pagination
from luxy import PeopleGroups
result = (
PeopleGroups()
.filter(endAt={"name": "Amsterdam"})
.get()
)
# print the number of results
print("Number of results:", result.num_results)
print("Number of pages:", result.num_pages())
for i, page in enumerate(result.get_page_data_all(), 1):
if i > 2: # Break after 2 pages
break
print(f"Page {i}:", page["id"])
for j, item in enumerate(result.get_items(page)):
print(f"Item {j}:", result.get_item_data(item)["_label"])
Roadmap
- Add support for People/Groups
- Filter by:
- Has Digital Image
- Gender
- Nationality (nationality)
- Person or Group Class
- Categorized As (classification)
- Born/Formed At (startAt)
- Born/Formed Date
- Carried Out (carriedOut)
- Created Object (produced)
- Created Works (created)
- Curated (curated)
- Died/Dissolved At (endAt)
- Died/Dissolved Date
- Encountered
- Founded By
- Founded Group
- Have Member
- ID
- Identifier
- Influenced (influenced)
- Influenced Creation Of Objects
- Influenced Creation Of Works
- Member Of (memberOf)
- Occupation/Role (occupation)
- Professional Activity Categorized As (professionalActivity)
- Professionally Active At (activeAt)
- Professionally Active Date
- Published (published)
- Subject Of
- Filter by:
- Add support for Objects
- Add support for Works
- Add support for Places
- Add support for Concepts
- Add support for Events
- Add support for Pagination
- Add support for Downloading Page JSON
- Add support for Downloading Item JSON
- Add more filters
- Add And support for filters
- Add support for OR filters
- Add support for have All of
- Add support for have Any of
- Add support for have None of
- Add more tests
- Add more documentation
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
luxy-0.0.1.tar.gz
(8.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
luxy-0.0.1-py3-none-any.whl
(8.2 kB
view details)
File details
Details for the file luxy-0.0.1.tar.gz.
File metadata
- Download URL: luxy-0.0.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c99684ab3fc2c27643ae6a585f8c4f414621d0d4f92832d5ba8db7fe450fc4b
|
|
| MD5 |
ed4aab0418b15c76faf52a84b9b50ead
|
|
| BLAKE2b-256 |
ae1acb59358bded2b8f8a3f210105dda19f4447c217cacfca729f6ed4ae2802b
|
File details
Details for the file luxy-0.0.1-py3-none-any.whl.
File metadata
- Download URL: luxy-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f747317a6880322118a2b172e271236d60eb5bcd3cb3800e09f948183d392fa2
|
|
| MD5 |
4802e3a88c89dcd2507d382e3d9f2740
|
|
| BLAKE2b-256 |
df874ea4d3918637518403f1d595716b11e22bbece9eca560c0dc72d0d3f8349
|