Python 3 开发工具集合 Borax

码农软件 · 软件分类 · 常用工具包 · 2019-08-12 14:28:57

软件介绍

 ____
| __ )  ___  _ __ __ ___  __
|  _ \ / _ \| '__/ _` \ \/ /
| |_) | (_) | | | (_| |>  <
|____/ \___/|_|  \__,_/_/\_\

Borax 是一个Python3开发工具集合,包含了常用的数据结构和设计模式。

模块

包括了以下模块:

  • 中国农历日期 borax.calendars.lunardate

  • 国际/国内节日 borax.calendars.festivals

  • 树形数据结构 borax.structures.tree

  • 单例模式 borax.patterns.singleton

  • 代理模式 borax.patterns.lazy

  • json序列化 borax.serialize.bjson / borax.serialize.cjson

  • 财务金额格式化 borax.finance

  • 别名字典、属性字典 borax.dictionary

  • 列表常用函数 borax.utils

使用示例

农历日期

>>>from borax.calendars.lunardate import LunarDate, LCalendars
>>>LunarDate(2018, 7, 1)
LunarDate(2018, 7, 1, 0)
>>>ld = LunarDate.from_solar_date(2018, 8, 11)
>>>ld
LunarDate(2018, 7, 1, 0)
>>>LCalendars.ndays(2018)
354
>>>LCalendars.ndays(2018, 12)
30
>>>LCalendars.ndays(2017, 6, 1)
30

金额大写

>>> from borax.finance import financial_amount_capital
>>> financial_amount_capital(100000000)
'壹亿元整'
>>>financial_amount_capital(4578442.23)
'肆佰伍拾柒万捌仟肆佰肆拾贰元贰角叁分'
>>>financial_amount_capital(107000.53)
壹拾万柒仟元伍角叁分

字段选取

from borax.fetch import fetch

objects = [
    {'id': 282, 'name': 'Alice', 'age': 30},
    {'id': 217, 'name': 'Bob', 'age': 56},
    {'id': 328, 'name': 'Charlie', 'age': 56},
]

names = fetch(objects, 'name')
print(names)

更多示例查看 https://kinegratii.github.io/borax

本文地址:https://www.codercto.com/soft/d/12206.html

嵌入式Linux应用程序开发详解

嵌入式Linux应用程序开发详解

孙琼 / 人民邮电出版社 / 2006-7 / 46.00元

《嵌入式Linux应用程序开发详解》主要分为3个部分,包括Linux基础、搭建嵌入式Linux环境和嵌入式Linux的应用开发。Linux基础部分从Linux的安装过程、基本操作命令讲起,为Linux初学者能快速入门提供了保证。接着系统地讲解了嵌入式Linux的环境搭建,以及嵌入式Linux的I/O与文件系统的开发、进程控制开发、进程间通信开发、网络应用开发、基于中断的开发、设备驱动程序的开发以及......一起来看看 《嵌入式Linux应用程序开发详解》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

随机密码生成器
随机密码生成器

多种字符组合密码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具