创建自定义周/月/…照片日历

photo-calendar的Python项目详细描述


PhotoCalendar

创建自定义周/月/的Python实用程序…照片日历。 例如: template delphinus

目录

概述

程序以HTML格式创建日历。

Note: you can then print it to PDF using browser or, e.g., weasyptint utility.

用户可以提供(参见examples below):

  • 工作日和月份的名称及其缩写
  • 图像(每周,用于标题页,用于背景)
  • 命名日期
  • 公共假日
  • 宗教节日
  • 便条(朋友的生日、周年纪念等)
  • 为最终日历制作模板
  • 标题,第一个星期日…
HTML模板

生成的html结构和css样式由template定义,template是一个python模块,定义toHTMLString(calendar)函数和CSSString字符串变量。 作为一个例子和灵感,提供了一些预定义的模板。 有关如何创建自定义模板的详细信息,请参阅examples,文档或源代码。

兼容性

这个包可以与Python2和3一起工作(在Ubuntu 16.04 LTS和Python2.7.12以及Python3.5.2上测试)。

示例

使用量

Python:

fromphotocalendarimportPhotoCalendarcalendar=PhotoCalendar(# not all arguments are mandatoryoutputBase="/some/output/base",year=2019,firstWeekDay="Tu",# Tuesday as the first week day? Well, why not...imagesDirectory="/some/directory/with/images/for/each/week",imageDescriptionsFile="/some/file/with/image/descriptions/for/each/week",backgroundImagesDirectory="/some/directory/with/backround/images/for/each/week",title="Some calendar title",titlePageImage="/some/image/for/title/page",titlePageBackground="/some/background/image/for/titlepage",lastPageBackground="/some/background/image/for/last/page",nameDaysFile="/some/file/with/name-days",religiousHolidaysFile="/some/file/with/religious/holidays",publicHolidaysFile="/some/file/with/public/holidays",notesFile="/some/file/with/notes/like/birthdays/etc",weekDayNamesFile="/some/file/with/custom/weekday/names",abbrWeekDayNamesFile="/some/file/with/custom/abbreviated/weekday/names",monthNamesFile="/some/file/with/custom/month/names",abbrMonthNamesFile="/some/file/with/custom/abbreviated/month/names",template="delphinus",)calendar.toHTML()

外壳:

# not all arguments are mandatory
photocalendar \
	--output-base                 /some/output/base \
	--year                        2019\
	--first-week-day              Tu \
	--images-directory            /some/directory/with/images/for/each/week  \
	--image-descriptions-file     /some/file/with/image/descriptions/for/each/week \
	--background-images-directory /some/directory/with/backround/images/for/each/week \
	--title                       "Some calendar title"\
	--title-page-image            /some/image/for/title/page \
	--title-page-background       /some/background/image/for/titlepage \
	--last-page-background        /some/background/image/for/last/page \
	--name-days-file              /some/file/with/name-days \
	--religious-holidays-file     /some/file/with/religious/holidays \
	--public-holidays-file        /some/file/with/public/holidays \
	--notes-file                  /some/file/with/notes/like/birthdays/etc \
	--week-day-names-file         /some/file/with/custom/week/day/names \
	--abbr-week-day-names-file    /some/file/with/custom/abbreviated/week/day/names \
	--month-names-file            /some/file/with/custom/month/names \
	--abbr-month-names-file       /some/file/with/custom/abbreviated/month/names \
	--template                    delphinus

模板示例

Note: the photos and backgrounds are only illustrative. They are provided by the user in the real use case.

将显示标题页和一个内页。

在插图中, picture 属于 Golden Gate Bridgepicture 属于 Matterhorn 使用。

模板Delphinus:

每周A5景观日历 template delphinus

模板Columba:

A4月历 template delphinus

模板狼疮:

两周日历 template delphinus

安装

  1. 使用setup.py文件:

    python setup.py install [options],例如python setup.py --user

  2. 使用make(内部调用setup.py):

    make install [options],例如make install USER=TRUE PYTHON=python3

  3. 使用^{}

    [sudo] pip install [options] photo-calendar,例如pip install --user photo-calendar

这里是什么

file/directorydescription
bindirectory containing executable python script
docsource files for HTML documentation
examplesdirectory with examples
imagesimages for github page (e.g., templates illustrations)
localefiles for localization (public holidays, name days, etc.)
Makefilemakefile for the project (with targets ^{}, ^{}, ^{}, ^{}, ^{}, ^{})
photocalendaractual python package
setup.pypython setup file for installation
testspython unit tests

贡献

拉取请求

很受欢迎。特别是:

  • 地区(名称日期、公共假日)
  • 模板

但是,请事先和作者讨论一下目的。

错误报告

如有任何问题,请在githup page of the project留言。

贡献者

许可证

此项目是根据lgpl许可证授权的-有关详细信息,请参见license file

致谢

  • 向Petr Hlav_ek介绍最初的想法和LaTex实现,并提供他的源代码
  • 为了html创作灵感dominate python package

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

推荐PyPI第三方库


热门话题
java附加两个数组   java如何在Extjs的不同页面中使用相同的存储   java Jung,大顶点的布局重叠,图形出现在奇怪的位置   java如何在Android中通过画布绘制圆?   java验证库设计模式选择   java研磨机未知标记“timedTests”   java Android领域子类实例方法   java使用resteasy/jaxrs从请求负载接收两种类型的数据   缓冲策略Java缓冲策略有时不能正确绘制   java跟踪棋子   密度无关像素如何在java中锐化图像缩略图?   java如何在MongoDB更新查询中编写(或)更新   java A*寻路游戏系统退出问题   java在安卓中读取xml的最佳方式是什么?   通过反射调用的方法的java抑制警告   安卓 java。语言错误:信号11(SIGSEGV),代码10(?),故障地址006e006f   java lombok 1.18.2使用DexBuilderForDebug抛出TransformClasses   java JOptionPane CD对话框按钮?   java只返回json中的一些值,而不是完整实体对象   java包不存在错误,请稍后重试