没有项目描述
tableschema-spss的Python项目详细描述
一个spss的表结构spss的py
=
=
ptors.
功能
--
-实施`` tableschema.storage``接口
这意味着主要的版本可能会包含破坏性的更改。强烈建议在"设置/要求"文件中指定"包"
版本范围,例如
"包">;=1.0,<;2.0`。
代码::bash
pip install tableschema spss
示例
~~~~~~~
本自述中的代码示例需要python 3.3+解释器。您可以在
`examples<;https://github.com/frictionlessdata/tableschema spss py/tree/master/examples>;` `
目录中看到更多示例。
对于此示例,您的架构应该与spss存储兼容
-
https://github.com/frictionlessdata/tableschema spss py创建sav文件
…代码::python
from table schema import table
包在此描述,并遵循
语义版本控制规则。本自述文件之外的所有内容都是私有的
API,可以在不通知任何新版本的情况下进行更改。
~~~~~~
package实现了"tabular
storage<;https://github.com/frictionlessdata/tableschema py\storage>;`\链接上的位置:
storage
这个驱动程序提供了一个额外的api:
``存储(基路径=无)```
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``基路径(str```-一个有效的目录路径,可以在其中
创建和读取.sav文件。如果未提供基路径,则存储对象
方法将接受文件路径,而不是存储桶名称。
``storage.buckets``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
只有在存储具有有效的基本路径时才会维护存储桶列表,否则将返回无。
-```(str[]/none)``-返回存储桶列表或具有基本路径
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
代码::python
from tableschema_spss import storage
storage=storage(storage_base_path)
然后我们可以与存储桶进行交互("bucket"是spss.sav/.zsav
在此上下文中的文件):
代码::python
storage.buckets\list buckets in storage
storage.create('bucket',descriptor)
storage.delete('bucket')\delete named bucket
storage.delete()\delete storage
storage.descripte('bucket')\return tableschema descriptor
storage.iter('bucket')生成行
storage.read('bucket')返回行
storage.write('bucket',rows)
代码::python
代码::python
storage.create('data/my bucket.sav',descriptor)
storage.delete('data/my bucket.sav')删除命名文件
storage.descripte('data/my bucket.sav')返回表模式描述符
storage.iter('data/my bucket.sav')生成行
storage.read('data/my bucket.sav')返回行
storage.write('data/my bucket.sav',rows)
注意,没有基本路径的存储不会维护桶的内部列表
,因此调用"storage.bucket"将返回"none"。
r/>在读取spss数据时,spss日期格式、``date``、``jdate`、
``edate`、``sdate`、``adate`、``date time`、``time`和``time``在适当情况下被转换成python``date`、``datetime`和``time``对象。
`` wkyr``、
``qyr``和``dtime``不支持本机转换,并且
将作为字符串返回。
perty用
以下模式定义:
-``日期`:`%y-%m-%d``
-``日期时间`:``%y-%m-%d%h:%m:%s``
-``时间`:`%h:`%m:%s.%f`
传递给``storage.create()``的表架构描述符应包含一个
自定义的``spss:format``属性,定义spss类型格式化
需要表示的数据。例如:
…代码::json
{
"fields":[
{
"name":"person_id",
"type":"integer",
"spss:format":"f8"
},
{
"name":"name",
"type":"string",
"spss:format":"a10"
},
{
"type":"number",
"name":"salary",
"title":"current salary",
"spss:format":"dollar8"
},
{
"type":"date"、
"name":"bdate"、
"title":"date of birth"、
"format":"%y-%m-%d"、
"spss:format":"adate10"
}
]
}
}
`开放知识国际编码
标准<;https://github.com/okfn/coding standards/>用法:
$make install
代码:bash
$make test
在这个
阶段,它已经
安装到您的环境中,可以与文档中描述的更多
细粒度控制单独使用-
https://pylama.readthedocs.io/en/latest/
例如,按错误类型对结果排序:
。代码::bash
$pylama--sort<;path>;
st/
代码::bash
tox-e py27--v tests/<;path>;
此软件包仅在tox
环境中可用。此处仅描述了中断和最重要的更改。所有发布版本的完整
变更日志和文档可以在
格式良好的'commit
history<;https://github.com/friectionlessdata/tableschema-spss-py/commits/mast中找到er>;`.
~~~~~
初始驱动程序实现。
……| travis图像::https://img.shields.io/travis/friectionlessdata/tableschema spss py/master.svg
:目标:https://travis ci.org/friectionlessdata/tableschema spss py
。|工作服图片::http://img.shields.io/covertalls/frictionlessdata/tableschema spss py/master.svg
:目标:https://covertalls.io/r/frictionlessdata/tableschema-spss-py?分支=主
…| pypi图像::https://img.shields.io/pypi/v/tableschema spss.svg
:目标:https://pypi.python.org/pypi/tableschema spss
…| gitter图像::https://img.shields.io/gitter/room/friectionlessdata/chat.svg
:目标:https://gitter.im/friectionlessdata/chat
。|存储图像::https://i.imgur.com/rqgrxqp.png
=
=
ptors.
功能
--
-实施`` tableschema.storage``接口
这意味着主要的版本可能会包含破坏性的更改。强烈建议在"设置/要求"文件中指定"包"
版本范围,例如
"包">;=1.0,<;2.0`。
代码::bash
pip install tableschema spss
示例
~~~~~~~
本自述中的代码示例需要python 3.3+解释器。您可以在
`examples<;https://github.com/frictionlessdata/tableschema spss py/tree/master/examples>;` `
目录中看到更多示例。
对于此示例,您的架构应该与spss存储兼容
-
https://github.com/frictionlessdata/tableschema spss py创建sav文件
…代码::python
from table schema import table
包在此描述,并遵循
语义版本控制规则。本自述文件之外的所有内容都是私有的
API,可以在不通知任何新版本的情况下进行更改。
package实现了"tabular
storage<;https://github.com/frictionlessdata/tableschema py\storage>;`\链接上的位置:
storage
这个驱动程序提供了一个额外的api:
``存储(基路径=无)```
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``基路径(str```-一个有效的目录路径,可以在其中
创建和读取.sav文件。如果未提供基路径,则存储对象
方法将接受文件路径,而不是存储桶名称。
``storage.buckets``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
只有在存储具有有效的基本路径时才会维护存储桶列表,否则将返回无。
-```(str[]/none)``-返回存储桶列表或具有基本路径
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
代码::python
from tableschema_spss import storage
然后我们可以与存储桶进行交互("bucket"是spss.sav/.zsav
在此上下文中的文件):
代码::python
storage.buckets\list buckets in storage
storage.create('bucket',descriptor)
storage.delete('bucket')\delete named bucket
storage.delete()\delete storage
storage.descripte('bucket')\return tableschema descriptor
storage.iter('bucket')生成行
storage.read('bucket')返回行
storage.write('bucket',rows)
代码::python
代码::python
storage.create('data/my bucket.sav',descriptor)
storage.delete('data/my bucket.sav')删除命名文件
storage.descripte('data/my bucket.sav')返回表模式描述符
storage.iter('data/my bucket.sav')生成行
storage.read('data/my bucket.sav')返回行
storage.write('data/my bucket.sav',rows)
注意,没有基本路径的存储不会维护桶的内部列表
,因此调用"storage.bucket"将返回"none"。
r/>在读取spss数据时,spss日期格式、``date``、``jdate`、
``edate`、``sdate`、``adate`、``date time`、``time`和``time``在适当情况下被转换成python``date`、``datetime`和``time``对象。
`` wkyr``、
``qyr``和``dtime``不支持本机转换,并且
将作为字符串返回。
perty用
以下模式定义:
-``日期`:`%y-%m-%d``
-``日期时间`:``%y-%m-%d%h:%m:%s``
-``时间`:`%h:`%m:%s.%f`
传递给``storage.create()``的表架构描述符应包含一个
自定义的``spss:format``属性,定义spss类型格式化
需要表示的数据。例如:
…代码::json
{
"fields":[
{
"name":"person_id",
"type":"integer",
"spss:format":"f8"
},
{
"name":"name",
"type":"string",
"spss:format":"a10"
},
{
"type":"number",
"name":"salary",
"title":"current salary",
"spss:format":"dollar8"
},
{
"type":"date"、
"name":"bdate"、
"title":"date of birth"、
"format":"%y-%m-%d"、
"spss:format":"adate10"
}
]
}
}
`开放知识国际编码
标准<;https://github.com/okfn/coding standards/>用法:
$make install
代码:bash
$make test
在这个
阶段,它已经
安装到您的环境中,可以与文档中描述的更多
细粒度控制单独使用-
https://pylama.readthedocs.io/en/latest/
例如,按错误类型对结果排序:
。代码::bash
$pylama--sort<;path>;
st/
代码::bash
tox-e py27--v tests/<;path>;
此软件包仅在tox
环境中可用。此处仅描述了中断和最重要的更改。所有发布版本的完整
变更日志和文档可以在
格式良好的'commit
history<;https://github.com/friectionlessdata/tableschema-spss-py/commits/mast中找到er>;`.
初始驱动程序实现。
……| travis图像::https://img.shields.io/travis/friectionlessdata/tableschema spss py/master.svg
:目标:https://travis ci.org/friectionlessdata/tableschema spss py
。|工作服图片::http://img.shields.io/covertalls/frictionlessdata/tableschema spss py/master.svg
:目标:https://covertalls.io/r/frictionlessdata/tableschema-spss-py?分支=主
…| pypi图像::https://img.shields.io/pypi/v/tableschema spss.svg
:目标:https://pypi.python.org/pypi/tableschema spss
…| gitter图像::https://img.shields.io/gitter/room/friectionlessdata/chat.svg
:目标:https://gitter.im/friectionlessdata/chat
。|存储图像::https://i.imgur.com/rqgrxqp.png