pychee
Client for Lychee, written in Python.
Lychee is a photo management system I've been using for years. I had the idea to make a « Lychee filesystem » with FUSE, so I needed an API client.
Installation
python3 -m pip install pychee
Notes
My reference is this documentation.
The API is partially implemented and focused on photo management, i.e. only
Albums, Photo, Frame, Sharing and Settings::setLogin. Users can do
whatever they want with their albums and photos and change their password.
Disclaimer : I usually suck at coding, so use with caution and at your own risks. Tested with Lychee v4.7.0. The code probably won't be retrocompatible and should just work with the latest version.
TODO
Add tests
Example usage
⚠️
pycheereturns exactly what the API sends back, just parsing it todictif necessary. As sample answers are not documented in the API and because answers tend to change over time, you should inspect requests in browser if your client code does not works anymore.
A sample of common API calls :
#!/usr/bin/env python
# coding=utf-8
from pychee import pychee
# Initialize instance
client = pychee.LycheeClient('https://pic.chosto.me')
# Login
client.login('login', 'password')
# Create a new album
album_name = 'test_name'
album_id = client.add_album(album_name)['id']
# Add a photo in the created album
path_to_your_photo = '/your/path/photo.jpg'
with open(path_to_your_photo, 'rb') as f:
photo_id = client.add_photo(f, 'photo.jpg', album_id)['id']
# Set uploaded photo public
client.set_photo_public(photo_id)
# Set licence of uploaded photo
client.set_photo_license(photo_id, 'CC0')
# Download an archive of the created album
output_path = '/tmp/photos.zip'
with(open(output_path, 'wb')) as f:
f.write(client.get_albums_archive([album_id]))
# Logout
client.logout()
Documentation
Documentation is automatically published on GitHub: https://chostakovitch.github.io/pychee/index.html
Metadata
Release files for pychee 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pychee-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for pychee-0.2.2-py3-none-any.whl |
Release files / pychee-0.2.2-py3-none-any.whl
| Download URL | pychee-0.2.2-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1065d8ec76c6dfe0a9d3403b9ecf0f16825704a1af00abd36d358eeb71c771d9
|
|
BLAKE2b-256 checksum How to use checksums |
80718a08727e5128ae451073a59b9bdb14134ef3d025afe3c183d92fc805760b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for pychee 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.