搜索未斜杠的照片

unsplash-search的Python项目详细描述


反斜杠搜索

unsplash search是一个小的python库,用于从unsplash照片宿主网站搜索照片。

安装

pip install unsplash-search

用法

导入UnsplashSearch模块

from unsplash_search import UnsplashSearch

必须从unsplash deverloper api网站获取访问密钥。

然后必须用密钥实例化unsplashsearch类才能使用该程序。

unsplash = UnsplashSearch(YOUR_KEY)

使用查询进行搜索

unsplash搜索方法接受一个查询作为参数,以确定您的照片类型 想要得到。

如果成功,它将返回一个随机图像字典。

img = unsplash.search('mountains') #=> dict

image dictionary对象有两个键:图像的url和作者的instagram用户名。

因此,如果您只想获得与查询匹配的随机图像,请执行以下操作

img['img']

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java LineNumberReader。如果查询行为不正确,则返回readLine()   java包含了一个使用AndroidX的工具栏,这让我的应用程序崩溃了   JVM设置通过“java jar”运行应用程序的最佳实践   java如何获取ImageButton宽度   java Oracle SQLLDR实用程序无响应   列出Java获取对象的arrayList中最常见的元素   java使用带有FlowLayout的getContentpane对布局应用更改,但不起作用为什么?   在java中,我可以在画布上绘制画布吗?   编译游戏代码时发生java异常错误   从firestore获取java Webview失败   java将TableLayout中单元格的内容向右对齐   java无法在发布模式下启动活动(使用proguard安卓optimize配置)   java允许在线程期间进行GUI更新。睡觉   java如何对以变量为列表的列表进行排序   API URL上的java Google云端点异常