Flowdas工具包

flowdas的Python项目详细描述


flowdas需要python 3.4+。

flowdas.command

这个包提供了一种定义命令行接口的简单方法。

示例

# sample.py
from flowdas.command import Command


class SampleCommand(Command):
    """flowdas.command demo"""

    def sum(self, *number: int):
        """calculate the sum of integers"""
        print(sum(number))


if __name__ == '__main__':
    SampleCommand.main()
$ pip install flowdas
$ python sample.py sum 1 2 3
6

$ python sample.py
usage: sample.py [-h] {sum} ...

$ python sample.py -h
usage: sample.py [-h] {sum} ...

flowdas.command demo

optional arguments:
  -h, --help  show this help message and exit

subcommands:
  {sum}
    sum       calculate the sum of integers

flowdas.meta

用于模式建模的平台无关库

示例

>>> from flowdas import meta
>>> from pprint import pprint
...
>>> class Author(meta.Entity):
...    name = meta.String()
...
>>> class Book(meta.Entity):
...    title = meta.String()
...    published = meta.Date()
...    authors = Author[1:]()
...
>>> author1 = Author({'name': 'O'})
>>> author2 = Author()
>>> author2.update(name = 'Flowdas')
>>> book = Book()
>>> book.title = 'Meta'
>>> book.published = '2016-03-15'
>>> book.authors = [author1, author2]
>>> book.published
datetime.date(2016, 3, 15)
>>> book.validate()
>>> pprint(book.dump())
{'authors': [{'name': 'O'}, {'name': 'Flowdas'}],
 'published': '2016-03-15',
 'title': 'Meta'}

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

推荐PyPI第三方库


热门话题
Java中是否有数字的默认类型   java调用一个类的方法来使用另一个类的实例   java HtmlUnit不适用于javascript处理   java需要帮助才能连接MongoDB   java如何从Maven中的src/main/resources复制文件?   java保存Int值(共享首选项)   从另一个类调用方法时,java Autowired组件出现空指针异常   java Spring JPA:PropertyAccessException 1:。。。MethodInvocationException:。'driverClassName'。。。org/postgresql/Driver:不支持的专业。次要版本52.0   java使用增强的JDO模型类在Eclipse中运行Junit测试   java如何使用eclipse IDE为junit创建可运行的jar文件   java如何在安卓中检测应用程序的启动和退出   java在其他线程可以访问静态映射时从数据库更新静态映射   java@Entitty和@EntityScan不起作用。我正在使用SpringBoot和jpa存储库,发生了很多次   java如何与google日历集成?